@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.mjs CHANGED
@@ -839,10 +839,11 @@ var AdminApiClient = class {
839
839
  * context as stranded.
840
840
  */
841
841
  async resyncContext(contextId, request = {}) {
842
- return this.httpClient.post(
842
+ const r = await this.httpClient.post(
843
843
  `/admin-api/contexts/${contextId}/resync`,
844
844
  request
845
845
  );
846
+ return r ?? { contextId, resyncStarted: true };
846
847
  }
847
848
  async inviteSpecializedNode(request) {
848
849
  return unwrap(
@@ -890,13 +891,15 @@ var AdminApiClient = class {
890
891
  );
891
892
  return { blobs: res.blobs.map((b) => ({ blobId: b.blob_id, size: b.size })) };
892
893
  }
894
+ /**
895
+ * Download a blob's raw bytes. `GET /admin-api/blobs/:id` streams the blob
896
+ * content (e.g. `application/gzip`), NOT JSON — so fetch it as an ArrayBuffer.
897
+ * Use {@link listBlobs} for `{ blobId, size }` metadata.
898
+ */
893
899
  async getBlob(blobId) {
894
- const res = unwrap(
895
- await this.httpClient.get(
896
- `/admin-api/blobs/${blobId}`
897
- )
898
- );
899
- return { blobId: res.blob_id, size: res.size };
900
+ return this.httpClient.get(`/admin-api/blobs/${blobId}`, {
901
+ parse: "arrayBuffer"
902
+ });
900
903
  }
901
904
  // ---- Alias Management ----
902
905
  async createContextAlias(request) {
@@ -1759,6 +1762,9 @@ var _WsClient = class _WsClient {
1759
1762
  }
1760
1763
  this.emit("event", {
1761
1764
  contextId: msg.result.contextId,
1765
+ // Forward the event tag (sibling of `data` in core's flattened
1766
+ // payload) so consumers can discriminate, matching `SseClient`.
1767
+ type: msg.result.type,
1762
1768
  data: eventData
1763
1769
  });
1764
1770
  }