@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.mjs
CHANGED
|
@@ -499,9 +499,6 @@ var AuthApiClient = class {
|
|
|
499
499
|
async generateMockTokens(request) {
|
|
500
500
|
return this.httpClient.post("/auth/mock-token", request);
|
|
501
501
|
}
|
|
502
|
-
async getChallenge() {
|
|
503
|
-
return this.httpClient.get("/auth/challenge");
|
|
504
|
-
}
|
|
505
502
|
async validateToken(token) {
|
|
506
503
|
try {
|
|
507
504
|
const response = await this.validateTokenGet(token);
|
|
@@ -527,12 +524,18 @@ var AuthApiClient = class {
|
|
|
527
524
|
headers: response.headers
|
|
528
525
|
};
|
|
529
526
|
}
|
|
530
|
-
async isAuthed() {
|
|
531
|
-
return this.httpClient.get("/auth/is-authed");
|
|
532
|
-
}
|
|
533
527
|
// Token Management Endpoints
|
|
528
|
+
// NOTE: node auth status lives on AdminApiClient.isAuthed() (/admin-api/is-authed);
|
|
529
|
+
// there is no /auth/is-authed on the auth service.
|
|
534
530
|
async revokeTokens(request) {
|
|
535
|
-
|
|
531
|
+
const response = await this.httpClient.post(
|
|
532
|
+
"/admin/revoke",
|
|
533
|
+
request
|
|
534
|
+
);
|
|
535
|
+
if (!response.data) {
|
|
536
|
+
throw new Error("Revoke tokens response data is null");
|
|
537
|
+
}
|
|
538
|
+
return response.data;
|
|
536
539
|
}
|
|
537
540
|
// Key Management Endpoints
|
|
538
541
|
async listRootKeys() {
|
|
@@ -543,7 +546,14 @@ var AuthApiClient = class {
|
|
|
543
546
|
return response.data;
|
|
544
547
|
}
|
|
545
548
|
async createRootKey(request) {
|
|
546
|
-
|
|
549
|
+
const response = await this.httpClient.post(
|
|
550
|
+
"/admin/keys",
|
|
551
|
+
request
|
|
552
|
+
);
|
|
553
|
+
if (!response.data) {
|
|
554
|
+
throw new Error("Create root key response data is null");
|
|
555
|
+
}
|
|
556
|
+
return response.data;
|
|
547
557
|
}
|
|
548
558
|
async deleteRootKey(keyId) {
|
|
549
559
|
return this.httpClient.delete(`/admin/keys/${keyId}`);
|
|
@@ -1159,11 +1169,14 @@ var AdminApiClient = class {
|
|
|
1159
1169
|
)
|
|
1160
1170
|
);
|
|
1161
1171
|
}
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1172
|
+
/** Move `childGroupId` under `request.newParentId`. */
|
|
1173
|
+
async reparentGroup(childGroupId, request) {
|
|
1174
|
+
return unwrap(
|
|
1175
|
+
await this.httpClient.post(
|
|
1176
|
+
`/admin-api/groups/${childGroupId}/reparent`,
|
|
1177
|
+
request
|
|
1178
|
+
)
|
|
1179
|
+
);
|
|
1167
1180
|
}
|
|
1168
1181
|
async listSubgroups(groupId) {
|
|
1169
1182
|
const response = await this.httpClient.get(
|