@mitumba/sdk 5.35.0 → 5.37.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 +146 -8
- package/dist/index.d.ts +146 -8
- package/dist/index.js +38 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -956,19 +956,29 @@ var ListingsModule = class {
|
|
|
956
956
|
return this.client.get(`/listings/${id}`, void 0, options);
|
|
957
957
|
}
|
|
958
958
|
/**
|
|
959
|
-
*
|
|
959
|
+
* List a piece in a shop, live or as a draft (`status: 'draft'`). Needs `store:listings.manage`
|
|
960
|
+
* in that shop. A draft is seen only by the shop's team until it is published.
|
|
961
|
+
*
|
|
962
|
+
* Errors: 400 invalid_input; 403 store_forbidden, not_a_retail_shop; 404 store_not_found.
|
|
960
963
|
*/
|
|
961
964
|
async create(input, options) {
|
|
962
965
|
return this.client.post("/listings", input, options);
|
|
963
966
|
}
|
|
964
967
|
/**
|
|
965
|
-
*
|
|
968
|
+
* Change a piece's details, stock or package size. Sold and removed pieces
|
|
969
|
+
* cannot be edited.
|
|
970
|
+
*
|
|
971
|
+
* Errors: 400 invalid_input, listing_immutable; 403 store_forbidden; 404 not_found.
|
|
966
972
|
*/
|
|
967
973
|
async update(id, input, options) {
|
|
968
974
|
return this.client.put(`/listings/${id}`, input, options);
|
|
969
975
|
}
|
|
970
976
|
/**
|
|
971
|
-
* Change
|
|
977
|
+
* Change a piece's status. Publishing a draft (`'active'`) needs a title of 3+ letters, a price
|
|
978
|
+
* of at least KES 50 and at least one photo; otherwise 422 `not_ready` whose message names what
|
|
979
|
+
* is missing (see `notReadyToPublish`).
|
|
980
|
+
*
|
|
981
|
+
* Errors: 400 invalid_transition; 403 store_forbidden; 404 not_found; 422 not_ready.
|
|
972
982
|
*/
|
|
973
983
|
async updateStatus(id, status, options) {
|
|
974
984
|
return this.client.patch(`/listings/${id}/status`, { status }, options);
|
|
@@ -1077,6 +1087,9 @@ var ListingsModule = class {
|
|
|
1077
1087
|
);
|
|
1078
1088
|
}
|
|
1079
1089
|
};
|
|
1090
|
+
function notReadyToPublish(error) {
|
|
1091
|
+
return error instanceof APIError && error.code === "not_ready";
|
|
1092
|
+
}
|
|
1080
1093
|
|
|
1081
1094
|
// src/modules/search.ts
|
|
1082
1095
|
var SearchModule = class {
|
|
@@ -2510,6 +2523,16 @@ var StoresModule = class {
|
|
|
2510
2523
|
destinationPath(storeId, destinationId, suffix) {
|
|
2511
2524
|
return `/listings/stores/${encodeURIComponent(storeId)}/payout-destinations/${encodeURIComponent(destinationId)}${suffix}`;
|
|
2512
2525
|
}
|
|
2526
|
+
/**
|
|
2527
|
+
* The shop's whole stock for its team: drafts, live, sold and (by filter) removed pieces, most
|
|
2528
|
+
* recently changed first, 24 per page, with counts per status. `store:listings.read`. The public
|
|
2529
|
+
* store page (`getListings`) shows live pieces only.
|
|
2530
|
+
*
|
|
2531
|
+
* Errors: 400 invalid_input; 403 store_forbidden; 404 not_found.
|
|
2532
|
+
*/
|
|
2533
|
+
async getInventory(storeId, params, options) {
|
|
2534
|
+
return this.client.get(`/listings/stores/${encodeURIComponent(storeId)}/inventory`, params, options);
|
|
2535
|
+
}
|
|
2513
2536
|
// ── Team ──────────────────────────────────────────────────────────────────
|
|
2514
2537
|
/**
|
|
2515
2538
|
* The shop's members, and the roles the caller may give. `store:members.manage`.
|
|
@@ -3084,6 +3107,15 @@ var AdminModule = class {
|
|
|
3084
3107
|
async listShopLimitRequests(params, options) {
|
|
3085
3108
|
return this.client.get("/admin/shop-limit-requests", params, options);
|
|
3086
3109
|
}
|
|
3110
|
+
/**
|
|
3111
|
+
* A shop's active members and one page of its audit log, 50 entries newest first, closed shops
|
|
3112
|
+
* included. `admin:read`.
|
|
3113
|
+
*
|
|
3114
|
+
* Errors: 403 forbidden; 404 not_found.
|
|
3115
|
+
*/
|
|
3116
|
+
async getShopTeam(storeId, params, options) {
|
|
3117
|
+
return this.client.get(`/admin/stores/${encodeURIComponent(storeId)}/team`, params, options);
|
|
3118
|
+
}
|
|
3087
3119
|
/**
|
|
3088
3120
|
* Approve a request with a new limit (above the current one, at most 50), or reject it with a note
|
|
3089
3121
|
* of at least 10 characters. The owner is told. `sellers:verify`.
|
|
@@ -3752,6 +3784,7 @@ var TWO_FACTOR_METHOD_TYPES = ["totp", "sms", "email", "passkey"];
|
|
|
3752
3784
|
// src/types/listings.ts
|
|
3753
3785
|
var CONDITIONS = ["new", "like_new", "good", "fair"];
|
|
3754
3786
|
var LISTING_STATUSES = ["draft", "active", "sold", "removed"];
|
|
3787
|
+
var PACKAGE_SIZES = ["small", "medium", "large", "oversize"];
|
|
3755
3788
|
|
|
3756
3789
|
// src/types/orders.ts
|
|
3757
3790
|
var ORDER_STATUSES = [
|
|
@@ -4060,6 +4093,6 @@ var MitumbaClient = class {
|
|
|
4060
4093
|
}
|
|
4061
4094
|
};
|
|
4062
4095
|
|
|
4063
|
-
export { APIClient, APIError, AdminModule, AuthModule, BALE_ORDER_STATUSES, BusinessesModule, CONDITIONS, CartModule, CheckoutsModule, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, DOCUMENT_PURPOSES, DisputesModule, DocumentsModule, IDBTokenStore, IamModule, LISTING_STATUSES, ListingsModule, MailerModule, MarketsModule, MemoryTokenStore, MessagesModule, MitumbaClient, NotificationsModule, OAuthModule, ORDER_STATUSES, OrdersModule, PAYMENT_STATUSES, PayModule, RealtimeProtocolError, RealtimeUnavailableError, ReportsModule, ReviewsModule, SELLER_VERIFICATION_STATUSES, SearchModule, SettingsModule, StoresModule, TWO_FACTOR_METHOD_TYPES, UploadsModule, VaziModule, WholesaleModule, WishlistsModule, activeMarkets, baleShareUrl, cartLineAvailability, categoriesBySection, categorySection, checkoutRefusal, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isCartLineBuyable, isConditionAllowed, isConsentRequired, isDocumentId, isMessagingAPIError, isNewOnlyCategory, isValidPhone, listingShareUrl, maskPhone, normalizePhone, partitionCart, regionById, stepUpRequired, storeShareUrl };
|
|
4096
|
+
export { APIClient, APIError, AdminModule, AuthModule, BALE_ORDER_STATUSES, BusinessesModule, CONDITIONS, CartModule, CheckoutsModule, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, DOCUMENT_PURPOSES, DisputesModule, DocumentsModule, IDBTokenStore, IamModule, LISTING_STATUSES, ListingsModule, MailerModule, MarketsModule, MemoryTokenStore, MessagesModule, MitumbaClient, NotificationsModule, OAuthModule, ORDER_STATUSES, OrdersModule, PACKAGE_SIZES, PAYMENT_STATUSES, PayModule, RealtimeProtocolError, RealtimeUnavailableError, ReportsModule, ReviewsModule, SELLER_VERIFICATION_STATUSES, SearchModule, SettingsModule, StoresModule, TWO_FACTOR_METHOD_TYPES, UploadsModule, VaziModule, WholesaleModule, WishlistsModule, activeMarkets, baleShareUrl, cartLineAvailability, categoriesBySection, categorySection, checkoutRefusal, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isCartLineBuyable, isConditionAllowed, isConsentRequired, isDocumentId, isMessagingAPIError, isNewOnlyCategory, isValidPhone, listingShareUrl, maskPhone, normalizePhone, notReadyToPublish, partitionCart, regionById, stepUpRequired, storeShareUrl };
|
|
4064
4097
|
//# sourceMappingURL=index.mjs.map
|
|
4065
4098
|
//# sourceMappingURL=index.mjs.map
|