@calimero-network/mero-js 6.0.4 → 6.1.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/README.md +37 -1
- package/dist/admin-api/admin-client.d.ts +8 -1
- package/dist/admin-api/admin-client.d.ts.map +1 -1
- package/dist/admin-api/admin-client.js +24 -0
- package/dist/admin-api/admin-client.js.map +1 -1
- package/dist/admin-api/admin-types.d.ts +13 -0
- package/dist/admin-api/admin-types.d.ts.map +1 -1
- package/dist/index.browser.mjs +2 -2
- package/dist/index.browser.mjs.map +3 -3
- package/dist/index.cjs +19 -0
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +19 -0
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
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
|
}
|