@calimero-network/mero-js 4.0.0 → 5.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/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
- return this.httpClient.post("/admin/revoke", request);
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
- return this.httpClient.post("/admin/keys", request);
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}`);