@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.cjs CHANGED
@@ -794,6 +794,16 @@ var AdminApiClient = class {
794
794
  async getApplication(appId) {
795
795
  return unwrap(await this.httpClient.get(`/admin-api/applications/${appId}`));
796
796
  }
797
+ /**
798
+ * Installed-blob inventory for an application — one entry per locally installed
799
+ * version. This is the *installed* inventory (source for a "pick a version to
800
+ * pin" UI); the registry equivalent is `listPackageVersions`.
801
+ */
802
+ async listApplicationVersions(applicationId) {
803
+ return unwrap(
804
+ await this.httpClient.get(`/admin-api/applications/${applicationId}/versions`)
805
+ );
806
+ }
797
807
  // ---- Package Management ----
798
808
  async listPackages() {
799
809
  return unwrap(await this.httpClient.get("/admin-api/packages"));
@@ -861,6 +871,19 @@ var AdminApiClient = class {
861
871
  async syncContext(contextId) {
862
872
  await this.httpClient.post(`/admin-api/contexts/sync/${contextId ?? ""}`, {});
863
873
  }
874
+ /**
875
+ * Kick off a full state re-pull for a context (operator recovery for a
876
+ * stranded context). `force` re-pulls even when the node does not flag the
877
+ * context as stranded.
878
+ */
879
+ async resyncContext(contextId, request = {}) {
880
+ return unwrap(
881
+ await this.httpClient.post(
882
+ `/admin-api/contexts/${contextId}/resync`,
883
+ request
884
+ )
885
+ );
886
+ }
864
887
  async inviteSpecializedNode(request) {
865
888
  return unwrap(
866
889
  await this.httpClient.post(
@@ -1097,23 +1120,28 @@ var AdminApiClient = class {
1097
1120
  await this.httpClient.put(`/admin-api/groups/${groupId}/metadata`, request);
1098
1121
  }
1099
1122
  async getGroupMetadata(groupId) {
1100
- return unwrap(await this.httpClient.get(`/admin-api/groups/${groupId}/metadata`))?.data ?? null;
1123
+ const response = await this.httpClient.get(
1124
+ `/admin-api/groups/${groupId}/metadata`
1125
+ );
1126
+ return response?.data?.data ?? null;
1101
1127
  }
1102
1128
  async setMemberMetadata(groupId, identity, request) {
1103
1129
  await this.httpClient.put(`/admin-api/groups/${groupId}/members/${identity}/metadata`, request);
1104
1130
  }
1105
1131
  async getMemberMetadata(groupId, identity) {
1106
- return unwrap(
1107
- await this.httpClient.get(`/admin-api/groups/${groupId}/members/${identity}/metadata`)
1108
- )?.data ?? null;
1132
+ const response = await this.httpClient.get(
1133
+ `/admin-api/groups/${groupId}/members/${identity}/metadata`
1134
+ );
1135
+ return response?.data?.data ?? null;
1109
1136
  }
1110
1137
  async setContextMetadata(groupId, contextId, request) {
1111
1138
  await this.httpClient.put(`/admin-api/groups/${groupId}/contexts/${contextId}/metadata`, request);
1112
1139
  }
1113
1140
  async getContextMetadata(groupId, contextId) {
1114
- return unwrap(
1115
- await this.httpClient.get(`/admin-api/groups/${groupId}/contexts/${contextId}/metadata`)
1116
- )?.data ?? null;
1141
+ const response = await this.httpClient.get(
1142
+ `/admin-api/groups/${groupId}/contexts/${contextId}/metadata`
1143
+ );
1144
+ return response?.data?.data ?? null;
1117
1145
  }
1118
1146
  async syncGroup(groupId, request) {
1119
1147
  return unwrap(await this.httpClient.post(`/admin-api/groups/${groupId}/sync`, request ?? {}));