feat(client): listStores / addStore / removeStore for the store manager
Some checks failed
Security / Security check (push) Failing after 2s
Some checks failed
Security / Security check (push) Failing after 2s
Regenerate the gRPC stubs for the new HubAdmin store-management RPCs and wrap them in HubClient (returns StoreSource list / Add+RemoveStoreResponse) so Studio can list and edit the module-store list from the GUI. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
2d87030945
commit
d07a0a9777
8 changed files with 956 additions and 143 deletions
|
|
@ -51,6 +51,9 @@ typedef VerifyEventChainResponse = pb.VerifyEventChainResponse;
|
|||
typedef CheckUpdateResponse = pb.CheckUpdateResponse;
|
||||
typedef ChannelStatusResponse = pb.ChannelStatusResponse;
|
||||
typedef ChannelEntry = pb.ChannelEntry;
|
||||
typedef StoreSource = pb.StoreSource;
|
||||
typedef AddStoreResponse = pb.AddStoreResponse;
|
||||
typedef RemoveStoreResponse = pb.RemoveStoreResponse;
|
||||
typedef SystemAiStatusResponse = pb.SystemAiStatusResponse;
|
||||
typedef AskAiResponse = pb.AskAiResponse;
|
||||
typedef ListSystemAiModelsResponse = pb.ListSystemAiModelsResponse;
|
||||
|
|
@ -646,6 +649,38 @@ class HubClient {
|
|||
return r.entries;
|
||||
}
|
||||
|
||||
/// List the configured module stores (operator config `stores:`) plus
|
||||
/// the bundled seed, each with how many modules it contributes to the
|
||||
/// live index. Backs the Studio store manager.
|
||||
Future<List<StoreSource>> listStores() async {
|
||||
final r = await _admin.listStores(pb.ListStoresRequest());
|
||||
return r.stores;
|
||||
}
|
||||
|
||||
/// Register a new module store. The hub fetches + validates its index,
|
||||
/// persists it to config, and merges it live so its modules are
|
||||
/// immediately searchable + installable.
|
||||
Future<AddStoreResponse> addStore({
|
||||
required String name,
|
||||
required String url,
|
||||
String bearerEnv = '',
|
||||
String basicUser = '',
|
||||
String basicPasswordEnv = '',
|
||||
}) {
|
||||
return _admin.addStore(pb.AddStoreRequest(
|
||||
name: name,
|
||||
url: url,
|
||||
bearerEnv: bearerEnv,
|
||||
basicUser: basicUser,
|
||||
basicPasswordEnv: basicPasswordEnv,
|
||||
));
|
||||
}
|
||||
|
||||
/// Drop a configured store by name. The bundled seed cannot be removed.
|
||||
Future<RemoveStoreResponse> removeStore(String name) {
|
||||
return _admin.removeStore(pb.RemoveStoreRequest(name: name));
|
||||
}
|
||||
|
||||
/// Install a module from a `.fai` bundle. [source] is either a
|
||||
/// URL or a local filesystem path; [expectedSha256] is an
|
||||
/// optional hex digest the hub verifies before unpacking.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue