@mitumba/sdk 5.30.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.mjs CHANGED
@@ -2389,7 +2389,91 @@ var StoresModule = class {
2389
2389
  async delete(storeId, options) {
2390
2390
  return this.client.delete(`/listings/stores/${storeId}`, void 0, options);
2391
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
+ }
2392
2473
  };
2474
+ function stepUpRequired(error) {
2475
+ return error instanceof APIError && error.code === "step_up_required";
2476
+ }
2393
2477
 
2394
2478
  // src/modules/reviews.ts
2395
2479
  var ReviewsModule = class {
@@ -3753,6 +3837,6 @@ var MitumbaClient = class {
3753
3837
  }
3754
3838
  };
3755
3839
 
3756
- 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 };
3757
3841
  //# sourceMappingURL=index.mjs.map
3758
3842
  //# sourceMappingURL=index.mjs.map