feat(client): uninstallModule takes optional version param
Some checks failed
Security / Security check (push) Failing after 2s

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-05-28 14:26:47 +02:00
parent 332d11af1d
commit ed92f337b4
3 changed files with 27 additions and 3 deletions

View file

@ -1959,11 +1959,15 @@ class InstallModuleResponse extends $pb.GeneratedMessage {
class UninstallModuleRequest extends $pb.GeneratedMessage {
factory UninstallModuleRequest({
$core.String? name,
$core.String? version,
}) {
final $result = create();
if (name != null) {
$result.name = name;
}
if (version != null) {
$result.version = version;
}
return $result;
}
UninstallModuleRequest._() : super();
@ -1972,6 +1976,7 @@ class UninstallModuleRequest extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'UninstallModuleRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'fai.v1'), createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'name')
..aOS(2, _omitFieldNames ? '' : 'version')
..hasRequiredFields = false
;
@ -1999,6 +2004,18 @@ class UninstallModuleRequest extends $pb.GeneratedMessage {
$core.bool hasName() => $_has(0);
@$pb.TagNumber(1)
void clearName() => $_clearField(1);
/// Optional exact version to remove when multiple versions of the
/// same `(provider, name)` are installed side-by-side. Empty
/// falls back to "remove the highest-version match".
@$pb.TagNumber(2)
$core.String get version => $_getSZ(1);
@$pb.TagNumber(2)
set version($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasVersion() => $_has(1);
@$pb.TagNumber(2)
void clearVersion() => $_clearField(2);
}
class UninstallModuleResponse extends $pb.GeneratedMessage {

View file

@ -494,12 +494,14 @@ const UninstallModuleRequest$json = {
'1': 'UninstallModuleRequest',
'2': [
{'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
{'1': 'version', '3': 2, '4': 1, '5': 9, '10': 'version'},
],
};
/// Descriptor for `UninstallModuleRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List uninstallModuleRequestDescriptor = $convert.base64Decode(
'ChZVbmluc3RhbGxNb2R1bGVSZXF1ZXN0EhIKBG5hbWUYASABKAlSBG5hbWU=');
'ChZVbmluc3RhbGxNb2R1bGVSZXF1ZXN0EhIKBG5hbWUYASABKAlSBG5hbWUSGAoHdmVyc2lvbh'
'gCIAEoCVIHdmVyc2lvbg==');
@$core.Deprecated('Use uninstallModuleResponseDescriptor instead')
const UninstallModuleResponse$json = {

View file

@ -232,8 +232,13 @@ class HubClient {
/// directory + re-scans the registry; writes a
/// `module.uninstalled` audit event. Returned response carries
/// the version that was removed.
Future<UninstallModuleResponse> uninstallModule(String name) {
return _admin.uninstallModule(pb.UninstallModuleRequest(name: name));
Future<UninstallModuleResponse> uninstallModule(
String name, {
String version = '',
}) {
return _admin.uninstallModule(
pb.UninstallModuleRequest(name: name, version: version),
);
}
/// Fetch a module's README markdown via the hub. The hub