@calimero-network/mero-js 6.0.3 → 6.0.4

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
@@ -899,10 +899,11 @@ var AdminApiClient = class {
899
899
  * context as stranded.
900
900
  */
901
901
  async resyncContext(contextId, request = {}) {
902
- return this.httpClient.post(
902
+ const r = await this.httpClient.post(
903
903
  `/admin-api/contexts/${contextId}/resync`,
904
904
  request
905
905
  );
906
+ return r ?? { contextId, resyncStarted: true };
906
907
  }
907
908
  async inviteSpecializedNode(request) {
908
909
  return unwrap(
@@ -950,13 +951,15 @@ var AdminApiClient = class {
950
951
  );
951
952
  return { blobs: res.blobs.map((b) => ({ blobId: b.blob_id, size: b.size })) };
952
953
  }
954
+ /**
955
+ * Download a blob's raw bytes. `GET /admin-api/blobs/:id` streams the blob
956
+ * content (e.g. `application/gzip`), NOT JSON — so fetch it as an ArrayBuffer.
957
+ * Use {@link listBlobs} for `{ blobId, size }` metadata.
958
+ */
953
959
  async getBlob(blobId) {
954
- const res = unwrap(
955
- await this.httpClient.get(
956
- `/admin-api/blobs/${blobId}`
957
- )
958
- );
959
- return { blobId: res.blob_id, size: res.size };
960
+ return this.httpClient.get(`/admin-api/blobs/${blobId}`, {
961
+ parse: "arrayBuffer"
962
+ });
960
963
  }
961
964
  // ---- Alias Management ----
962
965
  async createContextAlias(request) {
@@ -1819,6 +1822,9 @@ var _WsClient = class _WsClient {
1819
1822
  }
1820
1823
  this.emit("event", {
1821
1824
  contextId: msg.result.contextId,
1825
+ // Forward the event tag (sibling of `data` in core's flattened
1826
+ // payload) so consumers can discriminate, matching `SseClient`.
1827
+ type: msg.result.type,
1822
1828
  data: eventData
1823
1829
  });
1824
1830
  }