@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.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
- return this.httpClient.post("/admin/revoke", request);
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
- return this.httpClient.post("/admin/keys", request);
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}`);