@mitumba/sdk 5.32.0 → 5.33.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.ts CHANGED
@@ -3156,6 +3156,165 @@ type AddPayoutDestinationInput = {
3156
3156
  /** Why a destination was refused on entry, with the field to fix. */
3157
3157
  type PayoutDestinationRejection = 'invalid_phone' | 'invalid_till' | 'invalid_paybill' | 'invalid_account' | 'unknown_bank' | 'method_not_offered';
3158
3158
 
3159
+ /** A permission a member holds in a shop. */
3160
+ type StorePermission = 'store:listings.read' | 'store:listings.manage' | 'store:orders.read' | 'store:orders.fulfil' | 'store:orders.cancel' | 'store:messages.reply' | 'store:reviews.reply' | 'store:earnings.read' | 'store:payouts.manage' | 'store:settings.manage' | 'store:members.manage' | 'store:analytics.read' | 'store:store.close' | 'store:audit.read';
3161
+ /** A member's role in a shop. Each role grants a fixed set of permissions. */
3162
+ type StoreRole = 'owner' | 'manager' | 'fulfilment' | 'stock' | 'support' | 'finance';
3163
+ /** The roles an invitation can offer. */
3164
+ type InvitableStoreRole = Exclude<StoreRole, 'owner'>;
3165
+ /** A shop the caller works in, from `getMyStores`, with the caller's role in it. */
3166
+ interface StoreMembershipFields {
3167
+ my_role: StoreRole;
3168
+ my_permissions: StorePermission[];
3169
+ is_owner: boolean;
3170
+ listing_count: number;
3171
+ }
3172
+ interface StoreMember {
3173
+ id: string;
3174
+ name: string;
3175
+ role: StoreRole;
3176
+ joined_at: string;
3177
+ /** The caller's own row. */
3178
+ is_you: boolean;
3179
+ /** Whether the caller may change this member's role or remove them. */
3180
+ can_manage: boolean;
3181
+ }
3182
+ interface StoreMembers {
3183
+ data: StoreMember[];
3184
+ /** The roles the caller may give, for the invite and change-role forms. */
3185
+ assignable_roles: InvitableStoreRole[];
3186
+ }
3187
+ /** An open invitation, as the shop sees it. `address` is masked. */
3188
+ interface StoreInvitation {
3189
+ id: string;
3190
+ address: string;
3191
+ role: InvitableStoreRole;
3192
+ expires_at: string;
3193
+ created_at: string;
3194
+ }
3195
+ interface StoreInvitationListItem extends StoreInvitation {
3196
+ invited_by: string;
3197
+ can_revoke: boolean;
3198
+ }
3199
+ interface InviteToStoreInput {
3200
+ /** An email address or a Kenyan phone number. */
3201
+ address: string;
3202
+ role: InvitableStoreRole;
3203
+ }
3204
+ /** The answer to an invitation. The same whether or not an account uses the address. */
3205
+ interface InviteToStoreResult {
3206
+ message: string;
3207
+ invitation: StoreInvitation;
3208
+ }
3209
+ /** An invitation the caller received. */
3210
+ interface ReceivedStoreInvitation {
3211
+ id: string;
3212
+ role: InvitableStoreRole;
3213
+ permissions: StorePermission[];
3214
+ expires_at: string;
3215
+ created_at: string;
3216
+ invited_by: string;
3217
+ shop: {
3218
+ id: string;
3219
+ name: string;
3220
+ slug: string;
3221
+ logo_url: string | null;
3222
+ };
3223
+ }
3224
+ interface AcceptStoreInvitationResult {
3225
+ ok: true;
3226
+ store_id: string;
3227
+ role: InvitableStoreRole;
3228
+ permissions: StorePermission[];
3229
+ }
3230
+ interface StoreAuditEntry {
3231
+ id: string;
3232
+ actor_id: string;
3233
+ action: string;
3234
+ target_type: string | null;
3235
+ target_id: string | null;
3236
+ summary: string;
3237
+ created_at: string;
3238
+ actor: {
3239
+ id: string;
3240
+ name: string;
3241
+ is_you: boolean;
3242
+ };
3243
+ }
3244
+ interface StoreAuditPage {
3245
+ data: StoreAuditEntry[];
3246
+ page: number;
3247
+ has_more: boolean;
3248
+ }
3249
+ type StoreLimitRequestStatus = 'pending' | 'approved' | 'rejected';
3250
+ interface StoreLimitRequest {
3251
+ id: string;
3252
+ status: StoreLimitRequestStatus;
3253
+ requested_limit: number;
3254
+ approved_limit: number | null;
3255
+ reason: string;
3256
+ decision_note: string | null;
3257
+ created_at: string;
3258
+ decided_at: string | null;
3259
+ }
3260
+ /** The caller's shop limit, how many shops they own, and their latest request. */
3261
+ interface StoreLimitState {
3262
+ limit: number;
3263
+ open_shops: number;
3264
+ at_limit: boolean;
3265
+ request: StoreLimitRequest | null;
3266
+ }
3267
+ interface RequestStoreLimitInput {
3268
+ requested_limit: number;
3269
+ /** At least 30 characters. */
3270
+ reason: string;
3271
+ }
3272
+ /** A shop limit request in the operators' queue. */
3273
+ interface AdminShopLimitRequest {
3274
+ id: string;
3275
+ user_id: string;
3276
+ current_limit: number;
3277
+ requested_limit: number;
3278
+ reason: string;
3279
+ status: StoreLimitRequestStatus;
3280
+ approved_limit: number | null;
3281
+ decision_note: string | null;
3282
+ decided_by: string | null;
3283
+ created_at: string;
3284
+ decided_at: string | null;
3285
+ account: {
3286
+ id: string;
3287
+ name: string;
3288
+ email: string | null;
3289
+ sti_score: number | null;
3290
+ completed_orders: number;
3291
+ };
3292
+ shops: Array<{
3293
+ id: string;
3294
+ name: string;
3295
+ slug: string;
3296
+ created_at: string;
3297
+ }>;
3298
+ }
3299
+ interface AdminShopLimitRequestsPage {
3300
+ data: AdminShopLimitRequest[];
3301
+ page: number;
3302
+ has_more: boolean;
3303
+ }
3304
+ type DecideShopLimitInput = {
3305
+ decision: 'approve';
3306
+ approved_limit: number;
3307
+ note?: string;
3308
+ } | {
3309
+ decision: 'reject';
3310
+ note: string;
3311
+ };
3312
+ interface DecideShopLimitResult {
3313
+ ok: true;
3314
+ status: 'approved' | 'rejected';
3315
+ approved_limit?: number;
3316
+ }
3317
+
3159
3318
  interface Review {
3160
3319
  id: string;
3161
3320
  store_id: string;
@@ -4618,10 +4777,11 @@ declare class StoresModule {
4618
4777
  data: Listing[];
4619
4778
  }>;
4620
4779
  /**
4621
- * Get all stores owned by the authenticated user.
4780
+ * The shops the authenticated user works in, owned or joined, each with their role in it and the
4781
+ * permissions it grants. Show only the actions those permissions allow.
4622
4782
  */
4623
4783
  getMyStores(options?: RequestOptions): Promise<{
4624
- data: Store[];
4784
+ data: Array<Store & StoreMembershipFields>;
4625
4785
  }>;
4626
4786
  /**
4627
4787
  * Get stores the authenticated user follows.
@@ -4742,6 +4902,98 @@ declare class StoresModule {
4742
4902
  */
4743
4903
  removePayoutDestination(storeId: string, destinationId: string, options?: RequestOptions): Promise<PayoutDestinationsState>;
4744
4904
  private destinationPath;
4905
+ /**
4906
+ * The shop's members, and the roles the caller may give. `store:members.manage`.
4907
+ *
4908
+ * Errors: 403 store_forbidden; 404 not_found.
4909
+ */
4910
+ getMembers(storeId: string, options?: RequestOptions): Promise<StoreMembers>;
4911
+ /**
4912
+ * Change a member's role. The owner manages every role; a manager, the roles below manager.
4913
+ * Needs a second factor used in the last 10 minutes.
4914
+ *
4915
+ * Errors: 400 invalid_input; 403 store_forbidden, step_up_required, role_not_allowed; 404 member_not_found.
4916
+ */
4917
+ changeMemberRole(storeId: string, memberId: string, role: InvitableStoreRole, options?: RequestOptions): Promise<{
4918
+ ok: true;
4919
+ }>;
4920
+ /**
4921
+ * Remove a member. They lose access on their next request. Needs a recent second factor.
4922
+ *
4923
+ * Errors: 403 store_forbidden, step_up_required, role_not_allowed; 404 member_not_found.
4924
+ */
4925
+ removeMember(storeId: string, memberId: string, options?: RequestOptions): Promise<{
4926
+ ok: true;
4927
+ }>;
4928
+ /**
4929
+ * Leave a shop's team. The owner cannot leave their own shop.
4930
+ *
4931
+ * Errors: 404 member_not_found; 409 owner_cannot_leave.
4932
+ */
4933
+ leave(storeId: string, options?: RequestOptions): Promise<{
4934
+ ok: true;
4935
+ }>;
4936
+ /**
4937
+ * Invite someone by email address or Kenyan phone number. The answer is the same whether or not an
4938
+ * account uses the address. Needs a recent second factor. The invitation lasts 7 days.
4939
+ *
4940
+ * Errors: 400 invalid_input, invalid_address; 403 store_forbidden, step_up_required, role_not_allowed;
4941
+ * 404 not_found; 409 too_many_invitations.
4942
+ */
4943
+ invite(storeId: string, input: InviteToStoreInput, options?: RequestOptions): Promise<InviteToStoreResult>;
4944
+ /**
4945
+ * The shop's open invitations, newest first. `store:members.manage`.
4946
+ *
4947
+ * Errors: 403 store_forbidden; 404 not_found.
4948
+ */
4949
+ getInvitations(storeId: string, options?: RequestOptions): Promise<{
4950
+ data: StoreInvitationListItem[];
4951
+ }>;
4952
+ /**
4953
+ * Revoke an open invitation. Needs a recent second factor.
4954
+ *
4955
+ * Errors: 403 store_forbidden, step_up_required, role_not_allowed; 404 invitation_not_found.
4956
+ */
4957
+ revokeInvitation(storeId: string, invitationId: string, options?: RequestOptions): Promise<{
4958
+ ok: true;
4959
+ }>;
4960
+ /** Invitations the caller received and can still answer, newest first. */
4961
+ getReceivedInvitations(options?: RequestOptions): Promise<{
4962
+ data: ReceivedStoreInvitation[];
4963
+ }>;
4964
+ /**
4965
+ * Join a shop. Needs a verified phone number; the manager role also needs a recent second factor.
4966
+ *
4967
+ * Errors: 403 step_up_required; 404 invitation_not_found, not_found; 409 phone_not_verified,
4968
+ * membership_limit, already_member.
4969
+ */
4970
+ acceptInvitation(invitationId: string, options?: RequestOptions): Promise<AcceptStoreInvitationResult>;
4971
+ /**
4972
+ * Decline an invitation.
4973
+ *
4974
+ * Errors: 404 invitation_not_found.
4975
+ */
4976
+ declineInvitation(invitationId: string, options?: RequestOptions): Promise<{
4977
+ ok: true;
4978
+ }>;
4979
+ /**
4980
+ * The shop's audit log, newest first, 50 per page. `store:audit.read`.
4981
+ *
4982
+ * Errors: 403 store_forbidden; 404 not_found.
4983
+ */
4984
+ getAuditLog(storeId: string, params?: {
4985
+ page?: number;
4986
+ }, options?: RequestOptions): Promise<StoreAuditPage>;
4987
+ /** The caller's shop limit, how many shops they own, and their latest request for more. */
4988
+ getStoreLimit(options?: RequestOptions): Promise<StoreLimitState>;
4989
+ /**
4990
+ * Ask for a higher shop limit, at the limit, with a reason of at least 30 characters. One request
4991
+ * at a time.
4992
+ *
4993
+ * Errors: 400 invalid_input; 403 not_a_retail_seller; 409 not_at_limit, request_pending.
4994
+ */
4995
+ requestStoreLimit(input: RequestStoreLimitInput, options?: RequestOptions): Promise<StoreLimitState>;
4996
+ private storePath;
4745
4997
  }
4746
4998
  /** Whether an error asks the caller to sign in again with a second factor before retrying. */
4747
4999
  declare function stepUpRequired(error: unknown): boolean;
@@ -5195,6 +5447,23 @@ declare class AdminModule {
5195
5447
  * 503 refund_disbursement_paused, refund_method_unsupported.
5196
5448
  */
5197
5449
  sendRefund(refundId: string, options?: RequestOptions): Promise<AdminRefundSendResult>;
5450
+ /**
5451
+ * Requests for a higher shop limit, 25 per page: pending oldest first, decided latest first.
5452
+ * `admin:read`.
5453
+ *
5454
+ * Errors: 400 invalid_input (unknown status).
5455
+ */
5456
+ listShopLimitRequests(params?: {
5457
+ status?: StoreLimitRequestStatus;
5458
+ page?: number;
5459
+ }, options?: RequestOptions): Promise<AdminShopLimitRequestsPage>;
5460
+ /**
5461
+ * Approve a request with a new limit (above the current one, at most 50), or reject it with a note
5462
+ * of at least 10 characters. The owner is told. `sellers:verify`.
5463
+ *
5464
+ * Errors: 400 invalid_input; 403 forbidden; 404 not_found (not pending).
5465
+ */
5466
+ decideShopLimitRequest(requestId: string, input: DecideShopLimitInput, options?: RequestOptions): Promise<DecideShopLimitResult>;
5198
5467
  listReports(params?: {
5199
5468
  status?: 'open' | 'reviewed' | 'dismissed' | 'actioned';
5200
5469
  type?: 'listing' | 'review' | 'store' | 'user';
@@ -5902,4 +6171,4 @@ declare class MitumbaClient {
5902
6171
  isAuthenticated(): Promise<boolean>;
5903
6172
  }
5904
6173
 
5905
- 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 AddPayoutDestinationInput, type Address, type AdminAuditActor, type AdminAuditEntry, type AdminAuditQuery, type AdminAuthStrength, type AdminListingItem, type AdminMessageReport, type AdminMessageReportDetail, type AdminMessageReportList, type AdminMessageReportThreadMessage, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminRefundItem, type AdminRefundReason, type AdminRefundSendResult, type AdminRefundStatus, 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 CancelCheckoutRefusalCode, type CancelCheckoutResponse, type CancelOrderInput, type CancelOrderResult, type CartItem, type CartLineAvailability, CartModule, type CartPartition, type CategoriesBySection, type Category, type CategorySection, type ChangePasswordInput, type ChangePlatformSettingInput, type ChangePlatformSettingResult, type Checkout, type CheckoutMoney, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutRefusal, type CheckoutRefusalCode, type CheckoutShopOrder, type CheckoutState, type CheckoutStatus, type CheckoutStatusResponse, CheckoutsModule, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateCheckoutInput, type CreateCheckoutResponse, 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 CreatedBaleOrder, 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 EarningsBalance, type EmailLoginInput, type EmailRegisterInput, type FileResponse, type FinishIamPasskeyEnrollmentInput, type FinishIamPasskeyLoginInput, type FollowedStore, type ForgotPasswordInput, type GetCheckoutResponse, IDBTokenStore, type IamActivation, type IamLoginInput, type IamLoginMethod, type IamMethodsResult, IamModule, type IamPasskeyLoginOptions, type IamProfile, type IamSession, type IamSessionsResult, type IamSignIn, type IamSignInFailureReason, type IamSignInsResult, type IamTokens, type IamTwoFactorRequired, type IamUser, type IamUserStatus, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type Jwk, type Jwks, type KnownPaymentProvider, type KnownShopStep, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LibraryCadence, type LibraryCompleter, type LibraryDocument, type LibraryDocumentSummary, type LibraryKind, type LibraryListing, type LibraryOccurrence, type LibraryOccurrenceRecorded, type LibraryOccurrenceStatus, type LibraryRoutineState, type LibrarySchedule, type LibraryScheduleRule, type LibrarySeason, type LibraryWeekday, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListIamUsersResult, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LiveUnread, type LiveUnreadOptions, 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 MessageReportOutcome, type MessageReportReason, type MessageReportStatus, 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, type MessagingSide, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationAction, type NotificationCategory, type NotificationFlash, type NotificationLink, type NotificationPref, type NotificationStream, type NotificationStreamFrame, type NotificationStreamItem, type NotificationStreamOptions, type NotificationStreamState, type NotificationStreamTicket, 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 OrderDocument, type OrderDocumentKind, type OrderEvent, type OrderHistoryEntry, type OrderHistoryParams, type OrderItem, type OrderItemSummary, 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 PayoutBankOption, type PayoutDestination, type PayoutDestinationLabel, type PayoutDestinationRejection, type PayoutDestinations, type PayoutDestinationsState, type PayoutMethodOption, type PayoutMethodType, type PayoutState, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PlatformSetting, type PlatformSettingChange, type PlatformSettingDetail, type PlatformSettingGroup, type PlatformSettingKind, 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 ResolveMessageReportInput, type ResolveMessageReportResult, 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 SendTestNotificationResult, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type SettlementLine, type ShareUrlOptions, type ShopCancelReason, type ShopEarnings, type ShopHolder, type ShopNextStep, type ShopOrderFields, type ShopPayout, type ShopPayoutEntriesPage, type ShopPayoutEntriesParams, type ShopPayoutEntry, type ShopSettlement, type ShopStep, 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, cartLineAvailability, categoriesBySection, categorySection, checkoutRefusal, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isCartLineBuyable, isConditionAllowed, isConsentRequired, isMessagingAPIError, isNewOnlyCategory, isValidPhone, listingShareUrl, maskPhone, normalizePhone, partitionCart, regionById, stepUpRequired, storeShareUrl };
6174
+ export { APIClient, APIError, type APIErrorResponse, type AcceptStoreInvitationResult, type ActivateIamUserInput, type ActivateIamUserResult, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddIamPasskeyResult, type AddIamTotpResult, type AddIamTwoFactorMethodInput, type AddPaymentMethodInput, type AddPayoutDestinationInput, type Address, type AdminAuditActor, type AdminAuditEntry, type AdminAuditQuery, type AdminAuthStrength, type AdminListingItem, type AdminMessageReport, type AdminMessageReportDetail, type AdminMessageReportList, type AdminMessageReportThreadMessage, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminRefundItem, type AdminRefundReason, type AdminRefundSendResult, type AdminRefundStatus, type AdminReport, type AdminRolePreset, type AdminShopLimitRequest, type AdminShopLimitRequestsPage, 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 CancelCheckoutRefusalCode, type CancelCheckoutResponse, type CancelOrderInput, type CancelOrderResult, type CartItem, type CartLineAvailability, CartModule, type CartPartition, type CategoriesBySection, type Category, type CategorySection, type ChangePasswordInput, type ChangePlatformSettingInput, type ChangePlatformSettingResult, type Checkout, type CheckoutMoney, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutRefusal, type CheckoutRefusalCode, type CheckoutShopOrder, type CheckoutState, type CheckoutStatus, type CheckoutStatusResponse, CheckoutsModule, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateCheckoutInput, type CreateCheckoutResponse, 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 CreatedBaleOrder, type CursorPage, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DecideShopLimitInput, type DecideShopLimitResult, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EarningsBalance, type EmailLoginInput, type EmailRegisterInput, type FileResponse, type FinishIamPasskeyEnrollmentInput, type FinishIamPasskeyLoginInput, type FollowedStore, type ForgotPasswordInput, type GetCheckoutResponse, IDBTokenStore, type IamActivation, type IamLoginInput, type IamLoginMethod, type IamMethodsResult, IamModule, type IamPasskeyLoginOptions, type IamProfile, type IamSession, type IamSessionsResult, type IamSignIn, type IamSignInFailureReason, type IamSignInsResult, type IamTokens, type IamTwoFactorRequired, type IamUser, type IamUserStatus, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type InvitableStoreRole, type InviteToStoreInput, type InviteToStoreResult, type Jwk, type Jwks, type KnownPaymentProvider, type KnownShopStep, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LibraryCadence, type LibraryCompleter, type LibraryDocument, type LibraryDocumentSummary, type LibraryKind, type LibraryListing, type LibraryOccurrence, type LibraryOccurrenceRecorded, type LibraryOccurrenceStatus, type LibraryRoutineState, type LibrarySchedule, type LibraryScheduleRule, type LibrarySeason, type LibraryWeekday, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListIamUsersResult, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LiveUnread, type LiveUnreadOptions, 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 MessageReportOutcome, type MessageReportReason, type MessageReportStatus, 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, type MessagingSide, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationAction, type NotificationCategory, type NotificationFlash, type NotificationLink, type NotificationPref, type NotificationStream, type NotificationStreamFrame, type NotificationStreamItem, type NotificationStreamOptions, type NotificationStreamState, type NotificationStreamTicket, 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 OrderDocument, type OrderDocumentKind, type OrderEvent, type OrderHistoryEntry, type OrderHistoryParams, type OrderItem, type OrderItemSummary, 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 PayoutBankOption, type PayoutDestination, type PayoutDestinationLabel, type PayoutDestinationRejection, type PayoutDestinations, type PayoutDestinationsState, type PayoutMethodOption, type PayoutMethodType, type PayoutState, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PlatformSetting, type PlatformSettingChange, type PlatformSettingDetail, type PlatformSettingGroup, type PlatformSettingKind, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type ReceivedStoreInvitation, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegenerateIamBackupCodesResult, type RegisterInput, type RegisterOAuthClientInput, type RegisteredOAuthClient, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type RequestStoreLimitInput, type ResetPasswordInput, type ResolveDisputeInput, type ResolveMessageReportInput, type ResolveMessageReportResult, 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 SendTestNotificationResult, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type SettlementLine, type ShareUrlOptions, type ShopCancelReason, type ShopEarnings, type ShopHolder, type ShopNextStep, type ShopOrderFields, type ShopPayout, type ShopPayoutEntriesPage, type ShopPayoutEntriesParams, type ShopPayoutEntry, type ShopSettlement, type ShopStep, type SilentAuthorizeResult, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreAuditEntry, type StoreAuditPage, type StoreInvitation, type StoreInvitationListItem, type StoreLimitRequest, type StoreLimitRequestStatus, type StoreLimitState, type StoreMember, type StoreMembers, type StoreMembershipFields, type StorePermission, type StoreResolveThreadInput, type StoreReviewsPage, type StoreRole, 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, cartLineAvailability, categoriesBySection, categorySection, checkoutRefusal, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isCartLineBuyable, isConditionAllowed, isConsentRequired, isMessagingAPIError, isNewOnlyCategory, isValidPhone, listingShareUrl, maskPhone, normalizePhone, partitionCart, regionById, stepUpRequired, storeShareUrl };
package/dist/index.js CHANGED
@@ -2314,7 +2314,8 @@ var StoresModule = class {
2314
2314
  );
2315
2315
  }
2316
2316
  /**
2317
- * Get all stores owned by the authenticated user.
2317
+ * The shops the authenticated user works in, owned or joined, each with their role in it and the
2318
+ * permissions it grants. Show only the actions those permissions allow.
2318
2319
  */
2319
2320
  async getMyStores(options) {
2320
2321
  return this.client.get("/listings/stores/mine", void 0, options);
@@ -2474,6 +2475,112 @@ var StoresModule = class {
2474
2475
  destinationPath(storeId, destinationId, suffix) {
2475
2476
  return `/listings/stores/${encodeURIComponent(storeId)}/payout-destinations/${encodeURIComponent(destinationId)}${suffix}`;
2476
2477
  }
2478
+ // ── Team ──────────────────────────────────────────────────────────────────
2479
+ /**
2480
+ * The shop's members, and the roles the caller may give. `store:members.manage`.
2481
+ *
2482
+ * Errors: 403 store_forbidden; 404 not_found.
2483
+ */
2484
+ async getMembers(storeId, options) {
2485
+ return this.client.get(`${this.storePath(storeId)}/members`, void 0, options);
2486
+ }
2487
+ /**
2488
+ * Change a member's role. The owner manages every role; a manager, the roles below manager.
2489
+ * Needs a second factor used in the last 10 minutes.
2490
+ *
2491
+ * Errors: 400 invalid_input; 403 store_forbidden, step_up_required, role_not_allowed; 404 member_not_found.
2492
+ */
2493
+ async changeMemberRole(storeId, memberId, role, options) {
2494
+ return this.client.patch(`${this.storePath(storeId)}/members/${encodeURIComponent(memberId)}`, { role }, options);
2495
+ }
2496
+ /**
2497
+ * Remove a member. They lose access on their next request. Needs a recent second factor.
2498
+ *
2499
+ * Errors: 403 store_forbidden, step_up_required, role_not_allowed; 404 member_not_found.
2500
+ */
2501
+ async removeMember(storeId, memberId, options) {
2502
+ return this.client.delete(`${this.storePath(storeId)}/members/${encodeURIComponent(memberId)}`, void 0, options);
2503
+ }
2504
+ /**
2505
+ * Leave a shop's team. The owner cannot leave their own shop.
2506
+ *
2507
+ * Errors: 404 member_not_found; 409 owner_cannot_leave.
2508
+ */
2509
+ async leave(storeId, options) {
2510
+ return this.client.post(`${this.storePath(storeId)}/leave`, void 0, options);
2511
+ }
2512
+ /**
2513
+ * Invite someone by email address or Kenyan phone number. The answer is the same whether or not an
2514
+ * account uses the address. Needs a recent second factor. The invitation lasts 7 days.
2515
+ *
2516
+ * Errors: 400 invalid_input, invalid_address; 403 store_forbidden, step_up_required, role_not_allowed;
2517
+ * 404 not_found; 409 too_many_invitations.
2518
+ */
2519
+ async invite(storeId, input, options) {
2520
+ return this.client.post(`${this.storePath(storeId)}/invitations`, input, options);
2521
+ }
2522
+ /**
2523
+ * The shop's open invitations, newest first. `store:members.manage`.
2524
+ *
2525
+ * Errors: 403 store_forbidden; 404 not_found.
2526
+ */
2527
+ async getInvitations(storeId, options) {
2528
+ return this.client.get(`${this.storePath(storeId)}/invitations`, void 0, options);
2529
+ }
2530
+ /**
2531
+ * Revoke an open invitation. Needs a recent second factor.
2532
+ *
2533
+ * Errors: 403 store_forbidden, step_up_required, role_not_allowed; 404 invitation_not_found.
2534
+ */
2535
+ async revokeInvitation(storeId, invitationId, options) {
2536
+ return this.client.delete(`${this.storePath(storeId)}/invitations/${encodeURIComponent(invitationId)}`, void 0, options);
2537
+ }
2538
+ /** Invitations the caller received and can still answer, newest first. */
2539
+ async getReceivedInvitations(options) {
2540
+ return this.client.get("/listings/store-invitations", void 0, options);
2541
+ }
2542
+ /**
2543
+ * Join a shop. Needs a verified phone number; the manager role also needs a recent second factor.
2544
+ *
2545
+ * Errors: 403 step_up_required; 404 invitation_not_found, not_found; 409 phone_not_verified,
2546
+ * membership_limit, already_member.
2547
+ */
2548
+ async acceptInvitation(invitationId, options) {
2549
+ return this.client.post(`/listings/store-invitations/${encodeURIComponent(invitationId)}/accept`, void 0, options);
2550
+ }
2551
+ /**
2552
+ * Decline an invitation.
2553
+ *
2554
+ * Errors: 404 invitation_not_found.
2555
+ */
2556
+ async declineInvitation(invitationId, options) {
2557
+ return this.client.post(`/listings/store-invitations/${encodeURIComponent(invitationId)}/decline`, void 0, options);
2558
+ }
2559
+ /**
2560
+ * The shop's audit log, newest first, 50 per page. `store:audit.read`.
2561
+ *
2562
+ * Errors: 403 store_forbidden; 404 not_found.
2563
+ */
2564
+ async getAuditLog(storeId, params, options) {
2565
+ return this.client.get(`${this.storePath(storeId)}/audit`, params, options);
2566
+ }
2567
+ // ── Shop limit ────────────────────────────────────────────────────────────
2568
+ /** The caller's shop limit, how many shops they own, and their latest request for more. */
2569
+ async getStoreLimit(options) {
2570
+ return this.client.get("/listings/store-limit-request", void 0, options);
2571
+ }
2572
+ /**
2573
+ * Ask for a higher shop limit, at the limit, with a reason of at least 30 characters. One request
2574
+ * at a time.
2575
+ *
2576
+ * Errors: 400 invalid_input; 403 not_a_retail_seller; 409 not_at_limit, request_pending.
2577
+ */
2578
+ async requestStoreLimit(input, options) {
2579
+ return this.client.post("/listings/store-limit-request", input, options);
2580
+ }
2581
+ storePath(storeId) {
2582
+ return `/listings/stores/${encodeURIComponent(storeId)}`;
2583
+ }
2477
2584
  };
2478
2585
  function stepUpRequired(error) {
2479
2586
  return error instanceof APIError && error.code === "step_up_required";
@@ -2922,6 +3029,24 @@ var AdminModule = class {
2922
3029
  async sendRefund(refundId, options) {
2923
3030
  return this.client.post(`/admin/refunds/${encodeURIComponent(refundId)}/send`, void 0, options);
2924
3031
  }
3032
+ /**
3033
+ * Requests for a higher shop limit, 25 per page: pending oldest first, decided latest first.
3034
+ * `admin:read`.
3035
+ *
3036
+ * Errors: 400 invalid_input (unknown status).
3037
+ */
3038
+ async listShopLimitRequests(params, options) {
3039
+ return this.client.get("/admin/shop-limit-requests", params, options);
3040
+ }
3041
+ /**
3042
+ * Approve a request with a new limit (above the current one, at most 50), or reject it with a note
3043
+ * of at least 10 characters. The owner is told. `sellers:verify`.
3044
+ *
3045
+ * Errors: 400 invalid_input; 403 forbidden; 404 not_found (not pending).
3046
+ */
3047
+ async decideShopLimitRequest(requestId, input, options) {
3048
+ return this.client.post(`/admin/shop-limit-requests/${encodeURIComponent(requestId)}/decide`, input, options);
3049
+ }
2925
3050
  // ── Reports Moderation ──
2926
3051
  async listReports(params, options) {
2927
3052
  return this.client.get("/admin/reports", params, options);