@calimero-network/mero-js 2.5.0 → 3.0.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
@@ -734,6 +734,16 @@ var AdminApiClient = class {
734
734
  async getApplication(appId) {
735
735
  return unwrap(await this.httpClient.get(`/admin-api/applications/${appId}`));
736
736
  }
737
+ /**
738
+ * Installed-blob inventory for an application — one entry per locally installed
739
+ * version. This is the *installed* inventory (source for a "pick a version to
740
+ * pin" UI); the registry equivalent is `listPackageVersions`.
741
+ */
742
+ async listApplicationVersions(applicationId) {
743
+ return unwrap(
744
+ await this.httpClient.get(`/admin-api/applications/${applicationId}/versions`)
745
+ );
746
+ }
737
747
  // ---- Package Management ----
738
748
  async listPackages() {
739
749
  return unwrap(await this.httpClient.get("/admin-api/packages"));
@@ -801,6 +811,19 @@ var AdminApiClient = class {
801
811
  async syncContext(contextId) {
802
812
  await this.httpClient.post(`/admin-api/contexts/sync/${contextId ?? ""}`, {});
803
813
  }
814
+ /**
815
+ * Kick off a full state re-pull for a context (operator recovery for a
816
+ * stranded context). `force` re-pulls even when the node does not flag the
817
+ * context as stranded.
818
+ */
819
+ async resyncContext(contextId, request = {}) {
820
+ return unwrap(
821
+ await this.httpClient.post(
822
+ `/admin-api/contexts/${contextId}/resync`,
823
+ request
824
+ )
825
+ );
826
+ }
804
827
  async inviteSpecializedNode(request) {
805
828
  return unwrap(
806
829
  await this.httpClient.post(
@@ -1037,23 +1060,28 @@ var AdminApiClient = class {
1037
1060
  await this.httpClient.put(`/admin-api/groups/${groupId}/metadata`, request);
1038
1061
  }
1039
1062
  async getGroupMetadata(groupId) {
1040
- return unwrap(await this.httpClient.get(`/admin-api/groups/${groupId}/metadata`))?.data ?? null;
1063
+ const response = await this.httpClient.get(
1064
+ `/admin-api/groups/${groupId}/metadata`
1065
+ );
1066
+ return response?.data?.data ?? null;
1041
1067
  }
1042
1068
  async setMemberMetadata(groupId, identity, request) {
1043
1069
  await this.httpClient.put(`/admin-api/groups/${groupId}/members/${identity}/metadata`, request);
1044
1070
  }
1045
1071
  async getMemberMetadata(groupId, identity) {
1046
- return unwrap(
1047
- await this.httpClient.get(`/admin-api/groups/${groupId}/members/${identity}/metadata`)
1048
- )?.data ?? null;
1072
+ const response = await this.httpClient.get(
1073
+ `/admin-api/groups/${groupId}/members/${identity}/metadata`
1074
+ );
1075
+ return response?.data?.data ?? null;
1049
1076
  }
1050
1077
  async setContextMetadata(groupId, contextId, request) {
1051
1078
  await this.httpClient.put(`/admin-api/groups/${groupId}/contexts/${contextId}/metadata`, request);
1052
1079
  }
1053
1080
  async getContextMetadata(groupId, contextId) {
1054
- return unwrap(
1055
- await this.httpClient.get(`/admin-api/groups/${groupId}/contexts/${contextId}/metadata`)
1056
- )?.data ?? null;
1081
+ const response = await this.httpClient.get(
1082
+ `/admin-api/groups/${groupId}/contexts/${contextId}/metadata`
1083
+ );
1084
+ return response?.data?.data ?? null;
1057
1085
  }
1058
1086
  async syncGroup(groupId, request) {
1059
1087
  return unwrap(await this.httpClient.post(`/admin-api/groups/${groupId}/sync`, request ?? {}));