@mitumba/sdk 5.30.0 → 5.32.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,93 @@ 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. The current default cannot be
2464
+ * removed: make another destination the default first, and remove this one once that applies.
2465
+ * Needs a recent second factor.
2466
+ *
2467
+ * Errors: 403 store_forbidden, step_up_required; 404 not_found; 409 default_destination.
2468
+ */
2469
+ async removePayoutDestination(storeId, destinationId, options) {
2470
+ return this.client.delete(this.destinationPath(storeId, destinationId, ""), void 0, options);
2471
+ }
2472
+ destinationPath(storeId, destinationId, suffix) {
2473
+ return `/listings/stores/${encodeURIComponent(storeId)}/payout-destinations/${encodeURIComponent(destinationId)}${suffix}`;
2474
+ }
2392
2475
  };
2476
+ function stepUpRequired(error) {
2477
+ return error instanceof APIError && error.code === "step_up_required";
2478
+ }
2393
2479
 
2394
2480
  // src/modules/reviews.ts
2395
2481
  var ReviewsModule = class {
@@ -2816,6 +2902,24 @@ var AdminModule = class {
2816
2902
  async disbursePayout(payoutId, options) {
2817
2903
  return this.client.post(`/admin/payouts/${payoutId}/disburse`, void 0, options);
2818
2904
  }
2905
+ // ── Refunds ──
2906
+ /**
2907
+ * Refunds owed to buyers, newest first, 25 per page. `admin:read`.
2908
+ *
2909
+ * Errors: 400 invalid_input (unknown status).
2910
+ */
2911
+ async listRefunds(params, options) {
2912
+ return this.client.get("/admin/refunds", params, options);
2913
+ }
2914
+ /**
2915
+ * Send a pending refund to the number that paid. `payouts:disburse` with a recent passkey.
2916
+ *
2917
+ * Errors: 403 forbidden; 404 refund_not_found; 409 refund_sandbox_payment, refund_number_unavailable;
2918
+ * 503 refund_disbursement_paused, refund_method_unsupported.
2919
+ */
2920
+ async sendRefund(refundId, options) {
2921
+ return this.client.post(`/admin/refunds/${encodeURIComponent(refundId)}/send`, void 0, options);
2922
+ }
2819
2923
  // ── Reports Moderation ──
2820
2924
  async listReports(params, options) {
2821
2925
  return this.client.get("/admin/reports", params, options);
@@ -3753,6 +3857,6 @@ var MitumbaClient = class {
3753
3857
  }
3754
3858
  };
3755
3859
 
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 };
3860
+ 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
3861
  //# sourceMappingURL=index.mjs.map
3758
3862
  //# sourceMappingURL=index.mjs.map