@mitumba/sdk 1.24.0 → 1.25.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
@@ -454,6 +454,21 @@ var AuthModule = class {
454
454
  await this.client.clearToken();
455
455
  return result;
456
456
  }
457
+ // ── Passkey Login ──
458
+ /**
459
+ * Start passkey login — get assertion options for navigator.credentials.get().
460
+ */
461
+ async startPasskeyLogin(input, options) {
462
+ return this.client.post("/auth/2fa/login/passkey/start", input, options);
463
+ }
464
+ /**
465
+ * Finish passkey login — submit the browser's assertion response. Tokens are auto-persisted.
466
+ */
467
+ async finishPasskeyLogin(input, options) {
468
+ const result = await this.client.post("/auth/2fa/login/passkey/finish", input, options);
469
+ await this.client.setSession(result);
470
+ return result;
471
+ }
457
472
  };
458
473
 
459
474
  // src/modules/listings.ts
@@ -787,6 +802,15 @@ var MessagesModule = class {
787
802
  const wsUrl = this.client.getBaseUrl().replace(/^http/, "ws") + `/notify/messages/${partnerId}/ws?token=${token}`;
788
803
  return new WebSocket(wsUrl);
789
804
  }
805
+ /**
806
+ * Connect to the user-scoped inbox WebSocket.
807
+ * Emits InboxRealtimeEvent for every inbound message across all conversations.
808
+ */
809
+ connectInbox() {
810
+ const token = this.client.getToken();
811
+ const wsUrl = this.client.getBaseUrl().replace(/^http/, "ws") + `/notify/messages/inbox?token=${token}`;
812
+ return new WebSocket(wsUrl);
813
+ }
790
814
  };
791
815
 
792
816
  // src/modules/notifications.ts
@@ -1138,6 +1162,13 @@ var SettingsModule = class {
1138
1162
  async challenge2FAMethod(id, options) {
1139
1163
  return this.client.post(`/auth/2fa/methods/${id}/challenge`, void 0, options);
1140
1164
  }
1165
+ // ── Passkey Registration ──
1166
+ async startPasskeyRegistration(input, options) {
1167
+ return this.client.post("/auth/2fa/methods", { type: "passkey", ...input }, options);
1168
+ }
1169
+ async finishPasskeyRegistration(methodId, credential, options) {
1170
+ return this.client.post(`/auth/2fa/methods/${methodId}/passkey/finish`, credential, options);
1171
+ }
1141
1172
  };
1142
1173
 
1143
1174
  // src/modules/mailer.ts
@@ -1384,7 +1415,7 @@ var ReportsModule = class {
1384
1415
  };
1385
1416
 
1386
1417
  // src/types/auth.ts
1387
- var TWO_FACTOR_METHOD_TYPES = ["totp", "sms", "email"];
1418
+ var TWO_FACTOR_METHOD_TYPES = ["totp", "sms", "email", "passkey"];
1388
1419
 
1389
1420
  // src/types/listings.ts
1390
1421
  var CONDITIONS = ["new", "like_new", "good", "fair"];