@mitumba/sdk 5.8.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.d.mts +73 -2
- package/dist/index.d.ts +73 -2
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2378,6 +2378,13 @@ var AdminModule = class {
|
|
|
2378
2378
|
async getAuditLog(limit = 100, options) {
|
|
2379
2379
|
return this.client.get("/admin/audit", { limit }, options);
|
|
2380
2380
|
}
|
|
2381
|
+
/**
|
|
2382
|
+
* The attributed, filterable audit trail, newest first. Pass `next_cursor` back as `before` for
|
|
2383
|
+
* the next page; it is null on the last page.
|
|
2384
|
+
*/
|
|
2385
|
+
async listAuditLog(query2 = {}, options) {
|
|
2386
|
+
return this.client.get("/admin/audit", query2, options);
|
|
2387
|
+
}
|
|
2381
2388
|
// ── Payout approval ──
|
|
2382
2389
|
async listPayoutsAwaitingApproval(options) {
|
|
2383
2390
|
return this.client.get("/admin/payouts/pending-approval", void 0, options);
|
|
@@ -2783,6 +2790,18 @@ var MarketsModule = class {
|
|
|
2783
2790
|
async list(options) {
|
|
2784
2791
|
return this.client.get("/markets", void 0, options);
|
|
2785
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
|
+
}
|
|
2786
2805
|
};
|
|
2787
2806
|
|
|
2788
2807
|
// src/types/auth.ts
|
|
@@ -2912,6 +2931,14 @@ function findMarket(markets, code) {
|
|
|
2912
2931
|
function activeMarkets(markets) {
|
|
2913
2932
|
return markets.filter((market) => market.status === "active");
|
|
2914
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
|
+
}
|
|
2915
2942
|
|
|
2916
2943
|
// src/share.ts
|
|
2917
2944
|
var DEFAULT_SHARE_ORIGIN = "https://go.mitumba.africa";
|
|
@@ -3042,6 +3069,6 @@ var MitumbaClient = class {
|
|
|
3042
3069
|
}
|
|
3043
3070
|
};
|
|
3044
3071
|
|
|
3045
|
-
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 };
|
|
3046
3073
|
//# sourceMappingURL=index.mjs.map
|
|
3047
3074
|
//# sourceMappingURL=index.mjs.map
|