@calimero-network/mero-js 6.0.4 → 7.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
@@ -961,6 +961,21 @@ var AdminApiClient = class {
961
961
  parse: "arrayBuffer"
962
962
  });
963
963
  }
964
+ /**
965
+ * Fetch a blob's metadata without downloading it. `HEAD /admin-api/blobs/:id`
966
+ * returns the info in response headers (size via `content-length`, plus
967
+ * `x-blob-id`/`x-blob-hash`/`x-blob-mime-type`).
968
+ */
969
+ async getBlobInfo(blobId) {
970
+ const { headers } = await this.httpClient.head(`/admin-api/blobs/${blobId}`);
971
+ const size = Number(headers["content-length"]);
972
+ return {
973
+ blobId: headers["x-blob-id"] ?? blobId,
974
+ size: Number.isFinite(size) ? size : 0,
975
+ hash: headers["x-blob-hash"],
976
+ mimeType: headers["x-blob-mime-type"]
977
+ };
978
+ }
964
979
  // ---- Alias Management ----
965
980
  async createContextAlias(request) {
966
981
  return unwrap(
@@ -1168,6 +1183,10 @@ var AdminApiClient = class {
1168
1183
  async setTeeAdmissionPolicy(groupId, request) {
1169
1184
  await this.httpClient.put(`/admin-api/groups/${groupId}/settings/tee-admission-policy`, request);
1170
1185
  }
1186
+ async getTeeAdmissionPolicy(groupId) {
1187
+ const response = await this.httpClient.get(`/admin-api/groups/${groupId}/settings/tee-admission-policy`);
1188
+ return response.data ?? response;
1189
+ }
1171
1190
  async updateGroupSettings(groupId, request) {
1172
1191
  await this.httpClient.patch(`/admin-api/groups/${groupId}`, request);
1173
1192
  }
@@ -1179,7 +1198,7 @@ var AdminApiClient = class {
1179
1198
  const response = await this.httpClient.get(
1180
1199
  `/admin-api/groups/${groupId}/metadata`
1181
1200
  );
1182
- return response?.data?.data ?? null;
1201
+ return response?.data ?? null;
1183
1202
  }
1184
1203
  async setMemberMetadata(groupId, identity, request) {
1185
1204
  await this.httpClient.put(`/admin-api/groups/${groupId}/members/${identity}/metadata`, request);
@@ -1188,7 +1207,7 @@ var AdminApiClient = class {
1188
1207
  const response = await this.httpClient.get(
1189
1208
  `/admin-api/groups/${groupId}/members/${identity}/metadata`
1190
1209
  );
1191
- return response?.data?.data ?? null;
1210
+ return response?.data ?? null;
1192
1211
  }
1193
1212
  async setContextMetadata(groupId, contextId, request) {
1194
1213
  await this.httpClient.put(`/admin-api/groups/${groupId}/contexts/${contextId}/metadata`, request);
@@ -1197,7 +1216,7 @@ var AdminApiClient = class {
1197
1216
  const response = await this.httpClient.get(
1198
1217
  `/admin-api/groups/${groupId}/contexts/${contextId}/metadata`
1199
1218
  );
1200
- return response?.data?.data ?? null;
1219
+ return response?.data ?? null;
1201
1220
  }
1202
1221
  async syncGroup(groupId, request) {
1203
1222
  return unwrap(await this.httpClient.post(`/admin-api/groups/${groupId}/sync`, request ?? {}));