@mitumba/sdk 5.29.0 → 5.31.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 +271 -3
- package/dist/index.d.ts +271 -3
- package/dist/index.js +97 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +97 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1141,11 +1141,22 @@ var OrdersModule = class {
|
|
|
1141
1141
|
return this.client.post("/orders", input, options);
|
|
1142
1142
|
}
|
|
1143
1143
|
/**
|
|
1144
|
-
* Get full details of an order, including its event timeline.
|
|
1144
|
+
* Get full details of an order, including its event timeline. For the shop (the seller, or a team
|
|
1145
|
+
* member who may read orders) it also carries `items`, `settlement` and `next_step`.
|
|
1145
1146
|
*/
|
|
1146
1147
|
async getById(id, options) {
|
|
1147
1148
|
return this.client.get(`/orders/${id}`, void 0, options);
|
|
1148
1149
|
}
|
|
1150
|
+
/**
|
|
1151
|
+
* Shop: cancel a paid order it cannot fulfil, before its parcel is ready. The buyer is refunded in
|
|
1152
|
+
* full. The owner or a team member who may cancel orders.
|
|
1153
|
+
*
|
|
1154
|
+
* Errors: 400 invalid_input; 403 store_forbidden; 404 not_found; 409 order_not_cancellable,
|
|
1155
|
+
* parcel_ready, not_refundable, conflict (reload and retry).
|
|
1156
|
+
*/
|
|
1157
|
+
async cancel(id, input, options) {
|
|
1158
|
+
return this.client.post(`/orders/${encodeURIComponent(id)}/cancel`, input, options);
|
|
1159
|
+
}
|
|
1149
1160
|
/**
|
|
1150
1161
|
* Transition the status of an order.
|
|
1151
1162
|
*/
|
|
@@ -2378,7 +2389,91 @@ var StoresModule = class {
|
|
|
2378
2389
|
async delete(storeId, options) {
|
|
2379
2390
|
return this.client.delete(`/listings/stores/${storeId}`, void 0, options);
|
|
2380
2391
|
}
|
|
2392
|
+
/**
|
|
2393
|
+
* A shop's earnings: per currency, what is in escrow, on hold, awaiting approval, approved,
|
|
2394
|
+
* sending, sent, failed or a test, in minor units. The owner, or a team member who may read
|
|
2395
|
+
* earnings.
|
|
2396
|
+
*
|
|
2397
|
+
* Errors: 403 forbidden (a member whose role does not include earnings); 404 not_found.
|
|
2398
|
+
*/
|
|
2399
|
+
async getEarnings(storeId, options) {
|
|
2400
|
+
return this.client.get(`/orders/stores/${encodeURIComponent(storeId)}/earnings`, void 0, options);
|
|
2401
|
+
}
|
|
2402
|
+
/**
|
|
2403
|
+
* Each paid order's entitlement, newest first, 20 per page, optionally of one state.
|
|
2404
|
+
*
|
|
2405
|
+
* Errors: 400 invalid_input (unknown state); 403 forbidden; 404 not_found.
|
|
2406
|
+
*/
|
|
2407
|
+
async getEarningsEntries(storeId, params, options) {
|
|
2408
|
+
return this.client.get(
|
|
2409
|
+
`/orders/stores/${encodeURIComponent(storeId)}/earnings/entries`,
|
|
2410
|
+
params,
|
|
2411
|
+
options
|
|
2412
|
+
);
|
|
2413
|
+
}
|
|
2414
|
+
/**
|
|
2415
|
+
* One payout of the shop, with the settlement lines that explain it.
|
|
2416
|
+
*
|
|
2417
|
+
* Errors: 403 forbidden; 404 not_found.
|
|
2418
|
+
*/
|
|
2419
|
+
async getPayout(storeId, payoutId, options) {
|
|
2420
|
+
return this.client.get(
|
|
2421
|
+
`/orders/stores/${encodeURIComponent(storeId)}/payouts/${encodeURIComponent(payoutId)}`,
|
|
2422
|
+
void 0,
|
|
2423
|
+
options
|
|
2424
|
+
);
|
|
2425
|
+
}
|
|
2426
|
+
/**
|
|
2427
|
+
* Where the shop is paid: its destinations, masked, with the methods and banks on offer. The
|
|
2428
|
+
* owner, or a team member who may read earnings.
|
|
2429
|
+
*
|
|
2430
|
+
* Errors: 403 store_forbidden.
|
|
2431
|
+
*/
|
|
2432
|
+
async getPayoutDestinations(storeId, options) {
|
|
2433
|
+
return this.client.get(`/listings/stores/${encodeURIComponent(storeId)}/payout-destinations`, void 0, options);
|
|
2434
|
+
}
|
|
2435
|
+
/**
|
|
2436
|
+
* Owner: add a payout destination. The shop's first applies at once; every later one, and a change
|
|
2437
|
+
* of default, 48 hours later. Needs a second factor used in the last 10 minutes.
|
|
2438
|
+
*
|
|
2439
|
+
* Errors: 400 invalid_input, or a `PayoutDestinationRejection` with `field`; 403 store_forbidden,
|
|
2440
|
+
* step_up_required; 409 method_unavailable, destination_exists, too_many_destinations.
|
|
2441
|
+
*/
|
|
2442
|
+
async addPayoutDestination(storeId, input, options) {
|
|
2443
|
+
return this.client.post(`/listings/stores/${encodeURIComponent(storeId)}/payout-destinations`, input, options);
|
|
2444
|
+
}
|
|
2445
|
+
/**
|
|
2446
|
+
* Owner: make a destination the default, 48 hours from now. Choosing the current default again
|
|
2447
|
+
* cancels any pending change. Needs a recent second factor.
|
|
2448
|
+
*
|
|
2449
|
+
* Errors: 403 store_forbidden, step_up_required; 404 not_found.
|
|
2450
|
+
*/
|
|
2451
|
+
async setDefaultPayoutDestination(storeId, destinationId, options) {
|
|
2452
|
+
return this.client.post(this.destinationPath(storeId, destinationId, "/default"), void 0, options);
|
|
2453
|
+
}
|
|
2454
|
+
/**
|
|
2455
|
+
* Owner: cancel a pending change of default to this destination. Needs a recent second factor.
|
|
2456
|
+
*
|
|
2457
|
+
* Errors: 403 store_forbidden, step_up_required; 404 not_found; 409 no_pending_default.
|
|
2458
|
+
*/
|
|
2459
|
+
async cancelPendingDefault(storeId, destinationId, options) {
|
|
2460
|
+
return this.client.delete(this.destinationPath(storeId, destinationId, "/default"), void 0, options);
|
|
2461
|
+
}
|
|
2462
|
+
/**
|
|
2463
|
+
* Owner: remove a destination, or cancel one still cooling off. Needs a recent second factor.
|
|
2464
|
+
*
|
|
2465
|
+
* Errors: 403 store_forbidden, step_up_required; 404 not_found.
|
|
2466
|
+
*/
|
|
2467
|
+
async removePayoutDestination(storeId, destinationId, options) {
|
|
2468
|
+
return this.client.delete(this.destinationPath(storeId, destinationId, ""), void 0, options);
|
|
2469
|
+
}
|
|
2470
|
+
destinationPath(storeId, destinationId, suffix) {
|
|
2471
|
+
return `/listings/stores/${encodeURIComponent(storeId)}/payout-destinations/${encodeURIComponent(destinationId)}${suffix}`;
|
|
2472
|
+
}
|
|
2381
2473
|
};
|
|
2474
|
+
function stepUpRequired(error) {
|
|
2475
|
+
return error instanceof APIError && error.code === "step_up_required";
|
|
2476
|
+
}
|
|
2382
2477
|
|
|
2383
2478
|
// src/modules/reviews.ts
|
|
2384
2479
|
var ReviewsModule = class {
|
|
@@ -3742,6 +3837,6 @@ var MitumbaClient = class {
|
|
|
3742
3837
|
}
|
|
3743
3838
|
};
|
|
3744
3839
|
|
|
3745
|
-
export { APIClient, APIError, AdminModule, AuthModule, BALE_ORDER_STATUSES, BusinessesModule, CONDITIONS, CartModule, CheckoutsModule, 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, cartLineAvailability, categoriesBySection, categorySection, checkoutRefusal, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isCartLineBuyable, isConditionAllowed, isConsentRequired, isMessagingAPIError, isNewOnlyCategory, isValidPhone, listingShareUrl, maskPhone, normalizePhone, partitionCart, regionById, storeShareUrl };
|
|
3840
|
+
export { APIClient, APIError, AdminModule, AuthModule, BALE_ORDER_STATUSES, BusinessesModule, CONDITIONS, CartModule, CheckoutsModule, 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, cartLineAvailability, categoriesBySection, categorySection, checkoutRefusal, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isCartLineBuyable, isConditionAllowed, isConsentRequired, isMessagingAPIError, isNewOnlyCategory, isValidPhone, listingShareUrl, maskPhone, normalizePhone, partitionCart, regionById, stepUpRequired, storeShareUrl };
|
|
3746
3841
|
//# sourceMappingURL=index.mjs.map
|
|
3747
3842
|
//# sourceMappingURL=index.mjs.map
|