@calimero-network/mero-js 18.1.0 → 18.2.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 +15 -17
- package/dist/admin-api/admin-client.js +27 -57
- package/dist/admin-api/admin-types.d.ts +43 -34
- package/dist/index.browser.mjs +2 -2
- package/dist/index.browser.mjs.map +2 -2
- package/dist/index.cjs +26 -41
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +26 -41
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -851,16 +851,7 @@ var AdminApiClient = class {
|
|
|
851
851
|
const body = { ...request, initializationParams: request.initializationParams ?? [] };
|
|
852
852
|
return unwrap(await this.httpClient.post("/admin-api/contexts", body));
|
|
853
853
|
}
|
|
854
|
-
async deleteContext(contextId
|
|
855
|
-
if (request) {
|
|
856
|
-
return unwrap(
|
|
857
|
-
await this.httpClient.request(`/admin-api/contexts/${contextId}`, {
|
|
858
|
-
method: "DELETE",
|
|
859
|
-
body: JSON.stringify(request),
|
|
860
|
-
headers: { "Content-Type": "application/json" }
|
|
861
|
-
})
|
|
862
|
-
);
|
|
863
|
-
}
|
|
854
|
+
async deleteContext(contextId) {
|
|
864
855
|
return unwrap(await this.httpClient.delete(`/admin-api/contexts/${contextId}`));
|
|
865
856
|
}
|
|
866
857
|
async getContexts() {
|
|
@@ -1116,17 +1107,14 @@ var AdminApiClient = class {
|
|
|
1116
1107
|
}
|
|
1117
1108
|
async createNamespace(request) {
|
|
1118
1109
|
return unwrap(
|
|
1119
|
-
await this.httpClient.post("/admin-api/namespaces",
|
|
1120
|
-
upgradePolicy: "LazyOnAccess",
|
|
1121
|
-
...request
|
|
1122
|
-
})
|
|
1110
|
+
await this.httpClient.post("/admin-api/namespaces", request)
|
|
1123
1111
|
);
|
|
1124
1112
|
}
|
|
1125
|
-
async deleteNamespace(namespaceId
|
|
1113
|
+
async deleteNamespace(namespaceId) {
|
|
1126
1114
|
return unwrap(
|
|
1127
1115
|
await this.httpClient.request(`/admin-api/namespaces/${namespaceId}`, {
|
|
1128
1116
|
method: "DELETE",
|
|
1129
|
-
body:
|
|
1117
|
+
body: "{}",
|
|
1130
1118
|
headers: { "Content-Type": "application/json" }
|
|
1131
1119
|
})
|
|
1132
1120
|
);
|
|
@@ -1323,11 +1311,11 @@ var AdminApiClient = class {
|
|
|
1323
1311
|
async getSubgroupVisibility(groupId) {
|
|
1324
1312
|
return (await this.getGroupInfo(groupId)).subgroupVisibility;
|
|
1325
1313
|
}
|
|
1326
|
-
async deleteGroup(groupId
|
|
1314
|
+
async deleteGroup(groupId) {
|
|
1327
1315
|
return unwrap(
|
|
1328
1316
|
await this.httpClient.request(`/admin-api/groups/${groupId}`, {
|
|
1329
1317
|
method: "DELETE",
|
|
1330
|
-
body:
|
|
1318
|
+
body: "{}",
|
|
1331
1319
|
headers: { "Content-Type": "application/json" }
|
|
1332
1320
|
})
|
|
1333
1321
|
);
|
|
@@ -1427,8 +1415,8 @@ var AdminApiClient = class {
|
|
|
1427
1415
|
);
|
|
1428
1416
|
return response?.data ?? null;
|
|
1429
1417
|
}
|
|
1430
|
-
async syncGroup(groupId
|
|
1431
|
-
return unwrap(await this.httpClient.post(`/admin-api/groups/${groupId}/sync`,
|
|
1418
|
+
async syncGroup(groupId) {
|
|
1419
|
+
return unwrap(await this.httpClient.post(`/admin-api/groups/${groupId}/sync`, {}));
|
|
1432
1420
|
}
|
|
1433
1421
|
async upgradeGroup(groupId, request) {
|
|
1434
1422
|
return unwrap(await this.httpClient.post(`/admin-api/groups/${groupId}/upgrade`, request));
|
|
@@ -1454,11 +1442,11 @@ var AdminApiClient = class {
|
|
|
1454
1442
|
await this.httpClient.get(`/admin-api/groups/${id}/cascade-status`)
|
|
1455
1443
|
);
|
|
1456
1444
|
}
|
|
1457
|
-
async retryGroupUpgrade(groupId
|
|
1445
|
+
async retryGroupUpgrade(groupId) {
|
|
1458
1446
|
return unwrap(
|
|
1459
1447
|
await this.httpClient.post(
|
|
1460
1448
|
`/admin-api/groups/${groupId}/upgrade/retry`,
|
|
1461
|
-
|
|
1449
|
+
{}
|
|
1462
1450
|
)
|
|
1463
1451
|
);
|
|
1464
1452
|
}
|
|
@@ -1473,8 +1461,8 @@ var AdminApiClient = class {
|
|
|
1473
1461
|
);
|
|
1474
1462
|
return response.subgroups ?? response.data ?? [];
|
|
1475
1463
|
}
|
|
1476
|
-
async detachContextFromGroup(groupId, contextId
|
|
1477
|
-
await this.httpClient.post(`/admin-api/groups/${groupId}/contexts/${contextId}/remove`,
|
|
1464
|
+
async detachContextFromGroup(groupId, contextId) {
|
|
1465
|
+
await this.httpClient.post(`/admin-api/groups/${groupId}/contexts/${contextId}/remove`, {});
|
|
1478
1466
|
}
|
|
1479
1467
|
// ---- Group Invitation & Join ----
|
|
1480
1468
|
async createGroupInvitation(groupId, request) {
|
|
@@ -1530,33 +1518,33 @@ var AdminApiClient = class {
|
|
|
1530
1518
|
/** Create a standalone group (POST /admin-api/groups). */
|
|
1531
1519
|
async createGroup(request) {
|
|
1532
1520
|
return unwrap(
|
|
1533
|
-
await this.httpClient.post("/admin-api/groups",
|
|
1534
|
-
upgradePolicy: "LazyOnAccess",
|
|
1535
|
-
...request
|
|
1536
|
-
})
|
|
1521
|
+
await this.httpClient.post("/admin-api/groups", request)
|
|
1537
1522
|
);
|
|
1538
1523
|
}
|
|
1539
1524
|
/** Leave a group (POST /admin-api/groups/:group_id/leave). */
|
|
1540
|
-
async leaveGroup(groupId
|
|
1541
|
-
await this.httpClient.post(`/admin-api/groups/${groupId}/leave`,
|
|
1525
|
+
async leaveGroup(groupId) {
|
|
1526
|
+
await this.httpClient.post(`/admin-api/groups/${groupId}/leave`, {});
|
|
1542
1527
|
}
|
|
1543
1528
|
/** Leave a context (POST /admin-api/contexts/:context_id/leave). */
|
|
1544
|
-
async leaveContext(contextId
|
|
1545
|
-
await this.httpClient.post(`/admin-api/contexts/${contextId}/leave`,
|
|
1529
|
+
async leaveContext(contextId) {
|
|
1530
|
+
await this.httpClient.post(`/admin-api/contexts/${contextId}/leave`, {});
|
|
1546
1531
|
}
|
|
1547
1532
|
/** Leave a namespace (POST /admin-api/namespaces/:namespace_id/leave). */
|
|
1548
|
-
async leaveNamespace(namespaceId
|
|
1549
|
-
await this.httpClient.post(`/admin-api/namespaces/${namespaceId}/leave`,
|
|
1533
|
+
async leaveNamespace(namespaceId) {
|
|
1534
|
+
await this.httpClient.post(`/admin-api/namespaces/${namespaceId}/leave`, {});
|
|
1550
1535
|
}
|
|
1551
1536
|
/** Issue a group ownership proof (POST /admin-api/groups/:group_id/issue-ownership-proof). */
|
|
1552
1537
|
async issueOwnershipProof(groupId, request) {
|
|
1553
|
-
return this.httpClient.post(
|
|
1538
|
+
return this.httpClient.post(
|
|
1539
|
+
`/admin-api/groups/${groupId}/issue-ownership-proof`,
|
|
1540
|
+
request
|
|
1541
|
+
);
|
|
1554
1542
|
}
|
|
1555
1543
|
/** Issue a namespace ownership proof (POST /admin-api/groups/:group_id/issue-namespace-ownership-proof). */
|
|
1556
1544
|
async issueNamespaceOwnershipProof(groupId, request) {
|
|
1557
1545
|
return this.httpClient.post(
|
|
1558
1546
|
`/admin-api/groups/${groupId}/issue-namespace-ownership-proof`,
|
|
1559
|
-
request
|
|
1547
|
+
request
|
|
1560
1548
|
);
|
|
1561
1549
|
}
|
|
1562
1550
|
/**
|
|
@@ -1571,11 +1559,8 @@ var AdminApiClient = class {
|
|
|
1571
1559
|
await this.httpClient.put(`/admin-api/groups/${groupId}/members/${identity}/auto-follow`, request);
|
|
1572
1560
|
}
|
|
1573
1561
|
/** Abort a namespace migration (POST /admin-api/groups/:namespace_id/migration/abort). */
|
|
1574
|
-
async abortMigration(namespaceId
|
|
1575
|
-
return this.httpClient.post(
|
|
1576
|
-
`/admin-api/groups/${namespaceId}/migration/abort`,
|
|
1577
|
-
request ?? {}
|
|
1578
|
-
);
|
|
1562
|
+
async abortMigration(namespaceId) {
|
|
1563
|
+
return this.httpClient.post(`/admin-api/groups/${namespaceId}/migration/abort`, {});
|
|
1579
1564
|
}
|
|
1580
1565
|
};
|
|
1581
1566
|
|