@mitumba/sdk 5.9.0 → 5.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +53 -2
- package/dist/index.d.ts +53 -2
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1278,7 +1278,9 @@ interface BecomeSellerInput {
|
|
|
1278
1278
|
business_name?: string;
|
|
1279
1279
|
id_number?: string;
|
|
1280
1280
|
kra_pin?: string;
|
|
1281
|
+
/** Contact / payout phone in any common local form; stored on the business in E.164. Invalid is a 400. */
|
|
1281
1282
|
phone?: string;
|
|
1283
|
+
/** A region name from `sdk.markets.regions()`; stored canonically. Invalid is a 400. */
|
|
1282
1284
|
county?: string;
|
|
1283
1285
|
town?: string;
|
|
1284
1286
|
categories?: string[];
|
|
@@ -1292,7 +1294,9 @@ interface BecomeBaleSellerInput {
|
|
|
1292
1294
|
business_name?: string;
|
|
1293
1295
|
kra_pin?: string;
|
|
1294
1296
|
id_number?: string;
|
|
1297
|
+
/** Contact / payout phone in any common local form; stored on the business in E.164. Invalid is a 400. */
|
|
1295
1298
|
phone?: string;
|
|
1299
|
+
/** A region name from `sdk.markets.regions()`; stored canonically. Invalid is a 400. */
|
|
1296
1300
|
county?: string;
|
|
1297
1301
|
}
|
|
1298
1302
|
interface UserProfile {
|
|
@@ -2112,6 +2116,24 @@ interface MarketsResponse {
|
|
|
2112
2116
|
markets: Market[];
|
|
2113
2117
|
updated_at: string;
|
|
2114
2118
|
}
|
|
2119
|
+
/** A first-level administrative region of a market, e.g. a county in Kenya. */
|
|
2120
|
+
interface MarketRegion {
|
|
2121
|
+
/** Stable lowercase slug, e.g. `"trans-nzoia"`. */
|
|
2122
|
+
id: string;
|
|
2123
|
+
/** The canonical name the platform stores, e.g. `"Trans-Nzoia"`. Send this, not free text. */
|
|
2124
|
+
name: string;
|
|
2125
|
+
}
|
|
2126
|
+
interface MarketRegionsResponse {
|
|
2127
|
+
version: 1;
|
|
2128
|
+
/** UPPERCASE ISO 3166-1 alpha-2, e.g. `"KE"`. */
|
|
2129
|
+
market_code: string;
|
|
2130
|
+
/** Singular and plural labels for the region field, e.g. County / Counties. */
|
|
2131
|
+
label: string;
|
|
2132
|
+
plural: string;
|
|
2133
|
+
/** Regions in display (alphabetical) order. */
|
|
2134
|
+
regions: MarketRegion[];
|
|
2135
|
+
updated_at: string;
|
|
2136
|
+
}
|
|
2115
2137
|
|
|
2116
2138
|
interface VAZIOutfitItem {
|
|
2117
2139
|
id: string;
|
|
@@ -2534,8 +2556,11 @@ interface Business {
|
|
|
2534
2556
|
seller_type: 'individual' | 'business';
|
|
2535
2557
|
kra_pin: string | null;
|
|
2536
2558
|
id_number: string | null;
|
|
2559
|
+
/** Canonical region name (e.g. `Trans-Nzoia`), from `sdk.markets.regions()`. */
|
|
2537
2560
|
county: string | null;
|
|
2538
2561
|
town: string | null;
|
|
2562
|
+
/** Contact / payout phone in E.164, e.g. `+254712345678`. */
|
|
2563
|
+
phone: string | null;
|
|
2539
2564
|
categories: string | null;
|
|
2540
2565
|
condition_grades: string | null;
|
|
2541
2566
|
delivery_method: 'self' | 'mitumba-logistics';
|
|
@@ -2550,8 +2575,17 @@ interface UpdateBusinessInput {
|
|
|
2550
2575
|
name?: string;
|
|
2551
2576
|
kra_pin?: string;
|
|
2552
2577
|
id_number?: string;
|
|
2553
|
-
|
|
2578
|
+
/**
|
|
2579
|
+
* A region name from `sdk.markets.regions()`; known alternative spellings are accepted and stored
|
|
2580
|
+
* canonically. Anything else is a 400 `invalid_county`. `null` or blank clears it.
|
|
2581
|
+
*/
|
|
2582
|
+
county?: string | null;
|
|
2554
2583
|
town?: string;
|
|
2584
|
+
/**
|
|
2585
|
+
* Contact / payout phone in any common local form (`0712 345 678`, `+254 712 345 678`); stored in
|
|
2586
|
+
* E.164. An invalid number is a 400 `invalid_phone`. `null` or blank clears it.
|
|
2587
|
+
*/
|
|
2588
|
+
phone?: string | null;
|
|
2555
2589
|
categories?: string[];
|
|
2556
2590
|
condition_grades?: string[];
|
|
2557
2591
|
delivery_method?: 'self' | 'mitumba-logistics';
|
|
@@ -4477,6 +4511,15 @@ declare class MarketsModule {
|
|
|
4477
4511
|
* (`formatMoney`, `normalizePhone`, `findMarket`, ...).
|
|
4478
4512
|
*/
|
|
4479
4513
|
list(options?: RequestOptions): Promise<MarketsResponse>;
|
|
4514
|
+
/**
|
|
4515
|
+
* The first-level regions of one market, e.g. Kenya's 47 counties, with the market's label for
|
|
4516
|
+
* them (`County` / `Counties`). Use this for every county or region picker, and send the
|
|
4517
|
+
* returned `name` back to the API: it is the canonical spelling the platform stores.
|
|
4518
|
+
*
|
|
4519
|
+
* `code` is an ISO 3166-1 alpha-2 market code (`"KE"`); it is uppercased before sending.
|
|
4520
|
+
* Public and cacheable. An unknown market rejects with a 404 rather than resolving empty.
|
|
4521
|
+
*/
|
|
4522
|
+
regions(code: string, options?: RequestOptions): Promise<MarketRegionsResponse>;
|
|
4480
4523
|
}
|
|
4481
4524
|
|
|
4482
4525
|
/**
|
|
@@ -4529,6 +4572,14 @@ declare function maskPhone(value: string, market: PhoneMarket): string;
|
|
|
4529
4572
|
declare function findMarket(markets: readonly Market[], code: string): Market | undefined;
|
|
4530
4573
|
/** Markets that can transact. A `coming_soon` market is for discovery only. */
|
|
4531
4574
|
declare function activeMarkets(markets: readonly Market[]): Market[];
|
|
4575
|
+
/**
|
|
4576
|
+
* Find a region by its canonical name in a list read from `sdk.markets.regions(code)`. Surrounding
|
|
4577
|
+
* whitespace is ignored; everything else must match exactly, so a stored value is always one the
|
|
4578
|
+
* platform accepts. Use it to preselect a saved region in a picker.
|
|
4579
|
+
*/
|
|
4580
|
+
declare function findRegion(regions: readonly MarketRegion[], name: string): MarketRegion | undefined;
|
|
4581
|
+
/** Find a region by its stable id slug, e.g. `"trans-nzoia"`. */
|
|
4582
|
+
declare function regionById(regions: readonly MarketRegion[], id: string): MarketRegion | undefined;
|
|
4532
4583
|
|
|
4533
4584
|
/**
|
|
4534
4585
|
* Canonical go.mitumba.africa share URLs — the one place clients build listing, store and bale share links.
|
|
@@ -4608,4 +4659,4 @@ declare class MitumbaClient {
|
|
|
4608
4659
|
isAuthenticated(): Promise<boolean>;
|
|
4609
4660
|
}
|
|
4610
4661
|
|
|
4611
|
-
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 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, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isConsentRequired, isMessagingAPIError, isValidPhone, listingShareUrl, maskPhone, normalizePhone, storeShareUrl };
|
|
4662
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1278,7 +1278,9 @@ interface BecomeSellerInput {
|
|
|
1278
1278
|
business_name?: string;
|
|
1279
1279
|
id_number?: string;
|
|
1280
1280
|
kra_pin?: string;
|
|
1281
|
+
/** Contact / payout phone in any common local form; stored on the business in E.164. Invalid is a 400. */
|
|
1281
1282
|
phone?: string;
|
|
1283
|
+
/** A region name from `sdk.markets.regions()`; stored canonically. Invalid is a 400. */
|
|
1282
1284
|
county?: string;
|
|
1283
1285
|
town?: string;
|
|
1284
1286
|
categories?: string[];
|
|
@@ -1292,7 +1294,9 @@ interface BecomeBaleSellerInput {
|
|
|
1292
1294
|
business_name?: string;
|
|
1293
1295
|
kra_pin?: string;
|
|
1294
1296
|
id_number?: string;
|
|
1297
|
+
/** Contact / payout phone in any common local form; stored on the business in E.164. Invalid is a 400. */
|
|
1295
1298
|
phone?: string;
|
|
1299
|
+
/** A region name from `sdk.markets.regions()`; stored canonically. Invalid is a 400. */
|
|
1296
1300
|
county?: string;
|
|
1297
1301
|
}
|
|
1298
1302
|
interface UserProfile {
|
|
@@ -2112,6 +2116,24 @@ interface MarketsResponse {
|
|
|
2112
2116
|
markets: Market[];
|
|
2113
2117
|
updated_at: string;
|
|
2114
2118
|
}
|
|
2119
|
+
/** A first-level administrative region of a market, e.g. a county in Kenya. */
|
|
2120
|
+
interface MarketRegion {
|
|
2121
|
+
/** Stable lowercase slug, e.g. `"trans-nzoia"`. */
|
|
2122
|
+
id: string;
|
|
2123
|
+
/** The canonical name the platform stores, e.g. `"Trans-Nzoia"`. Send this, not free text. */
|
|
2124
|
+
name: string;
|
|
2125
|
+
}
|
|
2126
|
+
interface MarketRegionsResponse {
|
|
2127
|
+
version: 1;
|
|
2128
|
+
/** UPPERCASE ISO 3166-1 alpha-2, e.g. `"KE"`. */
|
|
2129
|
+
market_code: string;
|
|
2130
|
+
/** Singular and plural labels for the region field, e.g. County / Counties. */
|
|
2131
|
+
label: string;
|
|
2132
|
+
plural: string;
|
|
2133
|
+
/** Regions in display (alphabetical) order. */
|
|
2134
|
+
regions: MarketRegion[];
|
|
2135
|
+
updated_at: string;
|
|
2136
|
+
}
|
|
2115
2137
|
|
|
2116
2138
|
interface VAZIOutfitItem {
|
|
2117
2139
|
id: string;
|
|
@@ -2534,8 +2556,11 @@ interface Business {
|
|
|
2534
2556
|
seller_type: 'individual' | 'business';
|
|
2535
2557
|
kra_pin: string | null;
|
|
2536
2558
|
id_number: string | null;
|
|
2559
|
+
/** Canonical region name (e.g. `Trans-Nzoia`), from `sdk.markets.regions()`. */
|
|
2537
2560
|
county: string | null;
|
|
2538
2561
|
town: string | null;
|
|
2562
|
+
/** Contact / payout phone in E.164, e.g. `+254712345678`. */
|
|
2563
|
+
phone: string | null;
|
|
2539
2564
|
categories: string | null;
|
|
2540
2565
|
condition_grades: string | null;
|
|
2541
2566
|
delivery_method: 'self' | 'mitumba-logistics';
|
|
@@ -2550,8 +2575,17 @@ interface UpdateBusinessInput {
|
|
|
2550
2575
|
name?: string;
|
|
2551
2576
|
kra_pin?: string;
|
|
2552
2577
|
id_number?: string;
|
|
2553
|
-
|
|
2578
|
+
/**
|
|
2579
|
+
* A region name from `sdk.markets.regions()`; known alternative spellings are accepted and stored
|
|
2580
|
+
* canonically. Anything else is a 400 `invalid_county`. `null` or blank clears it.
|
|
2581
|
+
*/
|
|
2582
|
+
county?: string | null;
|
|
2554
2583
|
town?: string;
|
|
2584
|
+
/**
|
|
2585
|
+
* Contact / payout phone in any common local form (`0712 345 678`, `+254 712 345 678`); stored in
|
|
2586
|
+
* E.164. An invalid number is a 400 `invalid_phone`. `null` or blank clears it.
|
|
2587
|
+
*/
|
|
2588
|
+
phone?: string | null;
|
|
2555
2589
|
categories?: string[];
|
|
2556
2590
|
condition_grades?: string[];
|
|
2557
2591
|
delivery_method?: 'self' | 'mitumba-logistics';
|
|
@@ -4477,6 +4511,15 @@ declare class MarketsModule {
|
|
|
4477
4511
|
* (`formatMoney`, `normalizePhone`, `findMarket`, ...).
|
|
4478
4512
|
*/
|
|
4479
4513
|
list(options?: RequestOptions): Promise<MarketsResponse>;
|
|
4514
|
+
/**
|
|
4515
|
+
* The first-level regions of one market, e.g. Kenya's 47 counties, with the market's label for
|
|
4516
|
+
* them (`County` / `Counties`). Use this for every county or region picker, and send the
|
|
4517
|
+
* returned `name` back to the API: it is the canonical spelling the platform stores.
|
|
4518
|
+
*
|
|
4519
|
+
* `code` is an ISO 3166-1 alpha-2 market code (`"KE"`); it is uppercased before sending.
|
|
4520
|
+
* Public and cacheable. An unknown market rejects with a 404 rather than resolving empty.
|
|
4521
|
+
*/
|
|
4522
|
+
regions(code: string, options?: RequestOptions): Promise<MarketRegionsResponse>;
|
|
4480
4523
|
}
|
|
4481
4524
|
|
|
4482
4525
|
/**
|
|
@@ -4529,6 +4572,14 @@ declare function maskPhone(value: string, market: PhoneMarket): string;
|
|
|
4529
4572
|
declare function findMarket(markets: readonly Market[], code: string): Market | undefined;
|
|
4530
4573
|
/** Markets that can transact. A `coming_soon` market is for discovery only. */
|
|
4531
4574
|
declare function activeMarkets(markets: readonly Market[]): Market[];
|
|
4575
|
+
/**
|
|
4576
|
+
* Find a region by its canonical name in a list read from `sdk.markets.regions(code)`. Surrounding
|
|
4577
|
+
* whitespace is ignored; everything else must match exactly, so a stored value is always one the
|
|
4578
|
+
* platform accepts. Use it to preselect a saved region in a picker.
|
|
4579
|
+
*/
|
|
4580
|
+
declare function findRegion(regions: readonly MarketRegion[], name: string): MarketRegion | undefined;
|
|
4581
|
+
/** Find a region by its stable id slug, e.g. `"trans-nzoia"`. */
|
|
4582
|
+
declare function regionById(regions: readonly MarketRegion[], id: string): MarketRegion | undefined;
|
|
4532
4583
|
|
|
4533
4584
|
/**
|
|
4534
4585
|
* Canonical go.mitumba.africa share URLs — the one place clients build listing, store and bale share links.
|
|
@@ -4608,4 +4659,4 @@ declare class MitumbaClient {
|
|
|
4608
4659
|
isAuthenticated(): Promise<boolean>;
|
|
4609
4660
|
}
|
|
4610
4661
|
|
|
4611
|
-
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 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, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isConsentRequired, isMessagingAPIError, isValidPhone, listingShareUrl, maskPhone, normalizePhone, storeShareUrl };
|
|
4662
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -2792,6 +2792,18 @@ var MarketsModule = class {
|
|
|
2792
2792
|
async list(options) {
|
|
2793
2793
|
return this.client.get("/markets", void 0, options);
|
|
2794
2794
|
}
|
|
2795
|
+
/**
|
|
2796
|
+
* The first-level regions of one market, e.g. Kenya's 47 counties, with the market's label for
|
|
2797
|
+
* them (`County` / `Counties`). Use this for every county or region picker, and send the
|
|
2798
|
+
* returned `name` back to the API: it is the canonical spelling the platform stores.
|
|
2799
|
+
*
|
|
2800
|
+
* `code` is an ISO 3166-1 alpha-2 market code (`"KE"`); it is uppercased before sending.
|
|
2801
|
+
* Public and cacheable. An unknown market rejects with a 404 rather than resolving empty.
|
|
2802
|
+
*/
|
|
2803
|
+
async regions(code, options) {
|
|
2804
|
+
const marketCode = encodeURIComponent(code.trim().toUpperCase());
|
|
2805
|
+
return this.client.get(`/markets/${marketCode}/regions`, void 0, options);
|
|
2806
|
+
}
|
|
2795
2807
|
};
|
|
2796
2808
|
|
|
2797
2809
|
// src/types/auth.ts
|
|
@@ -2921,6 +2933,14 @@ function findMarket(markets, code) {
|
|
|
2921
2933
|
function activeMarkets(markets) {
|
|
2922
2934
|
return markets.filter((market) => market.status === "active");
|
|
2923
2935
|
}
|
|
2936
|
+
function findRegion(regions, name) {
|
|
2937
|
+
const input = name.trim();
|
|
2938
|
+
if (!input) return void 0;
|
|
2939
|
+
return regions.find((region) => region.name === input);
|
|
2940
|
+
}
|
|
2941
|
+
function regionById(regions, id) {
|
|
2942
|
+
return regions.find((region) => region.id === id);
|
|
2943
|
+
}
|
|
2924
2944
|
|
|
2925
2945
|
// src/share.ts
|
|
2926
2946
|
var DEFAULT_SHARE_ORIGIN = "https://go.mitumba.africa";
|
|
@@ -3095,6 +3115,7 @@ exports.activeMarkets = activeMarkets;
|
|
|
3095
3115
|
exports.baleShareUrl = baleShareUrl;
|
|
3096
3116
|
exports.createTokenStore = createTokenStore;
|
|
3097
3117
|
exports.findMarket = findMarket;
|
|
3118
|
+
exports.findRegion = findRegion;
|
|
3098
3119
|
exports.formatAmount = formatAmount;
|
|
3099
3120
|
exports.formatMoney = formatMoney;
|
|
3100
3121
|
exports.formatMoneyCompact = formatMoneyCompact;
|
|
@@ -3105,6 +3126,7 @@ exports.isValidPhone = isValidPhone;
|
|
|
3105
3126
|
exports.listingShareUrl = listingShareUrl;
|
|
3106
3127
|
exports.maskPhone = maskPhone;
|
|
3107
3128
|
exports.normalizePhone = normalizePhone;
|
|
3129
|
+
exports.regionById = regionById;
|
|
3108
3130
|
exports.storeShareUrl = storeShareUrl;
|
|
3109
3131
|
//# sourceMappingURL=index.js.map
|
|
3110
3132
|
//# sourceMappingURL=index.js.map
|