@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.mjs CHANGED
@@ -901,6 +901,21 @@ var AdminApiClient = class {
901
901
  parse: "arrayBuffer"
902
902
  });
903
903
  }
904
+ /**
905
+ * Fetch a blob's metadata without downloading it. `HEAD /admin-api/blobs/:id`
906
+ * returns the info in response headers (size via `content-length`, plus
907
+ * `x-blob-id`/`x-blob-hash`/`x-blob-mime-type`).
908
+ */
909
+ async getBlobInfo(blobId) {
910
+ const { headers } = await this.httpClient.head(`/admin-api/blobs/${blobId}`);
911
+ const size = Number(headers["content-length"]);
912
+ return {
913
+ blobId: headers["x-blob-id"] ?? blobId,
914
+ size: Number.isFinite(size) ? size : 0,
915
+ hash: headers["x-blob-hash"],
916
+ mimeType: headers["x-blob-mime-type"]
917
+ };
918
+ }
904
919
  // ---- Alias Management ----
905
920
  async createContextAlias(request) {
906
921
  return unwrap(
@@ -1108,6 +1123,10 @@ var AdminApiClient = class {
1108
1123
  async setTeeAdmissionPolicy(groupId, request) {
1109
1124
  await this.httpClient.put(`/admin-api/groups/${groupId}/settings/tee-admission-policy`, request);
1110
1125
  }
1126
+ async getTeeAdmissionPolicy(groupId) {
1127
+ const response = await this.httpClient.get(`/admin-api/groups/${groupId}/settings/tee-admission-policy`);
1128
+ return response.data ?? response;
1129
+ }
1111
1130
  async updateGroupSettings(groupId, request) {
1112
1131
  await this.httpClient.patch(`/admin-api/groups/${groupId}`, request);
1113
1132
  }
@@ -1119,7 +1138,7 @@ var AdminApiClient = class {
1119
1138
  const response = await this.httpClient.get(
1120
1139
  `/admin-api/groups/${groupId}/metadata`
1121
1140
  );
1122
- return response?.data?.data ?? null;
1141
+ return response?.data ?? null;
1123
1142
  }
1124
1143
  async setMemberMetadata(groupId, identity, request) {
1125
1144
  await this.httpClient.put(`/admin-api/groups/${groupId}/members/${identity}/metadata`, request);
@@ -1128,7 +1147,7 @@ var AdminApiClient = class {
1128
1147
  const response = await this.httpClient.get(
1129
1148
  `/admin-api/groups/${groupId}/members/${identity}/metadata`
1130
1149
  );
1131
- return response?.data?.data ?? null;
1150
+ return response?.data ?? null;
1132
1151
  }
1133
1152
  async setContextMetadata(groupId, contextId, request) {
1134
1153
  await this.httpClient.put(`/admin-api/groups/${groupId}/contexts/${contextId}/metadata`, request);
@@ -1137,7 +1156,7 @@ var AdminApiClient = class {
1137
1156
  const response = await this.httpClient.get(
1138
1157
  `/admin-api/groups/${groupId}/contexts/${contextId}/metadata`
1139
1158
  );
1140
- return response?.data?.data ?? null;
1159
+ return response?.data ?? null;
1141
1160
  }
1142
1161
  async syncGroup(groupId, request) {
1143
1162
  return unwrap(await this.httpClient.post(`/admin-api/groups/${groupId}/sync`, request ?? {}));