@calimero-network/mero-js 4.0.0 → 6.0.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 +3 -3
- package/dist/admin-api/admin-client.d.ts.map +1 -1
- package/dist/admin-api/admin-client.js +3 -5
- package/dist/admin-api/admin-client.js.map +1 -1
- package/dist/admin-api/admin-types.d.ts +7 -8
- package/dist/admin-api/admin-types.d.ts.map +1 -1
- package/dist/auth-api/auth-client.d.ts +3 -5
- package/dist/auth-api/auth-client.d.ts.map +1 -1
- package/dist/auth-api/auth-client.js +12 -8
- package/dist/auth-api/auth-client.js.map +1 -1
- package/dist/auth-api/auth-types.d.ts +41 -51
- package/dist/auth-api/auth-types.d.ts.map +1 -1
- package/dist/index.browser.mjs +2 -2
- package/dist/index.browser.mjs.map +3 -3
- package/dist/index.cjs +26 -13
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +26 -13
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -559,9 +559,6 @@ var AuthApiClient = class {
|
|
|
559
559
|
async generateMockTokens(request) {
|
|
560
560
|
return this.httpClient.post("/auth/mock-token", request);
|
|
561
561
|
}
|
|
562
|
-
async getChallenge() {
|
|
563
|
-
return this.httpClient.get("/auth/challenge");
|
|
564
|
-
}
|
|
565
562
|
async validateToken(token) {
|
|
566
563
|
try {
|
|
567
564
|
const response = await this.validateTokenGet(token);
|
|
@@ -587,12 +584,18 @@ var AuthApiClient = class {
|
|
|
587
584
|
headers: response.headers
|
|
588
585
|
};
|
|
589
586
|
}
|
|
590
|
-
async isAuthed() {
|
|
591
|
-
return this.httpClient.get("/auth/is-authed");
|
|
592
|
-
}
|
|
593
587
|
// Token Management Endpoints
|
|
588
|
+
// NOTE: node auth status lives on AdminApiClient.isAuthed() (/admin-api/is-authed);
|
|
589
|
+
// there is no /auth/is-authed on the auth service.
|
|
594
590
|
async revokeTokens(request) {
|
|
595
|
-
|
|
591
|
+
const response = await this.httpClient.post(
|
|
592
|
+
"/admin/revoke",
|
|
593
|
+
request
|
|
594
|
+
);
|
|
595
|
+
if (!response.data) {
|
|
596
|
+
throw new Error("Revoke tokens response data is null");
|
|
597
|
+
}
|
|
598
|
+
return response.data;
|
|
596
599
|
}
|
|
597
600
|
// Key Management Endpoints
|
|
598
601
|
async listRootKeys() {
|
|
@@ -603,7 +606,14 @@ var AuthApiClient = class {
|
|
|
603
606
|
return response.data;
|
|
604
607
|
}
|
|
605
608
|
async createRootKey(request) {
|
|
606
|
-
|
|
609
|
+
const response = await this.httpClient.post(
|
|
610
|
+
"/admin/keys",
|
|
611
|
+
request
|
|
612
|
+
);
|
|
613
|
+
if (!response.data) {
|
|
614
|
+
throw new Error("Create root key response data is null");
|
|
615
|
+
}
|
|
616
|
+
return response.data;
|
|
607
617
|
}
|
|
608
618
|
async deleteRootKey(keyId) {
|
|
609
619
|
return this.httpClient.delete(`/admin/keys/${keyId}`);
|
|
@@ -1219,11 +1229,14 @@ var AdminApiClient = class {
|
|
|
1219
1229
|
)
|
|
1220
1230
|
);
|
|
1221
1231
|
}
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1232
|
+
/** Move `childGroupId` under `request.newParentId`. */
|
|
1233
|
+
async reparentGroup(childGroupId, request) {
|
|
1234
|
+
return unwrap(
|
|
1235
|
+
await this.httpClient.post(
|
|
1236
|
+
`/admin-api/groups/${childGroupId}/reparent`,
|
|
1237
|
+
request
|
|
1238
|
+
)
|
|
1239
|
+
);
|
|
1227
1240
|
}
|
|
1228
1241
|
async listSubgroups(groupId) {
|
|
1229
1242
|
const response = await this.httpClient.get(
|