@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.d.mts CHANGED
@@ -85,7 +85,7 @@ interface Verify2FAInput {
85
85
  code: string;
86
86
  method_id?: string;
87
87
  }
88
- declare const TWO_FACTOR_METHOD_TYPES: readonly ["totp", "sms", "email"];
88
+ declare const TWO_FACTOR_METHOD_TYPES: readonly ["totp", "sms", "email", "passkey"];
89
89
  type TwoFactorMethodType = typeof TWO_FACTOR_METHOD_TYPES[number];
90
90
  interface TwoFactorMethod {
91
91
  id: string;
@@ -107,6 +107,77 @@ interface Add2FAMethodResult {
107
107
  otpauth_uri?: string;
108
108
  secret?: string;
109
109
  }
110
+ /** WebAuthn L2 JSON — options returned by the server for navigator.credentials.create() */
111
+ interface PublicKeyCredentialCreationOptionsJSON {
112
+ rp: {
113
+ name: string;
114
+ id?: string;
115
+ };
116
+ user: {
117
+ id: string;
118
+ name: string;
119
+ displayName: string;
120
+ };
121
+ challenge: string;
122
+ pubKeyCredParams: {
123
+ type: string;
124
+ alg: number;
125
+ }[];
126
+ timeout?: number;
127
+ excludeCredentials?: {
128
+ id: string;
129
+ type: string;
130
+ transports?: string[];
131
+ }[];
132
+ authenticatorSelection?: {
133
+ authenticatorAttachment?: string;
134
+ residentKey?: string;
135
+ requireResidentKey?: boolean;
136
+ userVerification?: string;
137
+ };
138
+ attestation?: string;
139
+ extensions?: Record<string, unknown>;
140
+ }
141
+ /** WebAuthn L2 JSON — the browser's response from navigator.credentials.create() */
142
+ interface RegistrationResponseJSON {
143
+ id: string;
144
+ rawId: string;
145
+ response: {
146
+ clientDataJSON: string;
147
+ attestationObject: string;
148
+ transports?: string[];
149
+ };
150
+ type: string;
151
+ clientExtensionResults?: Record<string, unknown>;
152
+ authenticatorAttachment?: string;
153
+ }
154
+ /** WebAuthn L2 JSON — options returned by the server for navigator.credentials.get() */
155
+ interface PublicKeyCredentialRequestOptionsJSON {
156
+ challenge: string;
157
+ timeout?: number;
158
+ rpId?: string;
159
+ allowCredentials?: {
160
+ id: string;
161
+ type: string;
162
+ transports?: string[];
163
+ }[];
164
+ userVerification?: string;
165
+ extensions?: Record<string, unknown>;
166
+ }
167
+ /** WebAuthn L2 JSON — the browser's response from navigator.credentials.get() */
168
+ interface AuthenticationResponseJSON {
169
+ id: string;
170
+ rawId: string;
171
+ response: {
172
+ clientDataJSON: string;
173
+ authenticatorData: string;
174
+ signature: string;
175
+ userHandle?: string;
176
+ };
177
+ type: string;
178
+ clientExtensionResults?: Record<string, unknown>;
179
+ authenticatorAttachment?: string;
180
+ }
110
181
  interface BecomeSellerInput {
111
182
  seller_type: 'individual' | 'business';
112
183
  sti_score: number;
@@ -128,12 +199,16 @@ interface UserProfile {
128
199
  phone: string | null;
129
200
  display_name: string | null;
130
201
  city_id: string | null;
202
+ county: string | null;
203
+ bio: string | null;
204
+ avatar_url: string | null;
131
205
  onboarding_completed: boolean;
132
206
  email_verified: boolean;
133
207
  totp_enabled: boolean;
134
208
  totp_configured: boolean;
135
209
  two_factor_methods_count?: number;
136
210
  sms_2fa_available?: boolean;
211
+ email_2fa_available?: boolean;
137
212
  is_active: boolean;
138
213
  created_at: string;
139
214
  roles: string[];
@@ -421,6 +496,16 @@ interface SendMessageInput {
421
496
  order_id?: string;
422
497
  from_store?: boolean;
423
498
  }
499
+ interface InboxRealtimeEvent {
500
+ type: 'message';
501
+ conversation_key: string;
502
+ partner_id: string;
503
+ store_id?: string | null;
504
+ from_store?: boolean;
505
+ preview: string;
506
+ created_at: string;
507
+ unread_count?: number;
508
+ }
424
509
 
425
510
  type NotificationType = 'order' | 'message' | 'price_drop' | 'offer' | 'payout' | 'system';
426
511
  interface Notification {
@@ -1149,6 +1234,22 @@ declare class AuthModule {
1149
1234
  }, options?: RequestOptions): Promise<{
1150
1235
  ok: true;
1151
1236
  }>;
1237
+ /**
1238
+ * Start passkey login — get assertion options for navigator.credentials.get().
1239
+ */
1240
+ startPasskeyLogin(input: {
1241
+ temp_token: string;
1242
+ method_id?: string;
1243
+ }, options?: RequestOptions): Promise<{
1244
+ options: PublicKeyCredentialRequestOptionsJSON;
1245
+ }>;
1246
+ /**
1247
+ * Finish passkey login — submit the browser's assertion response. Tokens are auto-persisted.
1248
+ */
1249
+ finishPasskeyLogin(input: {
1250
+ temp_token: string;
1251
+ credential: AuthenticationResponseJSON;
1252
+ }, options?: RequestOptions): Promise<AuthTokens>;
1152
1253
  }
1153
1254
 
1154
1255
  declare class ListingsModule {
@@ -1408,6 +1509,11 @@ declare class MessagesModule {
1408
1509
  * Token is passed via query param since WebSocket can't set headers.
1409
1510
  */
1410
1511
  connectTyping(partnerId: string): WebSocket;
1512
+ /**
1513
+ * Connect to the user-scoped inbox WebSocket.
1514
+ * Emits InboxRealtimeEvent for every inbound message across all conversations.
1515
+ */
1516
+ connectInbox(): WebSocket;
1411
1517
  }
1412
1518
 
1413
1519
  declare class NotificationsModule {
@@ -1714,6 +1820,16 @@ declare class SettingsModule {
1714
1820
  challenge2FAMethod(id: string, options?: RequestOptions): Promise<{
1715
1821
  ok: true;
1716
1822
  }>;
1823
+ startPasskeyRegistration(input?: {
1824
+ label?: string;
1825
+ }, options?: RequestOptions): Promise<{
1826
+ method_id: string;
1827
+ options: PublicKeyCredentialCreationOptionsJSON;
1828
+ }>;
1829
+ finishPasskeyRegistration(methodId: string, credential: RegistrationResponseJSON, options?: RequestOptions): Promise<{
1830
+ ok: true;
1831
+ backup_codes?: string[];
1832
+ }>;
1717
1833
  }
1718
1834
 
1719
1835
  declare class MailerModule {
@@ -2063,4 +2179,4 @@ declare class MitumbaClient {
2063
2179
  isAuthenticated(): Promise<boolean>;
2064
2180
  }
2065
2181
 
2066
- export { APIClient, APIError, type APIErrorResponse, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddPaymentMethodInput, type Address, type AdminListingItem, AdminModule, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminReport, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, AuthModule, type AuthTokens, type BecomeSellerInput, type BlockedIp, type Business, BusinessesModule, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateListingInput, type CreateOrderInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, LISTING_STATUSES, type LinkedAccount, type LinkedAccountProvider, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageResponse, MessagesModule, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentMethod, type PaymentMethodType, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type RaiseDisputeInput, type RegisterInput, ReportsModule, type RequestOptions, type ResetPasswordInput, type ResolveDisputeInput, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type SaveSearchInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SendEmailInput, type SendMessageInput, type SendOtpInput, type Session, SettingsModule, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreSettings, type StoreStats, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, UploadsModule, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WishlistListing, WishlistsModule, createTokenStore };
2182
+ export { APIClient, APIError, type APIErrorResponse, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddPaymentMethodInput, type Address, type AdminListingItem, AdminModule, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminReport, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, AuthModule, type AuthTokens, type AuthenticationResponseJSON, type BecomeSellerInput, type BlockedIp, type Business, BusinessesModule, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateListingInput, type CreateOrderInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type InboxRealtimeEvent, LISTING_STATUSES, type LinkedAccount, type LinkedAccountProvider, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageResponse, MessagesModule, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentMethod, type PaymentMethodType, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type RegisterInput, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type ResetPasswordInput, type ResolveDisputeInput, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type SaveSearchInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SendEmailInput, type SendMessageInput, type SendOtpInput, type Session, SettingsModule, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreSettings, type StoreStats, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, UploadsModule, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WishlistListing, WishlistsModule, createTokenStore };
package/dist/index.d.ts CHANGED
@@ -85,7 +85,7 @@ interface Verify2FAInput {
85
85
  code: string;
86
86
  method_id?: string;
87
87
  }
88
- declare const TWO_FACTOR_METHOD_TYPES: readonly ["totp", "sms", "email"];
88
+ declare const TWO_FACTOR_METHOD_TYPES: readonly ["totp", "sms", "email", "passkey"];
89
89
  type TwoFactorMethodType = typeof TWO_FACTOR_METHOD_TYPES[number];
90
90
  interface TwoFactorMethod {
91
91
  id: string;
@@ -107,6 +107,77 @@ interface Add2FAMethodResult {
107
107
  otpauth_uri?: string;
108
108
  secret?: string;
109
109
  }
110
+ /** WebAuthn L2 JSON — options returned by the server for navigator.credentials.create() */
111
+ interface PublicKeyCredentialCreationOptionsJSON {
112
+ rp: {
113
+ name: string;
114
+ id?: string;
115
+ };
116
+ user: {
117
+ id: string;
118
+ name: string;
119
+ displayName: string;
120
+ };
121
+ challenge: string;
122
+ pubKeyCredParams: {
123
+ type: string;
124
+ alg: number;
125
+ }[];
126
+ timeout?: number;
127
+ excludeCredentials?: {
128
+ id: string;
129
+ type: string;
130
+ transports?: string[];
131
+ }[];
132
+ authenticatorSelection?: {
133
+ authenticatorAttachment?: string;
134
+ residentKey?: string;
135
+ requireResidentKey?: boolean;
136
+ userVerification?: string;
137
+ };
138
+ attestation?: string;
139
+ extensions?: Record<string, unknown>;
140
+ }
141
+ /** WebAuthn L2 JSON — the browser's response from navigator.credentials.create() */
142
+ interface RegistrationResponseJSON {
143
+ id: string;
144
+ rawId: string;
145
+ response: {
146
+ clientDataJSON: string;
147
+ attestationObject: string;
148
+ transports?: string[];
149
+ };
150
+ type: string;
151
+ clientExtensionResults?: Record<string, unknown>;
152
+ authenticatorAttachment?: string;
153
+ }
154
+ /** WebAuthn L2 JSON — options returned by the server for navigator.credentials.get() */
155
+ interface PublicKeyCredentialRequestOptionsJSON {
156
+ challenge: string;
157
+ timeout?: number;
158
+ rpId?: string;
159
+ allowCredentials?: {
160
+ id: string;
161
+ type: string;
162
+ transports?: string[];
163
+ }[];
164
+ userVerification?: string;
165
+ extensions?: Record<string, unknown>;
166
+ }
167
+ /** WebAuthn L2 JSON — the browser's response from navigator.credentials.get() */
168
+ interface AuthenticationResponseJSON {
169
+ id: string;
170
+ rawId: string;
171
+ response: {
172
+ clientDataJSON: string;
173
+ authenticatorData: string;
174
+ signature: string;
175
+ userHandle?: string;
176
+ };
177
+ type: string;
178
+ clientExtensionResults?: Record<string, unknown>;
179
+ authenticatorAttachment?: string;
180
+ }
110
181
  interface BecomeSellerInput {
111
182
  seller_type: 'individual' | 'business';
112
183
  sti_score: number;
@@ -128,12 +199,16 @@ interface UserProfile {
128
199
  phone: string | null;
129
200
  display_name: string | null;
130
201
  city_id: string | null;
202
+ county: string | null;
203
+ bio: string | null;
204
+ avatar_url: string | null;
131
205
  onboarding_completed: boolean;
132
206
  email_verified: boolean;
133
207
  totp_enabled: boolean;
134
208
  totp_configured: boolean;
135
209
  two_factor_methods_count?: number;
136
210
  sms_2fa_available?: boolean;
211
+ email_2fa_available?: boolean;
137
212
  is_active: boolean;
138
213
  created_at: string;
139
214
  roles: string[];
@@ -421,6 +496,16 @@ interface SendMessageInput {
421
496
  order_id?: string;
422
497
  from_store?: boolean;
423
498
  }
499
+ interface InboxRealtimeEvent {
500
+ type: 'message';
501
+ conversation_key: string;
502
+ partner_id: string;
503
+ store_id?: string | null;
504
+ from_store?: boolean;
505
+ preview: string;
506
+ created_at: string;
507
+ unread_count?: number;
508
+ }
424
509
 
425
510
  type NotificationType = 'order' | 'message' | 'price_drop' | 'offer' | 'payout' | 'system';
426
511
  interface Notification {
@@ -1149,6 +1234,22 @@ declare class AuthModule {
1149
1234
  }, options?: RequestOptions): Promise<{
1150
1235
  ok: true;
1151
1236
  }>;
1237
+ /**
1238
+ * Start passkey login — get assertion options for navigator.credentials.get().
1239
+ */
1240
+ startPasskeyLogin(input: {
1241
+ temp_token: string;
1242
+ method_id?: string;
1243
+ }, options?: RequestOptions): Promise<{
1244
+ options: PublicKeyCredentialRequestOptionsJSON;
1245
+ }>;
1246
+ /**
1247
+ * Finish passkey login — submit the browser's assertion response. Tokens are auto-persisted.
1248
+ */
1249
+ finishPasskeyLogin(input: {
1250
+ temp_token: string;
1251
+ credential: AuthenticationResponseJSON;
1252
+ }, options?: RequestOptions): Promise<AuthTokens>;
1152
1253
  }
1153
1254
 
1154
1255
  declare class ListingsModule {
@@ -1408,6 +1509,11 @@ declare class MessagesModule {
1408
1509
  * Token is passed via query param since WebSocket can't set headers.
1409
1510
  */
1410
1511
  connectTyping(partnerId: string): WebSocket;
1512
+ /**
1513
+ * Connect to the user-scoped inbox WebSocket.
1514
+ * Emits InboxRealtimeEvent for every inbound message across all conversations.
1515
+ */
1516
+ connectInbox(): WebSocket;
1411
1517
  }
1412
1518
 
1413
1519
  declare class NotificationsModule {
@@ -1714,6 +1820,16 @@ declare class SettingsModule {
1714
1820
  challenge2FAMethod(id: string, options?: RequestOptions): Promise<{
1715
1821
  ok: true;
1716
1822
  }>;
1823
+ startPasskeyRegistration(input?: {
1824
+ label?: string;
1825
+ }, options?: RequestOptions): Promise<{
1826
+ method_id: string;
1827
+ options: PublicKeyCredentialCreationOptionsJSON;
1828
+ }>;
1829
+ finishPasskeyRegistration(methodId: string, credential: RegistrationResponseJSON, options?: RequestOptions): Promise<{
1830
+ ok: true;
1831
+ backup_codes?: string[];
1832
+ }>;
1717
1833
  }
1718
1834
 
1719
1835
  declare class MailerModule {
@@ -2063,4 +2179,4 @@ declare class MitumbaClient {
2063
2179
  isAuthenticated(): Promise<boolean>;
2064
2180
  }
2065
2181
 
2066
- export { APIClient, APIError, type APIErrorResponse, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddPaymentMethodInput, type Address, type AdminListingItem, AdminModule, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminReport, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, AuthModule, type AuthTokens, type BecomeSellerInput, type BlockedIp, type Business, BusinessesModule, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateListingInput, type CreateOrderInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, LISTING_STATUSES, type LinkedAccount, type LinkedAccountProvider, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageResponse, MessagesModule, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentMethod, type PaymentMethodType, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type RaiseDisputeInput, type RegisterInput, ReportsModule, type RequestOptions, type ResetPasswordInput, type ResolveDisputeInput, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type SaveSearchInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SendEmailInput, type SendMessageInput, type SendOtpInput, type Session, SettingsModule, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreSettings, type StoreStats, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, UploadsModule, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WishlistListing, WishlistsModule, createTokenStore };
2182
+ export { APIClient, APIError, type APIErrorResponse, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddPaymentMethodInput, type Address, type AdminListingItem, AdminModule, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminReport, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, AuthModule, type AuthTokens, type AuthenticationResponseJSON, type BecomeSellerInput, type BlockedIp, type Business, BusinessesModule, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateListingInput, type CreateOrderInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type InboxRealtimeEvent, LISTING_STATUSES, type LinkedAccount, type LinkedAccountProvider, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageResponse, MessagesModule, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentMethod, type PaymentMethodType, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type RegisterInput, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type ResetPasswordInput, type ResolveDisputeInput, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type SaveSearchInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SendEmailInput, type SendMessageInput, type SendOtpInput, type Session, SettingsModule, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreSettings, type StoreStats, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, UploadsModule, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WishlistListing, WishlistsModule, createTokenStore };
package/dist/index.js CHANGED
@@ -456,6 +456,21 @@ var AuthModule = class {
456
456
  await this.client.clearToken();
457
457
  return result;
458
458
  }
459
+ // ── Passkey Login ──
460
+ /**
461
+ * Start passkey login — get assertion options for navigator.credentials.get().
462
+ */
463
+ async startPasskeyLogin(input, options) {
464
+ return this.client.post("/auth/2fa/login/passkey/start", input, options);
465
+ }
466
+ /**
467
+ * Finish passkey login — submit the browser's assertion response. Tokens are auto-persisted.
468
+ */
469
+ async finishPasskeyLogin(input, options) {
470
+ const result = await this.client.post("/auth/2fa/login/passkey/finish", input, options);
471
+ await this.client.setSession(result);
472
+ return result;
473
+ }
459
474
  };
460
475
 
461
476
  // src/modules/listings.ts
@@ -789,6 +804,15 @@ var MessagesModule = class {
789
804
  const wsUrl = this.client.getBaseUrl().replace(/^http/, "ws") + `/notify/messages/${partnerId}/ws?token=${token}`;
790
805
  return new WebSocket(wsUrl);
791
806
  }
807
+ /**
808
+ * Connect to the user-scoped inbox WebSocket.
809
+ * Emits InboxRealtimeEvent for every inbound message across all conversations.
810
+ */
811
+ connectInbox() {
812
+ const token = this.client.getToken();
813
+ const wsUrl = this.client.getBaseUrl().replace(/^http/, "ws") + `/notify/messages/inbox?token=${token}`;
814
+ return new WebSocket(wsUrl);
815
+ }
792
816
  };
793
817
 
794
818
  // src/modules/notifications.ts
@@ -1140,6 +1164,13 @@ var SettingsModule = class {
1140
1164
  async challenge2FAMethod(id, options) {
1141
1165
  return this.client.post(`/auth/2fa/methods/${id}/challenge`, void 0, options);
1142
1166
  }
1167
+ // ── Passkey Registration ──
1168
+ async startPasskeyRegistration(input, options) {
1169
+ return this.client.post("/auth/2fa/methods", { type: "passkey", ...input }, options);
1170
+ }
1171
+ async finishPasskeyRegistration(methodId, credential, options) {
1172
+ return this.client.post(`/auth/2fa/methods/${methodId}/passkey/finish`, credential, options);
1173
+ }
1143
1174
  };
1144
1175
 
1145
1176
  // src/modules/mailer.ts
@@ -1386,7 +1417,7 @@ var ReportsModule = class {
1386
1417
  };
1387
1418
 
1388
1419
  // src/types/auth.ts
1389
- var TWO_FACTOR_METHOD_TYPES = ["totp", "sms", "email"];
1420
+ var TWO_FACTOR_METHOD_TYPES = ["totp", "sms", "email", "passkey"];
1390
1421
 
1391
1422
  // src/types/listings.ts
1392
1423
  var CONDITIONS = ["new", "like_new", "good", "fair"];