diff --git a/lib/src/generated/fai/v1/hub.pb.dart b/lib/src/generated/fai/v1/hub.pb.dart index 258fada..5492dce 100644 --- a/lib/src/generated/fai/v1/hub.pb.dart +++ b/lib/src/generated/fai/v1/hub.pb.dart @@ -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 { diff --git a/lib/src/generated/fai/v1/hub.pbjson.dart b/lib/src/generated/fai/v1/hub.pbjson.dart index b1633db..3e088f0 100644 --- a/lib/src/generated/fai/v1/hub.pbjson.dart +++ b/lib/src/generated/fai/v1/hub.pbjson.dart @@ -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 = { diff --git a/lib/src/hub_client.dart b/lib/src/hub_client.dart index 983c19f..b0e1000 100644 --- a/lib/src/hub_client.dart +++ b/lib/src/hub_client.dart @@ -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 uninstallModule(String name) { - return _admin.uninstallModule(pb.UninstallModuleRequest(name: name)); + Future 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