@mitumba/sdk 5.9.0 → 5.10.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.mjs CHANGED
@@ -2790,6 +2790,18 @@ var MarketsModule = class {
2790
2790
  async list(options) {
2791
2791
  return this.client.get("/markets", void 0, options);
2792
2792
  }
2793
+ /**
2794
+ * The first-level regions of one market, e.g. Kenya's 47 counties, with the market's label for
2795
+ * them (`County` / `Counties`). Use this for every county or region picker, and send the
2796
+ * returned `name` back to the API: it is the canonical spelling the platform stores.
2797
+ *
2798
+ * `code` is an ISO 3166-1 alpha-2 market code (`"KE"`); it is uppercased before sending.
2799
+ * Public and cacheable. An unknown market rejects with a 404 rather than resolving empty.
2800
+ */
2801
+ async regions(code, options) {
2802
+ const marketCode = encodeURIComponent(code.trim().toUpperCase());
2803
+ return this.client.get(`/markets/${marketCode}/regions`, void 0, options);
2804
+ }
2793
2805
  };
2794
2806
 
2795
2807
  // src/types/auth.ts
@@ -2919,6 +2931,14 @@ function findMarket(markets, code) {
2919
2931
  function activeMarkets(markets) {
2920
2932
  return markets.filter((market) => market.status === "active");
2921
2933
  }
2934
+ function findRegion(regions, name) {
2935
+ const input = name.trim();
2936
+ if (!input) return void 0;
2937
+ return regions.find((region) => region.name === input);
2938
+ }
2939
+ function regionById(regions, id) {
2940
+ return regions.find((region) => region.id === id);
2941
+ }
2922
2942
 
2923
2943
  // src/share.ts
2924
2944
  var DEFAULT_SHARE_ORIGIN = "https://go.mitumba.africa";
@@ -3049,6 +3069,6 @@ var MitumbaClient = class {
3049
3069
  }
3050
3070
  };
3051
3071
 
3052
- export { APIClient, APIError, AdminModule, AuthModule, BALE_ORDER_STATUSES, BusinessesModule, CONDITIONS, CartModule, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, DisputesModule, IDBTokenStore, IamModule, LISTING_STATUSES, ListingsModule, MailerModule, MarketsModule, MemoryTokenStore, MessagesModule, MitumbaClient, NotificationsModule, OAuthModule, ORDER_STATUSES, OrdersModule, PAYMENT_STATUSES, PayModule, RealtimeProtocolError, RealtimeUnavailableError, ReportsModule, ReviewsModule, SearchModule, SettingsModule, StoresModule, TWO_FACTOR_METHOD_TYPES, UploadsModule, VaziModule, WholesaleModule, WishlistsModule, activeMarkets, baleShareUrl, createTokenStore, findMarket, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isConsentRequired, isMessagingAPIError, isValidPhone, listingShareUrl, maskPhone, normalizePhone, storeShareUrl };
3072
+ export { APIClient, APIError, AdminModule, AuthModule, BALE_ORDER_STATUSES, BusinessesModule, CONDITIONS, CartModule, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, DisputesModule, IDBTokenStore, IamModule, LISTING_STATUSES, ListingsModule, MailerModule, MarketsModule, MemoryTokenStore, MessagesModule, MitumbaClient, NotificationsModule, OAuthModule, ORDER_STATUSES, OrdersModule, PAYMENT_STATUSES, PayModule, RealtimeProtocolError, RealtimeUnavailableError, ReportsModule, ReviewsModule, SearchModule, SettingsModule, StoresModule, TWO_FACTOR_METHOD_TYPES, UploadsModule, VaziModule, WholesaleModule, WishlistsModule, activeMarkets, baleShareUrl, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isConsentRequired, isMessagingAPIError, isValidPhone, listingShareUrl, maskPhone, normalizePhone, regionById, storeShareUrl };
3053
3073
  //# sourceMappingURL=index.mjs.map
3054
3074
  //# sourceMappingURL=index.mjs.map