@calimero-network/mero-js 1.3.0 → 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/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 Invite / Join ----
701
- async inviteToContext(request) {
702
- return unwrap(await this.httpClient.post("/admin-api/contexts/invite", request));
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 joinContext(request) {
705
- return unwrap(await this.httpClient.post("/admin-api/contexts/join", request));
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 this.httpClient.post(`/admin-api/alias/lookup/context/${encodeURIComponent(name)}`, {});
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 this.httpClient.post(`/admin-api/alias/lookup/application/${encodeURIComponent(name)}`, {});
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 this.httpClient.post(`/admin-api/alias/delete/context/${encodeURIComponent(name)}`, {});
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 this.httpClient.post(`/admin-api/alias/delete/application/${encodeURIComponent(name)}`, {});
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(