@mitumba/sdk 1.22.0 → 1.23.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
@@ -74,10 +74,38 @@ interface CompleteOnboardingInput {
74
74
  interface TwoFactorRequired {
75
75
  requires_2fa: true;
76
76
  temp_token: string;
77
+ methods?: {
78
+ id: string;
79
+ type: TwoFactorMethodType;
80
+ label: string | null;
81
+ }[];
77
82
  }
78
83
  interface Verify2FAInput {
79
84
  temp_token: string;
80
85
  code: string;
86
+ method_id?: string;
87
+ }
88
+ declare const TWO_FACTOR_METHOD_TYPES: readonly ["totp", "sms", "email"];
89
+ type TwoFactorMethodType = typeof TWO_FACTOR_METHOD_TYPES[number];
90
+ interface TwoFactorMethod {
91
+ id: string;
92
+ type: TwoFactorMethodType;
93
+ label: string | null;
94
+ enabled: boolean;
95
+ is_primary: boolean;
96
+ verified_at: string | null;
97
+ created_at: string;
98
+ last_used_at: string | null;
99
+ }
100
+ interface Add2FAMethodInput {
101
+ type: TwoFactorMethodType;
102
+ label?: string;
103
+ target?: string;
104
+ }
105
+ interface Add2FAMethodResult {
106
+ id: string;
107
+ otpauth_uri?: string;
108
+ secret?: string;
81
109
  }
82
110
  interface BecomeSellerInput {
83
111
  seller_type: 'individual' | 'business';
@@ -104,6 +132,7 @@ interface UserProfile {
104
132
  email_verified: boolean;
105
133
  totp_enabled: boolean;
106
134
  totp_configured: boolean;
135
+ two_factor_methods_count?: number;
107
136
  is_active: boolean;
108
137
  created_at: string;
109
138
  roles: string[];
@@ -1651,6 +1680,29 @@ declare class SettingsModule {
1651
1680
  delete2FA(code: string, options?: RequestOptions): Promise<{
1652
1681
  ok: true;
1653
1682
  }>;
1683
+ list2FAMethods(options?: RequestOptions): Promise<{
1684
+ methods: TwoFactorMethod[];
1685
+ }>;
1686
+ add2FAMethod(input: Add2FAMethodInput, options?: RequestOptions): Promise<Add2FAMethodResult>;
1687
+ verify2FAMethod(id: string, code: string, options?: RequestOptions): Promise<{
1688
+ ok: true;
1689
+ backup_codes?: string[];
1690
+ }>;
1691
+ enable2FAMethod(id: string, code: string, options?: RequestOptions): Promise<{
1692
+ ok: true;
1693
+ }>;
1694
+ disable2FAMethod(id: string, code: string, options?: RequestOptions): Promise<{
1695
+ ok: true;
1696
+ }>;
1697
+ delete2FAMethod(id: string, code: string, options?: RequestOptions): Promise<{
1698
+ ok: true;
1699
+ }>;
1700
+ setPrimary2FAMethod(id: string, options?: RequestOptions): Promise<{
1701
+ ok: true;
1702
+ }>;
1703
+ challenge2FAMethod(id: string, options?: RequestOptions): Promise<{
1704
+ ok: true;
1705
+ }>;
1654
1706
  }
1655
1707
 
1656
1708
  declare class MailerModule {
@@ -2000,4 +2052,4 @@ declare class MitumbaClient {
2000
2052
  isAuthenticated(): Promise<boolean>;
2001
2053
  }
2002
2054
 
2003
- export { APIClient, APIError, type APIErrorResponse, 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, type TokenStore, type TransitionOrderInput, type TrendingTerm, 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 };
2055
+ 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 };
package/dist/index.d.ts CHANGED
@@ -74,10 +74,38 @@ interface CompleteOnboardingInput {
74
74
  interface TwoFactorRequired {
75
75
  requires_2fa: true;
76
76
  temp_token: string;
77
+ methods?: {
78
+ id: string;
79
+ type: TwoFactorMethodType;
80
+ label: string | null;
81
+ }[];
77
82
  }
78
83
  interface Verify2FAInput {
79
84
  temp_token: string;
80
85
  code: string;
86
+ method_id?: string;
87
+ }
88
+ declare const TWO_FACTOR_METHOD_TYPES: readonly ["totp", "sms", "email"];
89
+ type TwoFactorMethodType = typeof TWO_FACTOR_METHOD_TYPES[number];
90
+ interface TwoFactorMethod {
91
+ id: string;
92
+ type: TwoFactorMethodType;
93
+ label: string | null;
94
+ enabled: boolean;
95
+ is_primary: boolean;
96
+ verified_at: string | null;
97
+ created_at: string;
98
+ last_used_at: string | null;
99
+ }
100
+ interface Add2FAMethodInput {
101
+ type: TwoFactorMethodType;
102
+ label?: string;
103
+ target?: string;
104
+ }
105
+ interface Add2FAMethodResult {
106
+ id: string;
107
+ otpauth_uri?: string;
108
+ secret?: string;
81
109
  }
82
110
  interface BecomeSellerInput {
83
111
  seller_type: 'individual' | 'business';
@@ -104,6 +132,7 @@ interface UserProfile {
104
132
  email_verified: boolean;
105
133
  totp_enabled: boolean;
106
134
  totp_configured: boolean;
135
+ two_factor_methods_count?: number;
107
136
  is_active: boolean;
108
137
  created_at: string;
109
138
  roles: string[];
@@ -1651,6 +1680,29 @@ declare class SettingsModule {
1651
1680
  delete2FA(code: string, options?: RequestOptions): Promise<{
1652
1681
  ok: true;
1653
1682
  }>;
1683
+ list2FAMethods(options?: RequestOptions): Promise<{
1684
+ methods: TwoFactorMethod[];
1685
+ }>;
1686
+ add2FAMethod(input: Add2FAMethodInput, options?: RequestOptions): Promise<Add2FAMethodResult>;
1687
+ verify2FAMethod(id: string, code: string, options?: RequestOptions): Promise<{
1688
+ ok: true;
1689
+ backup_codes?: string[];
1690
+ }>;
1691
+ enable2FAMethod(id: string, code: string, options?: RequestOptions): Promise<{
1692
+ ok: true;
1693
+ }>;
1694
+ disable2FAMethod(id: string, code: string, options?: RequestOptions): Promise<{
1695
+ ok: true;
1696
+ }>;
1697
+ delete2FAMethod(id: string, code: string, options?: RequestOptions): Promise<{
1698
+ ok: true;
1699
+ }>;
1700
+ setPrimary2FAMethod(id: string, options?: RequestOptions): Promise<{
1701
+ ok: true;
1702
+ }>;
1703
+ challenge2FAMethod(id: string, options?: RequestOptions): Promise<{
1704
+ ok: true;
1705
+ }>;
1654
1706
  }
1655
1707
 
1656
1708
  declare class MailerModule {
@@ -2000,4 +2052,4 @@ declare class MitumbaClient {
2000
2052
  isAuthenticated(): Promise<boolean>;
2001
2053
  }
2002
2054
 
2003
- export { APIClient, APIError, type APIErrorResponse, 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, type TokenStore, type TransitionOrderInput, type TrendingTerm, 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 };
2055
+ 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 };
package/dist/index.js CHANGED
@@ -1108,6 +1108,31 @@ var SettingsModule = class {
1108
1108
  async delete2FA(code, options) {
1109
1109
  return this.client.delete("/auth/2fa", { code }, options);
1110
1110
  }
1111
+ // ── Multi-Method 2FA ──
1112
+ async list2FAMethods(options) {
1113
+ return this.client.get("/auth/2fa/methods", void 0, options);
1114
+ }
1115
+ async add2FAMethod(input, options) {
1116
+ return this.client.post("/auth/2fa/methods", input, options);
1117
+ }
1118
+ async verify2FAMethod(id, code, options) {
1119
+ return this.client.post(`/auth/2fa/methods/${id}/verify`, { code }, options);
1120
+ }
1121
+ async enable2FAMethod(id, code, options) {
1122
+ return this.client.post(`/auth/2fa/methods/${id}/enable`, { code }, options);
1123
+ }
1124
+ async disable2FAMethod(id, code, options) {
1125
+ return this.client.post(`/auth/2fa/methods/${id}/disable`, { code }, options);
1126
+ }
1127
+ async delete2FAMethod(id, code, options) {
1128
+ return this.client.delete(`/auth/2fa/methods/${id}`, { code }, options);
1129
+ }
1130
+ async setPrimary2FAMethod(id, options) {
1131
+ return this.client.post(`/auth/2fa/methods/${id}/primary`, void 0, options);
1132
+ }
1133
+ async challenge2FAMethod(id, options) {
1134
+ return this.client.post(`/auth/2fa/methods/${id}/challenge`, void 0, options);
1135
+ }
1111
1136
  };
1112
1137
 
1113
1138
  // src/modules/mailer.ts
@@ -1353,6 +1378,9 @@ var ReportsModule = class {
1353
1378
  }
1354
1379
  };
1355
1380
 
1381
+ // src/types/auth.ts
1382
+ var TWO_FACTOR_METHOD_TYPES = ["totp", "sms", "email"];
1383
+
1356
1384
  // src/types/listings.ts
1357
1385
  var CONDITIONS = ["new", "like_new", "good", "fair"];
1358
1386
  var LISTING_STATUSES = ["draft", "active", "sold", "removed"];
@@ -1489,6 +1517,7 @@ exports.ReviewsModule = ReviewsModule;
1489
1517
  exports.SearchModule = SearchModule;
1490
1518
  exports.SettingsModule = SettingsModule;
1491
1519
  exports.StoresModule = StoresModule;
1520
+ exports.TWO_FACTOR_METHOD_TYPES = TWO_FACTOR_METHOD_TYPES;
1492
1521
  exports.UploadsModule = UploadsModule;
1493
1522
  exports.VaziModule = VaziModule;
1494
1523
  exports.WishlistsModule = WishlistsModule;