@mitumba/sdk 5.12.0 → 5.14.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/README.md CHANGED
@@ -30,7 +30,7 @@ Initialize the client with the environment's base URL:
30
30
  import { MitumbaClient } from '@mitumba/sdk'
31
31
 
32
32
  const mitumba = new MitumbaClient({
33
- baseUrl: 'https://api.mitumba.stanl.ink'
33
+ baseUrl: 'https://api.mitumba.africa'
34
34
  })
35
35
  ```
36
36
 
package/dist/index.d.mts CHANGED
@@ -1018,7 +1018,7 @@ interface CreateReportInput {
1018
1018
  reason: 'counterfeit' | 'offensive' | 'spam' | 'scam' | 'other';
1019
1019
  detail?: string;
1020
1020
  }
1021
- type AdminPermission = 'admin:read' | 'users:moderate' | 'ip:block' | 'listings:moderate' | 'orders:transition' | 'payouts:disburse' | 'sellers:verify' | 'recovery:review' | 'broadcast:send' | 'roles:grant' | 'audit:read';
1021
+ type AdminPermission = 'admin:read' | 'users:moderate' | 'ip:block' | 'listings:moderate' | 'orders:transition' | 'payouts:disburse' | 'sellers:verify' | 'recovery:review' | 'broadcast:send' | 'clients:manage' | 'oidc:rotate_keys' | 'roles:grant' | 'audit:read';
1022
1022
  type AdminAuthStrength = 'password' | 'sms' | 'email' | 'totp' | 'passkey';
1023
1023
  interface AdminRolePreset {
1024
1024
  id: string;
@@ -1113,6 +1113,50 @@ interface AdminWholesalePendingStore {
1113
1113
  review_note?: string | null;
1114
1114
  [key: string]: unknown;
1115
1115
  }
1116
+ /** `public` clients (browser SPAs, mobile) use PKCE and have no secret; `confidential` clients have a server-side secret. */
1117
+ type OAuthClientType = 'public' | 'confidential';
1118
+ /** `first_party_implicit` skips the consent screen; `first_party_consent` shows it. */
1119
+ type OAuthClientTrustLevel = 'first_party_implicit' | 'first_party_consent';
1120
+ /** A registered sign-in (relying-party) client as listed by `admin.listOAuthClients()`. Never carries a secret. */
1121
+ interface OAuthClientSummary {
1122
+ client_id: string;
1123
+ name: string;
1124
+ client_type: OAuthClientType;
1125
+ trust_level: OAuthClientTrustLevel;
1126
+ is_active: boolean;
1127
+ created_at: string;
1128
+ updated_at: string;
1129
+ }
1130
+ /** A client with its exact-match redirect-URI allow-list and permitted scopes. */
1131
+ interface OAuthClient extends OAuthClientSummary {
1132
+ redirect_uris: string[];
1133
+ scopes: string[];
1134
+ }
1135
+ interface RegisterOAuthClientInput {
1136
+ name: string;
1137
+ client_type: OAuthClientType;
1138
+ trust_level: OAuthClientTrustLevel;
1139
+ /** Exact-match allow-list. Can be set later with `setOAuthClientRedirectUris()`. */
1140
+ redirect_uris?: string[];
1141
+ /** Scopes the client may request. Can be set later with `setOAuthClientScopes()`. */
1142
+ scopes?: string[];
1143
+ }
1144
+ /**
1145
+ * A newly registered client. `client_secret` is present only for a confidential client and is
1146
+ * returned exactly once — it is stored hashed and can never be read back.
1147
+ */
1148
+ interface RegisteredOAuthClient extends OAuthClient {
1149
+ client_secret?: string;
1150
+ }
1151
+ /** One OIDC signing key's metadata. Key material is never exposed. */
1152
+ interface OidcSigningKey {
1153
+ kid: string;
1154
+ alg: string;
1155
+ /** `current` signs; `previous` still verifies (published in JWKS); `retired` is neither. */
1156
+ status: 'current' | 'previous' | 'retired';
1157
+ created_at: string;
1158
+ rotated_at: string | null;
1159
+ }
1116
1160
 
1117
1161
  interface AuthTokens {
1118
1162
  access_token: string;
@@ -1413,6 +1457,12 @@ interface OAuthAuthorizeInput {
1413
1457
  state: string;
1414
1458
  /** The PKCE code challenge (base64url SHA-256 of the verifier). */
1415
1459
  code_challenge: string;
1460
+ /**
1461
+ * The OpenID Connect `nonce` from the relying party's authentication request. Carried to the
1462
+ * one-time code and echoed in the id_token's `nonce` claim, so the relying party can bind the
1463
+ * id_token to its own request and reject a replayed one. Pass it whenever the relying party sent it.
1464
+ */
1465
+ nonce?: string;
1416
1466
  }
1417
1467
  /**
1418
1468
  * Result of the authorize (mint) step: a one-time authorization code plus the echoed state.
@@ -2970,9 +3020,13 @@ declare class AuthModule {
2970
3020
  */
2971
3021
  sendOtp(input: SendOtpInput, options?: RequestOptions): Promise<MessageResponse>;
2972
3022
  /**
2973
- * Verify an OTP code. Tokens are auto-persisted.
3023
+ * Verify a phone OTP code.
3024
+ *
3025
+ * Returns the session tokens (auto-persisted) for an account without a second factor. An account
3026
+ * with 2FA gets a `TwoFactorRequired` challenge instead, exactly like `login()`: complete it with
3027
+ * `verify2FA()` or the passkey ceremony. Narrow with `'requires_2fa' in result`.
2974
3028
  */
2975
- verifyOtp(input: VerifyOtpInput, options?: RequestOptions): Promise<AuthTokens>;
3029
+ verifyOtp(input: VerifyOtpInput, options?: RequestOptions): Promise<AuthTokens | TwoFactorRequired>;
2976
3030
  /**
2977
3031
  * Refresh the access token using a refresh token.
2978
3032
  */
@@ -4201,6 +4255,45 @@ declare class AdminModule {
4201
4255
  entries: AdminAuditEntry[];
4202
4256
  next_cursor: string | null;
4203
4257
  }>;
4258
+ /** Every registered sign-in client, oldest first. Secrets are never included. */
4259
+ listOAuthClients(options?: RequestOptions): Promise<{
4260
+ clients: OAuthClientSummary[];
4261
+ }>;
4262
+ /** One client with its redirect-URI allow-list and permitted scopes. */
4263
+ getOAuthClient(clientId: string, options?: RequestOptions): Promise<OAuthClient>;
4264
+ /**
4265
+ * Register a client. A confidential client's `client_secret` is in this response only — it is
4266
+ * stored hashed and cannot be retrieved again, so hand it to the client's owner immediately.
4267
+ */
4268
+ registerOAuthClient(input: RegisterOAuthClientInput, options?: RequestOptions): Promise<RegisteredOAuthClient>;
4269
+ /** Stop a client authorising. Clients are deactivated, never deleted, so their history stays auditable. */
4270
+ deactivateOAuthClient(clientId: string, options?: RequestOptions): Promise<{
4271
+ ok: true;
4272
+ is_active: false;
4273
+ }>;
4274
+ /** Replace a client's whole redirect-URI allow-list. URIs match exactly: no wildcards or prefixes. */
4275
+ setOAuthClientRedirectUris(clientId: string, redirectUris: string[], options?: RequestOptions): Promise<{
4276
+ ok: true;
4277
+ redirect_uris: string[];
4278
+ }>;
4279
+ /** Replace the set of scopes a client may request. */
4280
+ setOAuthClientScopes(clientId: string, scopes: string[], options?: RequestOptions): Promise<{
4281
+ ok: true;
4282
+ scopes: string[];
4283
+ }>;
4284
+ /** The signing-key window — current, previous, retired — as metadata only. */
4285
+ listOidcSigningKeys(options?: RequestOptions): Promise<{
4286
+ keys: OidcSigningKey[];
4287
+ }>;
4288
+ /**
4289
+ * Run the rotation ceremony: a new key becomes current, the current key becomes previous (still
4290
+ * verifying), and the old previous is retired. Do not rotate twice within an id_token lifetime
4291
+ * (one hour), or tokens signed by the retired key stop verifying.
4292
+ */
4293
+ rotateOidcSigningKey(options?: RequestOptions): Promise<{
4294
+ ok: true;
4295
+ kid: string;
4296
+ }>;
4204
4297
  listPayoutsAwaitingApproval(options?: RequestOptions): Promise<{
4205
4298
  payouts: PendingPayoutApproval[];
4206
4299
  }>;
@@ -4679,4 +4772,4 @@ declare class MitumbaClient {
4679
4772
  isAuthenticated(): Promise<boolean>;
4680
4773
  }
4681
4774
 
4682
- export { APIClient, APIError, type APIErrorResponse, type ActivateIamUserInput, type ActivateIamUserResult, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddIamPasskeyResult, type AddIamTotpResult, type AddIamTwoFactorMethodInput, type AddPaymentMethodInput, type Address, type AdminAuditActor, type AdminAuditEntry, type AdminAuditQuery, type AdminAuthStrength, type AdminListingItem, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminReport, type AdminRolePreset, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, type AdminWholesalePendingStore, type ApiResponse, type AttachmentDownloadAuthorization, type AttachmentUploadAuthorization, type AttachmentUploadBody, type AttachmentUploadState, type AttachmentUploadStatus, type AuthCapabilities, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleImageUploadResult, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, type BuyerResolveThreadInput, type BuyerSummary, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutStatus, type CheckoutStatusResponse, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateIamUserInput, type CreateIamUserResult, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateOrganizationInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, type CursorPage, DEFAULT_SHARE_ORIGIN, 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 FinishIamPasskeyEnrollmentInput, type FinishIamPasskeyLoginInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type IamActivation, type IamLoginInput, type IamLoginMethod, type IamMethodsResult, IamModule, type IamPasskeyLoginOptions, type IamProfile, type IamTokens, type IamTwoFactorRequired, type IamUser, type IamUserStatus, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type Jwk, type Jwks, type KnownPaymentProvider, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListIamUsersResult, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, type Market, type MarketCurrency, type MarketPhone, type MarketRegion, type MarketRegionsResponse, type MarketStatus, MarketsModule, type MarketsResponse, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportReason, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingBlockInput, type MessagingBlockRemovedResult, type MessagingBlockResult, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthConsent, type OAuthConsentInput, type OAuthConsentRequired, type OAuthConsentRevokeResult, OAuthModule, type OAuthTokenExchangeInput, type OAuthTokenResult, ORDER_STATUSES, type OpenIdConfiguration, type OperatorPermissionGrant, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, type Organization, type OrganizationKind, type OrganizationStatus, type OrganizationSummary, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegenerateIamBackupCodesResult, type RegisterInput, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveThreadResult, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type RootSetupInput, type RootSetupResult, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type ShareUrlOptions, type SilentAuthorizeResult, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreReviewsPage, type StoreSettings, type StoreStats, type StoreSummary, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type ThreadCard, type ThreadId, type ThreadMessage, type ThreadSubject, type ThreadSystemEvent, type ThreadTimelineItem, type ThreadTimelineItemId, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateConversationPreferencesInput, type UpdateListingInput, type UpdateOrganizationInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserInfo, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyIamMethodResult, type VerifyIamTwoFactorInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleAnalytics, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleReviewStatus, type WholesaleStore, type WishlistListing, WishlistsModule, activeMarkets, baleShareUrl, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isConsentRequired, isMessagingAPIError, isValidPhone, listingShareUrl, maskPhone, normalizePhone, regionById, storeShareUrl };
4775
+ export { APIClient, APIError, type APIErrorResponse, type ActivateIamUserInput, type ActivateIamUserResult, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddIamPasskeyResult, type AddIamTotpResult, type AddIamTwoFactorMethodInput, type AddPaymentMethodInput, type Address, type AdminAuditActor, type AdminAuditEntry, type AdminAuditQuery, type AdminAuthStrength, type AdminListingItem, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminReport, type AdminRolePreset, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, type AdminWholesalePendingStore, type ApiResponse, type AttachmentDownloadAuthorization, type AttachmentUploadAuthorization, type AttachmentUploadBody, type AttachmentUploadState, type AttachmentUploadStatus, type AuthCapabilities, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleImageUploadResult, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, type BuyerResolveThreadInput, type BuyerSummary, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutStatus, type CheckoutStatusResponse, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateIamUserInput, type CreateIamUserResult, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateOrganizationInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, type CursorPage, DEFAULT_SHARE_ORIGIN, 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 FinishIamPasskeyEnrollmentInput, type FinishIamPasskeyLoginInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type IamActivation, type IamLoginInput, type IamLoginMethod, type IamMethodsResult, IamModule, type IamPasskeyLoginOptions, type IamProfile, type IamTokens, type IamTwoFactorRequired, type IamUser, type IamUserStatus, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type Jwk, type Jwks, type KnownPaymentProvider, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListIamUsersResult, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, type Market, type MarketCurrency, type MarketPhone, type MarketRegion, type MarketRegionsResponse, type MarketStatus, MarketsModule, type MarketsResponse, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportReason, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingBlockInput, type MessagingBlockRemovedResult, type MessagingBlockResult, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthClient, type OAuthClientSummary, type OAuthClientTrustLevel, type OAuthClientType, type OAuthConsent, type OAuthConsentInput, type OAuthConsentRequired, type OAuthConsentRevokeResult, OAuthModule, type OAuthTokenExchangeInput, type OAuthTokenResult, ORDER_STATUSES, type OidcSigningKey, type OpenIdConfiguration, type OperatorPermissionGrant, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, type Organization, type OrganizationKind, type OrganizationStatus, type OrganizationSummary, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegenerateIamBackupCodesResult, type RegisterInput, type RegisterOAuthClientInput, type RegisteredOAuthClient, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveThreadResult, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type RootSetupInput, type RootSetupResult, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type ShareUrlOptions, type SilentAuthorizeResult, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreReviewsPage, type StoreSettings, type StoreStats, type StoreSummary, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type ThreadCard, type ThreadId, type ThreadMessage, type ThreadSubject, type ThreadSystemEvent, type ThreadTimelineItem, type ThreadTimelineItemId, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateConversationPreferencesInput, type UpdateListingInput, type UpdateOrganizationInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserInfo, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyIamMethodResult, type VerifyIamTwoFactorInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleAnalytics, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleReviewStatus, type WholesaleStore, type WishlistListing, WishlistsModule, activeMarkets, baleShareUrl, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isConsentRequired, isMessagingAPIError, isValidPhone, listingShareUrl, maskPhone, normalizePhone, regionById, storeShareUrl };
package/dist/index.d.ts CHANGED
@@ -1018,7 +1018,7 @@ interface CreateReportInput {
1018
1018
  reason: 'counterfeit' | 'offensive' | 'spam' | 'scam' | 'other';
1019
1019
  detail?: string;
1020
1020
  }
1021
- type AdminPermission = 'admin:read' | 'users:moderate' | 'ip:block' | 'listings:moderate' | 'orders:transition' | 'payouts:disburse' | 'sellers:verify' | 'recovery:review' | 'broadcast:send' | 'roles:grant' | 'audit:read';
1021
+ type AdminPermission = 'admin:read' | 'users:moderate' | 'ip:block' | 'listings:moderate' | 'orders:transition' | 'payouts:disburse' | 'sellers:verify' | 'recovery:review' | 'broadcast:send' | 'clients:manage' | 'oidc:rotate_keys' | 'roles:grant' | 'audit:read';
1022
1022
  type AdminAuthStrength = 'password' | 'sms' | 'email' | 'totp' | 'passkey';
1023
1023
  interface AdminRolePreset {
1024
1024
  id: string;
@@ -1113,6 +1113,50 @@ interface AdminWholesalePendingStore {
1113
1113
  review_note?: string | null;
1114
1114
  [key: string]: unknown;
1115
1115
  }
1116
+ /** `public` clients (browser SPAs, mobile) use PKCE and have no secret; `confidential` clients have a server-side secret. */
1117
+ type OAuthClientType = 'public' | 'confidential';
1118
+ /** `first_party_implicit` skips the consent screen; `first_party_consent` shows it. */
1119
+ type OAuthClientTrustLevel = 'first_party_implicit' | 'first_party_consent';
1120
+ /** A registered sign-in (relying-party) client as listed by `admin.listOAuthClients()`. Never carries a secret. */
1121
+ interface OAuthClientSummary {
1122
+ client_id: string;
1123
+ name: string;
1124
+ client_type: OAuthClientType;
1125
+ trust_level: OAuthClientTrustLevel;
1126
+ is_active: boolean;
1127
+ created_at: string;
1128
+ updated_at: string;
1129
+ }
1130
+ /** A client with its exact-match redirect-URI allow-list and permitted scopes. */
1131
+ interface OAuthClient extends OAuthClientSummary {
1132
+ redirect_uris: string[];
1133
+ scopes: string[];
1134
+ }
1135
+ interface RegisterOAuthClientInput {
1136
+ name: string;
1137
+ client_type: OAuthClientType;
1138
+ trust_level: OAuthClientTrustLevel;
1139
+ /** Exact-match allow-list. Can be set later with `setOAuthClientRedirectUris()`. */
1140
+ redirect_uris?: string[];
1141
+ /** Scopes the client may request. Can be set later with `setOAuthClientScopes()`. */
1142
+ scopes?: string[];
1143
+ }
1144
+ /**
1145
+ * A newly registered client. `client_secret` is present only for a confidential client and is
1146
+ * returned exactly once — it is stored hashed and can never be read back.
1147
+ */
1148
+ interface RegisteredOAuthClient extends OAuthClient {
1149
+ client_secret?: string;
1150
+ }
1151
+ /** One OIDC signing key's metadata. Key material is never exposed. */
1152
+ interface OidcSigningKey {
1153
+ kid: string;
1154
+ alg: string;
1155
+ /** `current` signs; `previous` still verifies (published in JWKS); `retired` is neither. */
1156
+ status: 'current' | 'previous' | 'retired';
1157
+ created_at: string;
1158
+ rotated_at: string | null;
1159
+ }
1116
1160
 
1117
1161
  interface AuthTokens {
1118
1162
  access_token: string;
@@ -1413,6 +1457,12 @@ interface OAuthAuthorizeInput {
1413
1457
  state: string;
1414
1458
  /** The PKCE code challenge (base64url SHA-256 of the verifier). */
1415
1459
  code_challenge: string;
1460
+ /**
1461
+ * The OpenID Connect `nonce` from the relying party's authentication request. Carried to the
1462
+ * one-time code and echoed in the id_token's `nonce` claim, so the relying party can bind the
1463
+ * id_token to its own request and reject a replayed one. Pass it whenever the relying party sent it.
1464
+ */
1465
+ nonce?: string;
1416
1466
  }
1417
1467
  /**
1418
1468
  * Result of the authorize (mint) step: a one-time authorization code plus the echoed state.
@@ -2970,9 +3020,13 @@ declare class AuthModule {
2970
3020
  */
2971
3021
  sendOtp(input: SendOtpInput, options?: RequestOptions): Promise<MessageResponse>;
2972
3022
  /**
2973
- * Verify an OTP code. Tokens are auto-persisted.
3023
+ * Verify a phone OTP code.
3024
+ *
3025
+ * Returns the session tokens (auto-persisted) for an account without a second factor. An account
3026
+ * with 2FA gets a `TwoFactorRequired` challenge instead, exactly like `login()`: complete it with
3027
+ * `verify2FA()` or the passkey ceremony. Narrow with `'requires_2fa' in result`.
2974
3028
  */
2975
- verifyOtp(input: VerifyOtpInput, options?: RequestOptions): Promise<AuthTokens>;
3029
+ verifyOtp(input: VerifyOtpInput, options?: RequestOptions): Promise<AuthTokens | TwoFactorRequired>;
2976
3030
  /**
2977
3031
  * Refresh the access token using a refresh token.
2978
3032
  */
@@ -4201,6 +4255,45 @@ declare class AdminModule {
4201
4255
  entries: AdminAuditEntry[];
4202
4256
  next_cursor: string | null;
4203
4257
  }>;
4258
+ /** Every registered sign-in client, oldest first. Secrets are never included. */
4259
+ listOAuthClients(options?: RequestOptions): Promise<{
4260
+ clients: OAuthClientSummary[];
4261
+ }>;
4262
+ /** One client with its redirect-URI allow-list and permitted scopes. */
4263
+ getOAuthClient(clientId: string, options?: RequestOptions): Promise<OAuthClient>;
4264
+ /**
4265
+ * Register a client. A confidential client's `client_secret` is in this response only — it is
4266
+ * stored hashed and cannot be retrieved again, so hand it to the client's owner immediately.
4267
+ */
4268
+ registerOAuthClient(input: RegisterOAuthClientInput, options?: RequestOptions): Promise<RegisteredOAuthClient>;
4269
+ /** Stop a client authorising. Clients are deactivated, never deleted, so their history stays auditable. */
4270
+ deactivateOAuthClient(clientId: string, options?: RequestOptions): Promise<{
4271
+ ok: true;
4272
+ is_active: false;
4273
+ }>;
4274
+ /** Replace a client's whole redirect-URI allow-list. URIs match exactly: no wildcards or prefixes. */
4275
+ setOAuthClientRedirectUris(clientId: string, redirectUris: string[], options?: RequestOptions): Promise<{
4276
+ ok: true;
4277
+ redirect_uris: string[];
4278
+ }>;
4279
+ /** Replace the set of scopes a client may request. */
4280
+ setOAuthClientScopes(clientId: string, scopes: string[], options?: RequestOptions): Promise<{
4281
+ ok: true;
4282
+ scopes: string[];
4283
+ }>;
4284
+ /** The signing-key window — current, previous, retired — as metadata only. */
4285
+ listOidcSigningKeys(options?: RequestOptions): Promise<{
4286
+ keys: OidcSigningKey[];
4287
+ }>;
4288
+ /**
4289
+ * Run the rotation ceremony: a new key becomes current, the current key becomes previous (still
4290
+ * verifying), and the old previous is retired. Do not rotate twice within an id_token lifetime
4291
+ * (one hour), or tokens signed by the retired key stop verifying.
4292
+ */
4293
+ rotateOidcSigningKey(options?: RequestOptions): Promise<{
4294
+ ok: true;
4295
+ kid: string;
4296
+ }>;
4204
4297
  listPayoutsAwaitingApproval(options?: RequestOptions): Promise<{
4205
4298
  payouts: PendingPayoutApproval[];
4206
4299
  }>;
@@ -4679,4 +4772,4 @@ declare class MitumbaClient {
4679
4772
  isAuthenticated(): Promise<boolean>;
4680
4773
  }
4681
4774
 
4682
- export { APIClient, APIError, type APIErrorResponse, type ActivateIamUserInput, type ActivateIamUserResult, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddIamPasskeyResult, type AddIamTotpResult, type AddIamTwoFactorMethodInput, type AddPaymentMethodInput, type Address, type AdminAuditActor, type AdminAuditEntry, type AdminAuditQuery, type AdminAuthStrength, type AdminListingItem, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminReport, type AdminRolePreset, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, type AdminWholesalePendingStore, type ApiResponse, type AttachmentDownloadAuthorization, type AttachmentUploadAuthorization, type AttachmentUploadBody, type AttachmentUploadState, type AttachmentUploadStatus, type AuthCapabilities, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleImageUploadResult, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, type BuyerResolveThreadInput, type BuyerSummary, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutStatus, type CheckoutStatusResponse, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateIamUserInput, type CreateIamUserResult, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateOrganizationInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, type CursorPage, DEFAULT_SHARE_ORIGIN, 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 FinishIamPasskeyEnrollmentInput, type FinishIamPasskeyLoginInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type IamActivation, type IamLoginInput, type IamLoginMethod, type IamMethodsResult, IamModule, type IamPasskeyLoginOptions, type IamProfile, type IamTokens, type IamTwoFactorRequired, type IamUser, type IamUserStatus, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type Jwk, type Jwks, type KnownPaymentProvider, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListIamUsersResult, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, type Market, type MarketCurrency, type MarketPhone, type MarketRegion, type MarketRegionsResponse, type MarketStatus, MarketsModule, type MarketsResponse, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportReason, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingBlockInput, type MessagingBlockRemovedResult, type MessagingBlockResult, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthConsent, type OAuthConsentInput, type OAuthConsentRequired, type OAuthConsentRevokeResult, OAuthModule, type OAuthTokenExchangeInput, type OAuthTokenResult, ORDER_STATUSES, type OpenIdConfiguration, type OperatorPermissionGrant, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, type Organization, type OrganizationKind, type OrganizationStatus, type OrganizationSummary, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegenerateIamBackupCodesResult, type RegisterInput, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveThreadResult, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type RootSetupInput, type RootSetupResult, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type ShareUrlOptions, type SilentAuthorizeResult, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreReviewsPage, type StoreSettings, type StoreStats, type StoreSummary, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type ThreadCard, type ThreadId, type ThreadMessage, type ThreadSubject, type ThreadSystemEvent, type ThreadTimelineItem, type ThreadTimelineItemId, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateConversationPreferencesInput, type UpdateListingInput, type UpdateOrganizationInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserInfo, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyIamMethodResult, type VerifyIamTwoFactorInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleAnalytics, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleReviewStatus, type WholesaleStore, type WishlistListing, WishlistsModule, activeMarkets, baleShareUrl, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isConsentRequired, isMessagingAPIError, isValidPhone, listingShareUrl, maskPhone, normalizePhone, regionById, storeShareUrl };
4775
+ export { APIClient, APIError, type APIErrorResponse, type ActivateIamUserInput, type ActivateIamUserResult, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddIamPasskeyResult, type AddIamTotpResult, type AddIamTwoFactorMethodInput, type AddPaymentMethodInput, type Address, type AdminAuditActor, type AdminAuditEntry, type AdminAuditQuery, type AdminAuthStrength, type AdminListingItem, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminReport, type AdminRolePreset, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, type AdminWholesalePendingStore, type ApiResponse, type AttachmentDownloadAuthorization, type AttachmentUploadAuthorization, type AttachmentUploadBody, type AttachmentUploadState, type AttachmentUploadStatus, type AuthCapabilities, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleImageUploadResult, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, type BuyerResolveThreadInput, type BuyerSummary, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutStatus, type CheckoutStatusResponse, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateIamUserInput, type CreateIamUserResult, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateOrganizationInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, type CursorPage, DEFAULT_SHARE_ORIGIN, 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 FinishIamPasskeyEnrollmentInput, type FinishIamPasskeyLoginInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type IamActivation, type IamLoginInput, type IamLoginMethod, type IamMethodsResult, IamModule, type IamPasskeyLoginOptions, type IamProfile, type IamTokens, type IamTwoFactorRequired, type IamUser, type IamUserStatus, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type Jwk, type Jwks, type KnownPaymentProvider, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListIamUsersResult, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, type Market, type MarketCurrency, type MarketPhone, type MarketRegion, type MarketRegionsResponse, type MarketStatus, MarketsModule, type MarketsResponse, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportReason, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingBlockInput, type MessagingBlockRemovedResult, type MessagingBlockResult, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthClient, type OAuthClientSummary, type OAuthClientTrustLevel, type OAuthClientType, type OAuthConsent, type OAuthConsentInput, type OAuthConsentRequired, type OAuthConsentRevokeResult, OAuthModule, type OAuthTokenExchangeInput, type OAuthTokenResult, ORDER_STATUSES, type OidcSigningKey, type OpenIdConfiguration, type OperatorPermissionGrant, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, type Organization, type OrganizationKind, type OrganizationStatus, type OrganizationSummary, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegenerateIamBackupCodesResult, type RegisterInput, type RegisterOAuthClientInput, type RegisteredOAuthClient, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveThreadResult, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type RootSetupInput, type RootSetupResult, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type ShareUrlOptions, type SilentAuthorizeResult, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreReviewsPage, type StoreSettings, type StoreStats, type StoreSummary, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type ThreadCard, type ThreadId, type ThreadMessage, type ThreadSubject, type ThreadSystemEvent, type ThreadTimelineItem, type ThreadTimelineItemId, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateConversationPreferencesInput, type UpdateListingInput, type UpdateOrganizationInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserInfo, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyIamMethodResult, type VerifyIamTwoFactorInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleAnalytics, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleReviewStatus, type WholesaleStore, type WishlistListing, WishlistsModule, activeMarkets, baleShareUrl, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isConsentRequired, isMessagingAPIError, isValidPhone, listingShareUrl, maskPhone, normalizePhone, regionById, storeShareUrl };
package/dist/index.js CHANGED
@@ -447,7 +447,6 @@ var AuthModule = class {
447
447
  constructor(client) {
448
448
  this.client = client;
449
449
  }
450
- client;
451
450
  /**
452
451
  * Register a new account.
453
452
  * If using EmailRegisterInput, returns AuthTokens (auto-persisted).
@@ -479,11 +478,15 @@ var AuthModule = class {
479
478
  return this.client.post("/auth/otp/send", input, options);
480
479
  }
481
480
  /**
482
- * Verify an OTP code. Tokens are auto-persisted.
481
+ * Verify a phone OTP code.
482
+ *
483
+ * Returns the session tokens (auto-persisted) for an account without a second factor. An account
484
+ * with 2FA gets a `TwoFactorRequired` challenge instead, exactly like `login()`: complete it with
485
+ * `verify2FA()` or the passkey ceremony. Narrow with `'requires_2fa' in result`.
483
486
  */
484
487
  async verifyOtp(input, options) {
485
488
  const result = await this.client.post("/auth/otp/verify", input, options);
486
- await this.client.setSession(result);
489
+ if (isAuthTokens(result)) await this.client.setSession(result);
487
490
  return result;
488
491
  }
489
492
  /**
@@ -701,7 +704,6 @@ var OAuthModule = class {
701
704
  constructor(client) {
702
705
  this.client = client;
703
706
  }
704
- client;
705
707
  /**
706
708
  * Mint a one-time authorization code for the relying party.
707
709
  *
@@ -910,7 +912,6 @@ var ListingsModule = class {
910
912
  constructor(client) {
911
913
  this.client = client;
912
914
  }
913
- client;
914
915
  /**
915
916
  * Browse the marketplace feed with optional filters.
916
917
  */
@@ -1055,7 +1056,6 @@ var SearchModule = class {
1055
1056
  constructor(client) {
1056
1057
  this.client = client;
1057
1058
  }
1058
- client;
1059
1059
  /**
1060
1060
  * Perform a full-text search with optional filters.
1061
1061
  */
@@ -1095,7 +1095,6 @@ var OrdersModule = class {
1095
1095
  constructor(client) {
1096
1096
  this.client = client;
1097
1097
  }
1098
- client;
1099
1098
  /**
1100
1099
  * Create a new order from a listing.
1101
1100
  */
@@ -1131,7 +1130,6 @@ var PayModule = class {
1131
1130
  constructor(client) {
1132
1131
  this.client = client;
1133
1132
  }
1134
- client;
1135
1133
  /**
1136
1134
  * Initiate an M-Pesa STK Push payment for an order.
1137
1135
  */
@@ -1187,7 +1185,6 @@ var VaziModule = class {
1187
1185
  constructor(client) {
1188
1186
  this.client = client;
1189
1187
  }
1190
- client;
1191
1188
  /**
1192
1189
  * Browse the AI-curated outfit feed.
1193
1190
  */
@@ -1316,8 +1313,6 @@ var ManagedMessagesRealtimeConnection = class {
1316
1313
  this.options = options;
1317
1314
  this.currentCursor = options.resumeCursor ?? null;
1318
1315
  }
1319
- client;
1320
- options;
1321
1316
  currentState = "closed";
1322
1317
  currentCursor;
1323
1318
  socket = null;
@@ -1651,7 +1646,6 @@ var MessagesModule = class {
1651
1646
  constructor(client) {
1652
1647
  this.client = client;
1653
1648
  }
1654
- client;
1655
1649
  /**
1656
1650
  * Create a bilateral block from a v2 inbox perspective. A buyer blocks a store (`{ store_id }`);
1657
1651
  * a store blocks a buyer (`{ buyer_id }`). Idempotent.
@@ -1837,7 +1831,6 @@ var NotificationsModule = class {
1837
1831
  constructor(client) {
1838
1832
  this.client = client;
1839
1833
  }
1840
- client;
1841
1834
  /**
1842
1835
  * List paginated notifications with unread count.
1843
1836
  */
@@ -1861,7 +1854,6 @@ var StoresModule = class {
1861
1854
  constructor(client) {
1862
1855
  this.client = client;
1863
1856
  }
1864
- client;
1865
1857
  /**
1866
1858
  * Get a store by its URL slug.
1867
1859
  */
@@ -1975,7 +1967,6 @@ var ReviewsModule = class {
1975
1967
  constructor(client) {
1976
1968
  this.client = client;
1977
1969
  }
1978
- client;
1979
1970
  /**
1980
1971
  * List reviews for a store (public).
1981
1972
  */
@@ -2009,7 +2000,6 @@ var WishlistsModule = class {
2009
2000
  constructor(client) {
2010
2001
  this.client = client;
2011
2002
  }
2012
- client;
2013
2003
  /**
2014
2004
  * List saved listings.
2015
2005
  */
@@ -2035,7 +2025,6 @@ var CartModule = class {
2035
2025
  constructor(client) {
2036
2026
  this.client = client;
2037
2027
  }
2038
- client;
2039
2028
  /**
2040
2029
  * List items in the cart.
2041
2030
  */
@@ -2073,7 +2062,6 @@ var SettingsModule = class {
2073
2062
  constructor(client) {
2074
2063
  this.client = client;
2075
2064
  }
2076
- client;
2077
2065
  // ── Profile ──
2078
2066
  async getProfile(options) {
2079
2067
  return this.client.get("/auth/me", void 0, options);
@@ -2206,7 +2194,6 @@ var MailerModule = class {
2206
2194
  constructor(client) {
2207
2195
  this.client = client;
2208
2196
  }
2209
- client;
2210
2197
  /**
2211
2198
  * Send a transactional email via the notifications worker.
2212
2199
  */
@@ -2220,7 +2207,6 @@ var BusinessesModule = class {
2220
2207
  constructor(client) {
2221
2208
  this.client = client;
2222
2209
  }
2223
- client;
2224
2210
  /** Get all businesses owned by the current user. */
2225
2211
  async getMine(options) {
2226
2212
  return this.client.get("/listings/businesses/mine", void 0, options);
@@ -2240,7 +2226,6 @@ var AdminModule = class {
2240
2226
  constructor(client) {
2241
2227
  this.client = client;
2242
2228
  }
2243
- client;
2244
2229
  async blockIp(ip, reasonOrDuration = 24, durationOrOptions, maybeOptions) {
2245
2230
  const modern = typeof reasonOrDuration === "string";
2246
2231
  const reason = modern ? reasonOrDuration : "No reason supplied by legacy SDK caller";
@@ -2398,6 +2383,47 @@ var AdminModule = class {
2398
2383
  async listAuditLog(query2 = {}, options) {
2399
2384
  return this.client.get("/admin/audit", query2, options);
2400
2385
  }
2386
+ // ── Identity provider: sign-in clients (requires clients:manage) ──
2387
+ /** Every registered sign-in client, oldest first. Secrets are never included. */
2388
+ async listOAuthClients(options) {
2389
+ return this.client.get("/admin/clients", void 0, options);
2390
+ }
2391
+ /** One client with its redirect-URI allow-list and permitted scopes. */
2392
+ async getOAuthClient(clientId, options) {
2393
+ return this.client.get(`/admin/clients/${encodeURIComponent(clientId)}`, void 0, options);
2394
+ }
2395
+ /**
2396
+ * Register a client. A confidential client's `client_secret` is in this response only — it is
2397
+ * stored hashed and cannot be retrieved again, so hand it to the client's owner immediately.
2398
+ */
2399
+ async registerOAuthClient(input, options) {
2400
+ return this.client.post("/admin/clients", input, options);
2401
+ }
2402
+ /** Stop a client authorising. Clients are deactivated, never deleted, so their history stays auditable. */
2403
+ async deactivateOAuthClient(clientId, options) {
2404
+ return this.client.post(`/admin/clients/${encodeURIComponent(clientId)}/deactivate`, void 0, options);
2405
+ }
2406
+ /** Replace a client's whole redirect-URI allow-list. URIs match exactly: no wildcards or prefixes. */
2407
+ async setOAuthClientRedirectUris(clientId, redirectUris, options) {
2408
+ return this.client.put(`/admin/clients/${encodeURIComponent(clientId)}/redirect-uris`, { redirect_uris: redirectUris }, options);
2409
+ }
2410
+ /** Replace the set of scopes a client may request. */
2411
+ async setOAuthClientScopes(clientId, scopes, options) {
2412
+ return this.client.put(`/admin/clients/${encodeURIComponent(clientId)}/scopes`, { scopes }, options);
2413
+ }
2414
+ // ── Identity provider: signing keys (requires oidc:rotate_keys) ──
2415
+ /** The signing-key window — current, previous, retired — as metadata only. */
2416
+ async listOidcSigningKeys(options) {
2417
+ return this.client.get("/auth/oidc/keys", void 0, options);
2418
+ }
2419
+ /**
2420
+ * Run the rotation ceremony: a new key becomes current, the current key becomes previous (still
2421
+ * verifying), and the old previous is retired. Do not rotate twice within an id_token lifetime
2422
+ * (one hour), or tokens signed by the retired key stop verifying.
2423
+ */
2424
+ async rotateOidcSigningKey(options) {
2425
+ return this.client.post("/auth/oidc/keys/rotate", void 0, options);
2426
+ }
2401
2427
  // ── Payout approval ──
2402
2428
  async listPayoutsAwaitingApproval(options) {
2403
2429
  return this.client.get("/admin/payouts/pending-approval", void 0, options);
@@ -2444,7 +2470,6 @@ var DisputesModule = class {
2444
2470
  constructor(client) {
2445
2471
  this.client = client;
2446
2472
  }
2447
- client;
2448
2473
  /** Raise a dispute on an order (buyer). */
2449
2474
  async raise(orderId, input, options) {
2450
2475
  return this.client.post(`/orders/${orderId}/dispute`, input, options);
@@ -2492,7 +2517,6 @@ var UploadsModule = class {
2492
2517
  constructor(client) {
2493
2518
  this.client = client;
2494
2519
  }
2495
- client;
2496
2520
  /** Upload a file (avatar, evidence, etc). Returns the public CDN URL. */
2497
2521
  async upload(file, options) {
2498
2522
  const formData = new FormData();
@@ -2506,7 +2530,6 @@ var ReportsModule = class {
2506
2530
  constructor(client) {
2507
2531
  this.client = client;
2508
2532
  }
2509
- client;
2510
2533
  /** Report a listing, review, store, or user for admin review. */
2511
2534
  async create(input, options) {
2512
2535
  return this.client.post("/listings/reports", input, options);
@@ -2518,7 +2541,6 @@ var WholesaleModule = class {
2518
2541
  constructor(client) {
2519
2542
  this.client = client;
2520
2543
  }
2521
- client;
2522
2544
  // ── Wholesale Store ──
2523
2545
  /** Get the current user's wholesale store and depots. */
2524
2546
  async getWholesaleStore(options) {
@@ -2654,7 +2676,6 @@ var IamModule = class {
2654
2676
  constructor(client) {
2655
2677
  this.client = client;
2656
2678
  }
2657
- client;
2658
2679
  /** Start IAM sign-in with an organization ID or alias, email and password. */
2659
2680
  async login(input, options) {
2660
2681
  const result = await this.client.post("/auth/iam/login", input, options);
@@ -2791,7 +2812,6 @@ var MarketsModule = class {
2791
2812
  constructor(client) {
2792
2813
  this.client = client;
2793
2814
  }
2794
- client;
2795
2815
  /**
2796
2816
  * List the platform's markets: the countries Mitumba operates in or plans to, with each
2797
2817
  * market's currency, locale, phone rules, region naming and payment rails.