@calimero-network/mero-js 1.2.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -0
- package/dist/admin-api/admin-client.d.ts +64 -14
- package/dist/admin-api/admin-client.d.ts.map +1 -1
- package/dist/admin-api/admin-client.js +186 -13
- package/dist/admin-api/admin-client.js.map +1 -1
- package/dist/admin-api/admin-types.d.ts +391 -12
- package/dist/admin-api/admin-types.d.ts.map +1 -1
- package/dist/admin-api/admin-types.js +2 -1
- package/dist/admin-api/admin-types.js.map +1 -1
- package/dist/cloud/cloud-client.d.ts +20 -0
- package/dist/cloud/cloud-client.d.ts.map +1 -0
- package/dist/cloud/cloud-client.js +26 -0
- package/dist/cloud/cloud-client.js.map +1 -0
- package/dist/cloud/index.d.ts +3 -0
- package/dist/cloud/index.d.ts.map +1 -0
- package/dist/cloud/index.js +2 -0
- package/dist/cloud/index.js.map +1 -0
- package/dist/index.browser.mjs +2 -2
- package/dist/index.browser.mjs.map +4 -4
- package/dist/index.cjs +316 -15
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +316 -15
- package/dist/index.mjs.map +3 -3
- package/dist/rpc/index.d.ts +2 -1
- package/dist/rpc/index.d.ts.map +1 -1
- package/dist/rpc/index.js +0 -1
- package/dist/rpc/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -11,4 +11,5 @@ export { RpcClient, RpcError } from './rpc';
|
|
|
11
11
|
export type { ExecuteParams } from './rpc';
|
|
12
12
|
export { SseClient, WsClient } from './events';
|
|
13
13
|
export type { SseEventData, WsEventData } from './events';
|
|
14
|
+
export * from './cloud';
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGzD,cAAc,eAAe,CAAC;AAG9B,cAAc,YAAY,CAAC;AAG3B,cAAc,aAAa,CAAC;AAG5B,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC9D,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAGnE,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACzE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC/C,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGzD,cAAc,eAAe,CAAC;AAG9B,cAAc,YAAY,CAAC;AAG3B,cAAc,aAAa,CAAC;AAG5B,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC9D,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAGnE,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACzE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC/C,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAG1D,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,5 +16,7 @@ export { MemoryTokenStore, LocalStorageTokenStore } from './token-store';
|
|
|
16
16
|
export { RpcClient, RpcError } from './rpc';
|
|
17
17
|
// Events (SSE / WebSocket)
|
|
18
18
|
export { SseClient, WsClient } from './events';
|
|
19
|
+
// Cloud client (enable-HA, disable-HA)
|
|
20
|
+
export * from './cloud';
|
|
19
21
|
// Utilities
|
|
20
22
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,uEAAuE;AAEvE,iBAAiB;AACjB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGjD,2CAA2C;AAC3C,cAAc,eAAe,CAAC;AAE9B,kBAAkB;AAClB,cAAc,YAAY,CAAC;AAE3B,mBAAmB;AACnB,cAAc,aAAa,CAAC;AAE5B,iBAAiB;AACjB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAG9D,cAAc;AACd,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAGzE,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG5C,2BAA2B;AAC3B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAG/C,YAAY"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,uEAAuE;AAEvE,iBAAiB;AACjB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGjD,2CAA2C;AAC3C,cAAc,eAAe,CAAC;AAE9B,kBAAkB;AAClB,cAAc,YAAY,CAAC;AAE3B,mBAAmB;AACnB,cAAc,aAAa,CAAC;AAE5B,iBAAiB;AACjB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAG9D,cAAc;AACd,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAGzE,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG5C,2BAA2B;AAC3B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAG/C,uCAAuC;AACvC,cAAc,SAAS,CAAC;AAExB,YAAY"}
|
package/dist/index.mjs
CHANGED
|
@@ -666,6 +666,16 @@ var AdminApiClient = class {
|
|
|
666
666
|
return unwrap(await this.httpClient.get(`/admin-api/applications/${appId}`));
|
|
667
667
|
}
|
|
668
668
|
// ---- Package Management ----
|
|
669
|
+
async listPackages() {
|
|
670
|
+
return unwrap(await this.httpClient.get("/admin-api/packages"));
|
|
671
|
+
}
|
|
672
|
+
async listPackageVersions(packageName) {
|
|
673
|
+
return unwrap(
|
|
674
|
+
await this.httpClient.get(
|
|
675
|
+
`/admin-api/packages/${encodeURIComponent(packageName)}/versions`
|
|
676
|
+
)
|
|
677
|
+
);
|
|
678
|
+
}
|
|
669
679
|
async getLatestPackageVersion(packageName) {
|
|
670
680
|
return this.httpClient.get(
|
|
671
681
|
`/admin-api/packages/${encodeURIComponent(packageName)}/latest`
|
|
@@ -675,7 +685,16 @@ var AdminApiClient = class {
|
|
|
675
685
|
async createContext(request) {
|
|
676
686
|
return unwrap(await this.httpClient.post("/admin-api/contexts", request));
|
|
677
687
|
}
|
|
678
|
-
async deleteContext(contextId) {
|
|
688
|
+
async deleteContext(contextId, request) {
|
|
689
|
+
if (request) {
|
|
690
|
+
return unwrap(
|
|
691
|
+
await this.httpClient.request(`/admin-api/contexts/${contextId}`, {
|
|
692
|
+
method: "DELETE",
|
|
693
|
+
body: JSON.stringify(request),
|
|
694
|
+
headers: { "Content-Type": "application/json" }
|
|
695
|
+
})
|
|
696
|
+
);
|
|
697
|
+
}
|
|
679
698
|
return unwrap(await this.httpClient.delete(`/admin-api/contexts/${contextId}`));
|
|
680
699
|
}
|
|
681
700
|
async getContexts() {
|
|
@@ -697,12 +716,39 @@ var AdminApiClient = class {
|
|
|
697
716
|
async getContextIdentitiesOwned(contextId) {
|
|
698
717
|
return unwrap(await this.httpClient.get(`/admin-api/contexts/${contextId}/identities-owned`));
|
|
699
718
|
}
|
|
700
|
-
// ---- Context
|
|
701
|
-
async
|
|
702
|
-
return unwrap(
|
|
719
|
+
// ---- Context join (group membership) ----
|
|
720
|
+
async joinContext(contextId) {
|
|
721
|
+
return unwrap(
|
|
722
|
+
await this.httpClient.post(`/admin-api/contexts/${contextId}/join`, {})
|
|
723
|
+
);
|
|
724
|
+
}
|
|
725
|
+
// ---- Context group / storage / sync ----
|
|
726
|
+
async getContextGroup(contextId) {
|
|
727
|
+
return unwrap(await this.httpClient.get(`/admin-api/contexts/${contextId}/group`));
|
|
728
|
+
}
|
|
729
|
+
async getContextStorage(contextId) {
|
|
730
|
+
return unwrap(await this.httpClient.get(`/admin-api/contexts/${contextId}/storage`));
|
|
731
|
+
}
|
|
732
|
+
async syncContext(contextId) {
|
|
733
|
+
await this.httpClient.post(`/admin-api/contexts/sync/${contextId ?? ""}`, {});
|
|
734
|
+
}
|
|
735
|
+
async inviteSpecializedNode(request) {
|
|
736
|
+
return unwrap(
|
|
737
|
+
await this.httpClient.post(
|
|
738
|
+
"/admin-api/contexts/invite-specialized-node",
|
|
739
|
+
request
|
|
740
|
+
)
|
|
741
|
+
);
|
|
742
|
+
}
|
|
743
|
+
async updateContextApplication(contextId, request) {
|
|
744
|
+
await this.httpClient.post(`/admin-api/contexts/${contextId}/application`, request);
|
|
703
745
|
}
|
|
704
|
-
async
|
|
705
|
-
return unwrap(
|
|
746
|
+
async getContextsWithExecutorsForApplication(applicationId) {
|
|
747
|
+
return unwrap(
|
|
748
|
+
await this.httpClient.get(
|
|
749
|
+
`/admin-api/contexts/with-executors/for-application/${applicationId}`
|
|
750
|
+
)
|
|
751
|
+
);
|
|
706
752
|
}
|
|
707
753
|
// ---- Blob Management ----
|
|
708
754
|
async uploadBlob(data) {
|
|
@@ -718,24 +764,43 @@ var AdminApiClient = class {
|
|
|
718
764
|
return unwrap(await this.httpClient.get(`/admin-api/blobs/${blobId}`));
|
|
719
765
|
}
|
|
720
766
|
// ---- Alias Management ----
|
|
721
|
-
// Server uses type-specific alias routes: /admin-api/alias/{create,lookup,delete,list}/{context,application}
|
|
722
767
|
async createContextAlias(request) {
|
|
723
|
-
return this.httpClient.post("/admin-api/alias/create/context", request);
|
|
768
|
+
return unwrap(await this.httpClient.post("/admin-api/alias/create/context", request));
|
|
724
769
|
}
|
|
725
770
|
async createApplicationAlias(request) {
|
|
726
|
-
return this.httpClient.post("/admin-api/alias/create/application", request);
|
|
771
|
+
return unwrap(await this.httpClient.post("/admin-api/alias/create/application", request));
|
|
727
772
|
}
|
|
728
773
|
async lookupContextAlias(name) {
|
|
729
|
-
return
|
|
774
|
+
return unwrap(
|
|
775
|
+
await this.httpClient.post(
|
|
776
|
+
`/admin-api/alias/lookup/context/${encodeURIComponent(name)}`,
|
|
777
|
+
{}
|
|
778
|
+
)
|
|
779
|
+
);
|
|
730
780
|
}
|
|
731
781
|
async lookupApplicationAlias(name) {
|
|
732
|
-
return
|
|
782
|
+
return unwrap(
|
|
783
|
+
await this.httpClient.post(
|
|
784
|
+
`/admin-api/alias/lookup/application/${encodeURIComponent(name)}`,
|
|
785
|
+
{}
|
|
786
|
+
)
|
|
787
|
+
);
|
|
733
788
|
}
|
|
734
789
|
async deleteContextAlias(name) {
|
|
735
|
-
return
|
|
790
|
+
return unwrap(
|
|
791
|
+
await this.httpClient.post(
|
|
792
|
+
`/admin-api/alias/delete/context/${encodeURIComponent(name)}`,
|
|
793
|
+
{}
|
|
794
|
+
)
|
|
795
|
+
);
|
|
736
796
|
}
|
|
737
797
|
async deleteApplicationAlias(name) {
|
|
738
|
-
return
|
|
798
|
+
return unwrap(
|
|
799
|
+
await this.httpClient.post(
|
|
800
|
+
`/admin-api/alias/delete/application/${encodeURIComponent(name)}`,
|
|
801
|
+
{}
|
|
802
|
+
)
|
|
803
|
+
);
|
|
739
804
|
}
|
|
740
805
|
async listContextAliases() {
|
|
741
806
|
return unwrap(await this.httpClient.get("/admin-api/alias/list/context"));
|
|
@@ -743,6 +808,215 @@ var AdminApiClient = class {
|
|
|
743
808
|
async listApplicationAliases() {
|
|
744
809
|
return unwrap(await this.httpClient.get("/admin-api/alias/list/application"));
|
|
745
810
|
}
|
|
811
|
+
// ---- Context Identity Aliases ----
|
|
812
|
+
async listContextIdentityAliases(contextId) {
|
|
813
|
+
return unwrap(
|
|
814
|
+
await this.httpClient.get(
|
|
815
|
+
`/admin-api/alias/list/identity/${contextId}`
|
|
816
|
+
)
|
|
817
|
+
);
|
|
818
|
+
}
|
|
819
|
+
async createContextIdentityAlias(contextId, request) {
|
|
820
|
+
return unwrap(
|
|
821
|
+
await this.httpClient.post(
|
|
822
|
+
`/admin-api/alias/create/identity/${contextId}`,
|
|
823
|
+
request
|
|
824
|
+
)
|
|
825
|
+
);
|
|
826
|
+
}
|
|
827
|
+
async lookupContextIdentityAlias(contextId, name) {
|
|
828
|
+
return unwrap(
|
|
829
|
+
await this.httpClient.post(
|
|
830
|
+
`/admin-api/alias/lookup/identity/${contextId}/${encodeURIComponent(name)}`,
|
|
831
|
+
{}
|
|
832
|
+
)
|
|
833
|
+
);
|
|
834
|
+
}
|
|
835
|
+
async deleteContextIdentityAlias(contextId, name) {
|
|
836
|
+
return unwrap(
|
|
837
|
+
await this.httpClient.post(
|
|
838
|
+
`/admin-api/alias/delete/identity/${contextId}/${encodeURIComponent(name)}`,
|
|
839
|
+
{}
|
|
840
|
+
)
|
|
841
|
+
);
|
|
842
|
+
}
|
|
843
|
+
// ---- Namespace Management ----
|
|
844
|
+
async listNamespaces() {
|
|
845
|
+
return unwrap(await this.httpClient.get("/admin-api/namespaces"));
|
|
846
|
+
}
|
|
847
|
+
async getNamespace(namespaceId) {
|
|
848
|
+
return unwrap(await this.httpClient.get(`/admin-api/namespaces/${namespaceId}`));
|
|
849
|
+
}
|
|
850
|
+
async getNamespaceIdentity(namespaceId) {
|
|
851
|
+
return unwrap(await this.httpClient.get(`/admin-api/namespaces/${namespaceId}/identity`));
|
|
852
|
+
}
|
|
853
|
+
async listNamespacesForApplication(applicationId) {
|
|
854
|
+
return unwrap(await this.httpClient.get(`/admin-api/namespaces/for-application/${applicationId}`));
|
|
855
|
+
}
|
|
856
|
+
async createNamespace(request) {
|
|
857
|
+
return unwrap(await this.httpClient.post("/admin-api/namespaces", request));
|
|
858
|
+
}
|
|
859
|
+
async deleteNamespace(namespaceId, request) {
|
|
860
|
+
return unwrap(
|
|
861
|
+
await this.httpClient.request(`/admin-api/namespaces/${namespaceId}`, {
|
|
862
|
+
method: "DELETE",
|
|
863
|
+
body: request ? JSON.stringify(request) : void 0,
|
|
864
|
+
headers: request ? { "Content-Type": "application/json" } : void 0
|
|
865
|
+
})
|
|
866
|
+
);
|
|
867
|
+
}
|
|
868
|
+
async createNamespaceInvitation(namespaceId, request) {
|
|
869
|
+
return unwrap(
|
|
870
|
+
await this.httpClient.post(
|
|
871
|
+
`/admin-api/namespaces/${namespaceId}/invite`,
|
|
872
|
+
request ?? {}
|
|
873
|
+
)
|
|
874
|
+
);
|
|
875
|
+
}
|
|
876
|
+
async joinNamespace(namespaceId, request) {
|
|
877
|
+
return unwrap(
|
|
878
|
+
await this.httpClient.post(
|
|
879
|
+
`/admin-api/namespaces/${namespaceId}/join`,
|
|
880
|
+
request,
|
|
881
|
+
{ timeoutMs: 65e3 }
|
|
882
|
+
)
|
|
883
|
+
);
|
|
884
|
+
}
|
|
885
|
+
async createGroupInNamespace(namespaceId, request) {
|
|
886
|
+
return unwrap(
|
|
887
|
+
await this.httpClient.post(
|
|
888
|
+
`/admin-api/namespaces/${namespaceId}/groups`,
|
|
889
|
+
request ?? {}
|
|
890
|
+
)
|
|
891
|
+
);
|
|
892
|
+
}
|
|
893
|
+
async listNamespaceGroups(namespaceId) {
|
|
894
|
+
return unwrap(await this.httpClient.get(`/admin-api/namespaces/${namespaceId}/groups`));
|
|
895
|
+
}
|
|
896
|
+
// ---- Group Management ----
|
|
897
|
+
async getGroupInfo(groupId) {
|
|
898
|
+
return unwrap(await this.httpClient.get(`/admin-api/groups/${groupId}`));
|
|
899
|
+
}
|
|
900
|
+
async deleteGroup(groupId, request) {
|
|
901
|
+
if (request) {
|
|
902
|
+
return unwrap(
|
|
903
|
+
await this.httpClient.request(`/admin-api/groups/${groupId}`, {
|
|
904
|
+
method: "DELETE",
|
|
905
|
+
body: JSON.stringify(request),
|
|
906
|
+
headers: { "Content-Type": "application/json" }
|
|
907
|
+
})
|
|
908
|
+
);
|
|
909
|
+
}
|
|
910
|
+
return unwrap(await this.httpClient.delete(`/admin-api/groups/${groupId}`));
|
|
911
|
+
}
|
|
912
|
+
async listGroupMembers(groupId) {
|
|
913
|
+
return this.httpClient.get(`/admin-api/groups/${groupId}/members`);
|
|
914
|
+
}
|
|
915
|
+
async listGroupContexts(groupId) {
|
|
916
|
+
return unwrap(await this.httpClient.get(`/admin-api/groups/${groupId}/contexts`));
|
|
917
|
+
}
|
|
918
|
+
async addGroupMembers(groupId, request) {
|
|
919
|
+
await this.httpClient.post(`/admin-api/groups/${groupId}/members`, request);
|
|
920
|
+
}
|
|
921
|
+
async removeGroupMembers(groupId, request) {
|
|
922
|
+
await this.httpClient.post(`/admin-api/groups/${groupId}/members/remove`, request);
|
|
923
|
+
}
|
|
924
|
+
async updateMemberRole(groupId, identity, request) {
|
|
925
|
+
await this.httpClient.put(`/admin-api/groups/${groupId}/members/${identity}/role`, request);
|
|
926
|
+
}
|
|
927
|
+
async getMemberCapabilities(groupId, identity) {
|
|
928
|
+
return unwrap(
|
|
929
|
+
await this.httpClient.get(
|
|
930
|
+
`/admin-api/groups/${groupId}/members/${identity}/capabilities`
|
|
931
|
+
)
|
|
932
|
+
);
|
|
933
|
+
}
|
|
934
|
+
async setMemberCapabilities(groupId, identity, request) {
|
|
935
|
+
await this.httpClient.put(`/admin-api/groups/${groupId}/members/${identity}/capabilities`, request);
|
|
936
|
+
}
|
|
937
|
+
async setDefaultCapabilities(groupId, request) {
|
|
938
|
+
await this.httpClient.put(`/admin-api/groups/${groupId}/settings/default-capabilities`, request);
|
|
939
|
+
}
|
|
940
|
+
async setDefaultVisibility(groupId, request) {
|
|
941
|
+
await this.httpClient.put(`/admin-api/groups/${groupId}/settings/default-visibility`, request);
|
|
942
|
+
}
|
|
943
|
+
async setTeeAdmissionPolicy(groupId, request) {
|
|
944
|
+
await this.httpClient.put(`/admin-api/groups/${groupId}/settings/tee-admission-policy`, request);
|
|
945
|
+
}
|
|
946
|
+
async updateGroupSettings(groupId, request) {
|
|
947
|
+
await this.httpClient.patch(`/admin-api/groups/${groupId}`, request);
|
|
948
|
+
}
|
|
949
|
+
async setGroupAlias(groupId, request) {
|
|
950
|
+
await this.httpClient.put(`/admin-api/groups/${groupId}/alias`, request);
|
|
951
|
+
}
|
|
952
|
+
async setMemberAlias(groupId, identity, request) {
|
|
953
|
+
await this.httpClient.put(`/admin-api/groups/${groupId}/members/${identity}/alias`, request);
|
|
954
|
+
}
|
|
955
|
+
async syncGroup(groupId, request) {
|
|
956
|
+
return unwrap(await this.httpClient.post(`/admin-api/groups/${groupId}/sync`, request ?? {}));
|
|
957
|
+
}
|
|
958
|
+
async registerGroupSigningKey(groupId, request) {
|
|
959
|
+
return unwrap(
|
|
960
|
+
await this.httpClient.post(
|
|
961
|
+
`/admin-api/groups/${groupId}/signing-key`,
|
|
962
|
+
request
|
|
963
|
+
)
|
|
964
|
+
);
|
|
965
|
+
}
|
|
966
|
+
async upgradeGroup(groupId, request) {
|
|
967
|
+
return unwrap(await this.httpClient.post(`/admin-api/groups/${groupId}/upgrade`, request));
|
|
968
|
+
}
|
|
969
|
+
async getGroupUpgradeStatus(groupId) {
|
|
970
|
+
return unwrap(
|
|
971
|
+
await this.httpClient.get(`/admin-api/groups/${groupId}/upgrade/status`)
|
|
972
|
+
);
|
|
973
|
+
}
|
|
974
|
+
async retryGroupUpgrade(groupId, request) {
|
|
975
|
+
return unwrap(
|
|
976
|
+
await this.httpClient.post(
|
|
977
|
+
`/admin-api/groups/${groupId}/upgrade/retry`,
|
|
978
|
+
request ?? {}
|
|
979
|
+
)
|
|
980
|
+
);
|
|
981
|
+
}
|
|
982
|
+
async nestGroup(parentGroupId, request) {
|
|
983
|
+
await this.httpClient.post(`/admin-api/groups/${parentGroupId}/nest`, request);
|
|
984
|
+
}
|
|
985
|
+
async unnestGroup(parentGroupId, request) {
|
|
986
|
+
await this.httpClient.post(`/admin-api/groups/${parentGroupId}/unnest`, request);
|
|
987
|
+
}
|
|
988
|
+
async listSubgroups(groupId) {
|
|
989
|
+
return unwrap(await this.httpClient.get(`/admin-api/groups/${groupId}/subgroups`));
|
|
990
|
+
}
|
|
991
|
+
async detachContextFromGroup(groupId, contextId, request) {
|
|
992
|
+
await this.httpClient.post(`/admin-api/groups/${groupId}/contexts/${contextId}/remove`, request ?? {});
|
|
993
|
+
}
|
|
994
|
+
// ---- Group Invitation & Join ----
|
|
995
|
+
async createGroupInvitation(groupId, request) {
|
|
996
|
+
return unwrap(
|
|
997
|
+
await this.httpClient.post(
|
|
998
|
+
`/admin-api/groups/${groupId}/invite`,
|
|
999
|
+
request ?? {}
|
|
1000
|
+
)
|
|
1001
|
+
);
|
|
1002
|
+
}
|
|
1003
|
+
async joinGroup(request) {
|
|
1004
|
+
return unwrap(
|
|
1005
|
+
await this.httpClient.post("/admin-api/groups/join", request)
|
|
1006
|
+
);
|
|
1007
|
+
}
|
|
1008
|
+
// ---- TEE ----
|
|
1009
|
+
async getTeeInfo() {
|
|
1010
|
+
return unwrap(await this.httpClient.get("/admin-api/tee/info"));
|
|
1011
|
+
}
|
|
1012
|
+
async teeAttest(request) {
|
|
1013
|
+
return unwrap(await this.httpClient.post("/admin-api/tee/attest", request));
|
|
1014
|
+
}
|
|
1015
|
+
async teeVerifyQuote(request) {
|
|
1016
|
+
return unwrap(
|
|
1017
|
+
await this.httpClient.post("/admin-api/tee/verify-quote", request)
|
|
1018
|
+
);
|
|
1019
|
+
}
|
|
746
1020
|
// ---- Network ----
|
|
747
1021
|
async getPeersCount() {
|
|
748
1022
|
return this.httpClient.get("/admin-api/peers");
|
|
@@ -866,8 +1140,7 @@ var RpcClient = class {
|
|
|
866
1140
|
params: {
|
|
867
1141
|
contextId: params.contextId,
|
|
868
1142
|
method: params.method,
|
|
869
|
-
argsJson: params.argsJson ?? {}
|
|
870
|
-
executorPublicKey: params.executorPublicKey
|
|
1143
|
+
argsJson: params.argsJson ?? {}
|
|
871
1144
|
}
|
|
872
1145
|
};
|
|
873
1146
|
const response = await this.httpClient.post(
|
|
@@ -1580,9 +1853,37 @@ var LocalStorageTokenStore = class {
|
|
|
1580
1853
|
}
|
|
1581
1854
|
}
|
|
1582
1855
|
};
|
|
1856
|
+
|
|
1857
|
+
// src/cloud/cloud-client.ts
|
|
1858
|
+
var CloudClient = class {
|
|
1859
|
+
constructor(config = {}) {
|
|
1860
|
+
this.baseUrl = (config.cloudBaseUrl || "https://cloud.calimero.network").replace(/\/+$/, "");
|
|
1861
|
+
}
|
|
1862
|
+
enableHA(options) {
|
|
1863
|
+
const params = new URLSearchParams({
|
|
1864
|
+
group_id: options.groupId,
|
|
1865
|
+
context_id: options.contextId
|
|
1866
|
+
});
|
|
1867
|
+
if (options.redirectUrl) {
|
|
1868
|
+
params.set("redirect_url", options.redirectUrl);
|
|
1869
|
+
}
|
|
1870
|
+
window.open(`${this.baseUrl}/enable-ha?${params.toString()}`);
|
|
1871
|
+
}
|
|
1872
|
+
disableHA(options) {
|
|
1873
|
+
const params = new URLSearchParams({
|
|
1874
|
+
group_id: options.groupId,
|
|
1875
|
+
context_id: options.contextId
|
|
1876
|
+
});
|
|
1877
|
+
if (options.redirectUrl) {
|
|
1878
|
+
params.set("redirect_url", options.redirectUrl);
|
|
1879
|
+
}
|
|
1880
|
+
window.open(`${this.baseUrl}/disable-ha?${params.toString()}`);
|
|
1881
|
+
}
|
|
1882
|
+
};
|
|
1583
1883
|
export {
|
|
1584
1884
|
AdminApiClient,
|
|
1585
1885
|
AuthApiClient,
|
|
1886
|
+
CloudClient,
|
|
1586
1887
|
HTTPError,
|
|
1587
1888
|
LocalStorageTokenStore,
|
|
1588
1889
|
MemoryTokenStore,
|