@calimero-network/mero-js 2.2.0 → 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/admin-api/admin-client.d.ts +9 -1
- package/dist/admin-api/admin-client.d.ts.map +1 -1
- package/dist/admin-api/admin-client.js +16 -1
- package/dist/admin-api/admin-client.js.map +1 -1
- package/dist/admin-api/admin-types.d.ts +39 -0
- package/dist/admin-api/admin-types.d.ts.map +1 -1
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/sse.d.ts +12 -0
- package/dist/events/sse.d.ts.map +1 -1
- package/dist/events/sse.js +15 -0
- package/dist/events/sse.js.map +1 -1
- package/dist/index.browser.mjs +2 -2
- package/dist/index.browser.mjs.map +3 -3
- package/dist/index.cjs +47 -1
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -1
- package/dist/index.mjs.map +2 -2
- package/dist/rpc/index.d.ts +14 -0
- package/dist/rpc/index.d.ts.map +1 -1
- package/dist/rpc/index.js +13 -0
- package/dist/rpc/index.js.map +1 -1
- package/package.json +1 -1
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(
|
|
@@ -1079,7 +1095,10 @@ var AdminApiClient = class {
|
|
|
1079
1095
|
await this.httpClient.post(`/admin-api/groups/${parentGroupId}/unnest`, request);
|
|
1080
1096
|
}
|
|
1081
1097
|
async listSubgroups(groupId) {
|
|
1082
|
-
|
|
1098
|
+
const response = await this.httpClient.get(
|
|
1099
|
+
`/admin-api/groups/${groupId}/subgroups`
|
|
1100
|
+
);
|
|
1101
|
+
return response.subgroups ?? response.data ?? [];
|
|
1083
1102
|
}
|
|
1084
1103
|
async detachContextFromGroup(groupId, contextId, request) {
|
|
1085
1104
|
await this.httpClient.post(`/admin-api/groups/${groupId}/contexts/${contextId}/remove`, request ?? {});
|
|
@@ -1259,6 +1278,19 @@ var RpcClient = class {
|
|
|
1259
1278
|
}
|
|
1260
1279
|
return response.result;
|
|
1261
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
|
+
}
|
|
1262
1294
|
};
|
|
1263
1295
|
|
|
1264
1296
|
// src/events/sse.ts
|
|
@@ -1289,6 +1321,20 @@ var SseClient = class {
|
|
|
1289
1321
|
if (idx !== -1) arr.splice(idx, 1);
|
|
1290
1322
|
}
|
|
1291
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
|
+
}
|
|
1292
1338
|
emit(event, arg) {
|
|
1293
1339
|
const key = event;
|
|
1294
1340
|
if (key in this.listeners) {
|