@calimero-network/mero-js 2.2.1 → 2.3.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
@@ -1064,6 +1064,22 @@ var AdminApiClient = class {
1064
1064
  await this.httpClient.get(`/admin-api/groups/${groupId}/upgrade/status`)
1065
1065
  );
1066
1066
  }
1067
+ /**
1068
+ * The operator-facing "have all peers migrated?" rollup for a namespace.
1069
+ * The handler serializes the payload directly, so there is no `{ data }`
1070
+ * envelope to unwrap here (unlike most admin reads).
1071
+ */
1072
+ async getMigrationStatus(namespaceId) {
1073
+ const id = encodeURIComponent(namespaceId);
1074
+ return this.httpClient.get(`/admin-api/groups/${id}/migration-status`);
1075
+ }
1076
+ /** Per-group cascade-migration snapshots for a namespace. */
1077
+ async getCascadeStatus(namespaceId) {
1078
+ const id = encodeURIComponent(namespaceId);
1079
+ return unwrap(
1080
+ await this.httpClient.get(`/admin-api/groups/${id}/cascade-status`)
1081
+ );
1082
+ }
1067
1083
  async retryGroupUpgrade(groupId, request) {
1068
1084
  return unwrap(
1069
1085
  await this.httpClient.post(
@@ -1262,6 +1278,19 @@ var RpcClient = class {
1262
1278
  }
1263
1279
  return response.result;
1264
1280
  }
1281
+ /**
1282
+ * One-tap owner-driven convert: re-signs the caller's identity-gated entries
1283
+ * to the current schema. The export converts all of the caller's
1284
+ * below-target entries in a single sweep, so this issues one call and returns
1285
+ * the resulting summary — it does not loop.
1286
+ */
1287
+ async migrateMyEntries(contextId) {
1288
+ return this.execute({ contextId, method: "migrate_my_entries" });
1289
+ }
1290
+ /** Read-only count of the caller's entries still below the target schema. */
1291
+ async countMyPending(contextId) {
1292
+ return this.execute({ contextId, method: "count_my_pending" });
1293
+ }
1265
1294
  };
1266
1295
 
1267
1296
  // src/events/sse.ts
@@ -1292,6 +1321,20 @@ var SseClient = class {
1292
1321
  if (idx !== -1) arr.splice(idx, 1);
1293
1322
  }
1294
1323
  }
1324
+ /**
1325
+ * Typed convenience over the generic `'event'` stream: invokes `handler` only
1326
+ * for `AppVersionChanged` context events, with the payload already parsed.
1327
+ * Returns an unsubscribe closure (so callers need not retain the listener).
1328
+ */
1329
+ onAppVersionChanged(handler) {
1330
+ const listener = (ev) => {
1331
+ const d = ev.data;
1332
+ if (d?.type !== "AppVersionChanged") return;
1333
+ handler({ contextId: ev.contextId, fromVersion: d.data?.fromVersion, toVersion: d.data?.toVersion });
1334
+ };
1335
+ this.on("event", listener);
1336
+ return () => this.off("event", listener);
1337
+ }
1295
1338
  emit(event, arg) {
1296
1339
  const key = event;
1297
1340
  if (key in this.listeners) {