@usethrottle/cart 3.17.0 → 3.18.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.cjs CHANGED
@@ -42,6 +42,7 @@ __export(index_exports, {
42
42
  CurrencyLockedError: () => CurrencyLockedError,
43
43
  CurrencyNotAvailableInProductionError: () => CurrencyNotAvailableInProductionError,
44
44
  CurrencyNotEnabledError: () => CurrencyNotEnabledError,
45
+ CurrencyNotPayableError: () => CurrencyNotPayableError,
45
46
  CurrencyNotSupportedError: () => CurrencyNotSupportedError,
46
47
  DiscountCurrencyUnsupportedError: () => DiscountCurrencyUnsupportedError,
47
48
  LineLimitReachedError: () => LineLimitReachedError,
@@ -253,6 +254,17 @@ var CurrencyNotAvailableInProductionError = class extends ThrottleApiError {
253
254
  this.name = "CurrencyNotAvailableInProductionError";
254
255
  }
255
256
  };
257
+ var CurrencyNotPayableError = class extends ThrottleApiError {
258
+ currency;
259
+ payableCurrencies;
260
+ constructor(args) {
261
+ super(coded("currency_not_payable", 422, args));
262
+ this.name = "CurrencyNotPayableError";
263
+ const d = args.details;
264
+ this.currency = str(d?.currency);
265
+ this.payableCurrencies = Array.isArray(d?.payableCurrencies) ? d.payableCurrencies.filter((c) => typeof c === "string") : [];
266
+ }
267
+ };
256
268
  var CurrencyLockedError = class extends ThrottleApiError {
257
269
  constructor(args) {
258
270
  super(coded("currency_locked", 409, args));
@@ -283,6 +295,7 @@ var RESOLVED_CART_ERRORS = {
283
295
  shipping_currency_unsupported: ShippingCurrencyUnsupportedError,
284
296
  currency_not_supported: CurrencyNotSupportedError,
285
297
  currency_not_available_in_production: CurrencyNotAvailableInProductionError,
298
+ currency_not_payable: CurrencyNotPayableError,
286
299
  currency_locked: CurrencyLockedError,
287
300
  quote_amounts_need_review: QuoteAmountsNeedReviewError
288
301
  };
@@ -706,6 +719,7 @@ var import_money = require("@usethrottle/money");
706
719
  CurrencyLockedError,
707
720
  CurrencyNotAvailableInProductionError,
708
721
  CurrencyNotEnabledError,
722
+ CurrencyNotPayableError,
709
723
  CurrencyNotSupportedError,
710
724
  DiscountCurrencyUnsupportedError,
711
725
  LineLimitReachedError,
package/dist/index.d.cts CHANGED
@@ -1096,6 +1096,16 @@ declare class CurrencyNotSupportedError extends ThrottleApiError {
1096
1096
  declare class CurrencyNotAvailableInProductionError extends ThrottleApiError {
1097
1097
  constructor(args: CartErrorArgs);
1098
1098
  }
1099
+ /**
1100
+ * `422 currency_not_payable`: the store cannot take payment in this currency
1101
+ * (payment path). `details` is `{ currency, payableCurrencies }`; a missing or
1102
+ * malformed `details` yields `currency: null` and `payableCurrencies: []`.
1103
+ */
1104
+ declare class CurrencyNotPayableError extends ThrottleApiError {
1105
+ readonly currency: string | null;
1106
+ readonly payableCurrencies: string[];
1107
+ constructor(args: CartErrorArgs);
1108
+ }
1099
1109
  /** `409 currency_locked`: the main currency can't change after the first production sale. */
1100
1110
  declare class CurrencyLockedError extends ThrottleApiError {
1101
1111
  constructor(args: CartErrorArgs);
@@ -1119,4 +1129,4 @@ declare function cartErrorFromResponse(args: {
1119
1129
  responseHeaders?: ThrottleErrorArgs['responseHeaders'];
1120
1130
  }): ThrottleApiError;
1121
1131
 
1122
- export { type AddLineItemInput, type AddResolvedLineItemInput, AmountTooLargeError, type AppliedDiscount, type Cart, type CartAddress, type CartBranding, CartChangedError, CartClient, type CartErrorArgs, type CartEvent, CartNotFoundError, CartNotOpenError, type CartPricesChangedDetails, CartPricesChangedError, type CartSession, type CartSessionCart, CartSessionClient, type CartSessionClientOptions, type CartSessionSummary, type CartShippingChange, CartTimeoutError, type CheckoutHandoff, type CheckoutHandoffInput, type CheckoutInput, type CreateCartInput, type CreateCartSessionInput, CurrencyLockedError, CurrencyNotAvailableInProductionError, type CurrencyNotEnabledDetails, CurrencyNotEnabledError, CurrencyNotSupportedError, DiscountCurrencyUnsupportedError, type ExternalShippingTaxSnapshotInput, type LegacyLineRecurring, type LineItem, type LineLimitReachedDetails, LineLimitReachedError, type LineNotPurchasableDetails, LineNotPurchasableError, type LineRecurringInput, type LineResolution, type LineResolverNotAvailableDetails, LineResolverNotAvailableError, type LineResolverUnavailableDetails, LineResolverUnavailableError, type Order, type PriceLockedDetails, PriceLockedError, type QuantityUnavailableDetails, QuantityUnavailableError, QuoteAmountsNeedReviewError, type RefusedCartLine, ResolvedLinesRequiredError, type SelectShippingInput, type SelectShippingMethodInput, type SelectedShipping, ShippingCurrencyUnsupportedError, ShippingMethodUnavailableError, ShippingQuoteUnavailableError, type ShippingTaxAddress, type ShippingTaxCalculationResponse, type ShippingTaxCartCalculateInput, type ShippingTaxMethod, type ShippingTaxQuoteInput, type ShippingTaxQuoteItem, type StoredLineRecurring, StorefrontQuoteClient, type SubscriptionInterval, type SubscriptionIntervalUnit, type TaxLine, type TaxLineInput, ThrottleApiError, type UpdateCartInput, type UpdateCartSessionInput, type UpdateLineItemInput, cartErrorFromResponse };
1132
+ export { type AddLineItemInput, type AddResolvedLineItemInput, AmountTooLargeError, type AppliedDiscount, type Cart, type CartAddress, type CartBranding, CartChangedError, CartClient, type CartErrorArgs, type CartEvent, CartNotFoundError, CartNotOpenError, type CartPricesChangedDetails, CartPricesChangedError, type CartSession, type CartSessionCart, CartSessionClient, type CartSessionClientOptions, type CartSessionSummary, type CartShippingChange, CartTimeoutError, type CheckoutHandoff, type CheckoutHandoffInput, type CheckoutInput, type CreateCartInput, type CreateCartSessionInput, CurrencyLockedError, CurrencyNotAvailableInProductionError, type CurrencyNotEnabledDetails, CurrencyNotEnabledError, CurrencyNotPayableError, CurrencyNotSupportedError, DiscountCurrencyUnsupportedError, type ExternalShippingTaxSnapshotInput, type LegacyLineRecurring, type LineItem, type LineLimitReachedDetails, LineLimitReachedError, type LineNotPurchasableDetails, LineNotPurchasableError, type LineRecurringInput, type LineResolution, type LineResolverNotAvailableDetails, LineResolverNotAvailableError, type LineResolverUnavailableDetails, LineResolverUnavailableError, type Order, type PriceLockedDetails, PriceLockedError, type QuantityUnavailableDetails, QuantityUnavailableError, QuoteAmountsNeedReviewError, type RefusedCartLine, ResolvedLinesRequiredError, type SelectShippingInput, type SelectShippingMethodInput, type SelectedShipping, ShippingCurrencyUnsupportedError, ShippingMethodUnavailableError, ShippingQuoteUnavailableError, type ShippingTaxAddress, type ShippingTaxCalculationResponse, type ShippingTaxCartCalculateInput, type ShippingTaxMethod, type ShippingTaxQuoteInput, type ShippingTaxQuoteItem, type StoredLineRecurring, StorefrontQuoteClient, type SubscriptionInterval, type SubscriptionIntervalUnit, type TaxLine, type TaxLineInput, ThrottleApiError, type UpdateCartInput, type UpdateCartSessionInput, type UpdateLineItemInput, cartErrorFromResponse };
package/dist/index.d.ts CHANGED
@@ -1096,6 +1096,16 @@ declare class CurrencyNotSupportedError extends ThrottleApiError {
1096
1096
  declare class CurrencyNotAvailableInProductionError extends ThrottleApiError {
1097
1097
  constructor(args: CartErrorArgs);
1098
1098
  }
1099
+ /**
1100
+ * `422 currency_not_payable`: the store cannot take payment in this currency
1101
+ * (payment path). `details` is `{ currency, payableCurrencies }`; a missing or
1102
+ * malformed `details` yields `currency: null` and `payableCurrencies: []`.
1103
+ */
1104
+ declare class CurrencyNotPayableError extends ThrottleApiError {
1105
+ readonly currency: string | null;
1106
+ readonly payableCurrencies: string[];
1107
+ constructor(args: CartErrorArgs);
1108
+ }
1099
1109
  /** `409 currency_locked`: the main currency can't change after the first production sale. */
1100
1110
  declare class CurrencyLockedError extends ThrottleApiError {
1101
1111
  constructor(args: CartErrorArgs);
@@ -1119,4 +1129,4 @@ declare function cartErrorFromResponse(args: {
1119
1129
  responseHeaders?: ThrottleErrorArgs['responseHeaders'];
1120
1130
  }): ThrottleApiError;
1121
1131
 
1122
- export { type AddLineItemInput, type AddResolvedLineItemInput, AmountTooLargeError, type AppliedDiscount, type Cart, type CartAddress, type CartBranding, CartChangedError, CartClient, type CartErrorArgs, type CartEvent, CartNotFoundError, CartNotOpenError, type CartPricesChangedDetails, CartPricesChangedError, type CartSession, type CartSessionCart, CartSessionClient, type CartSessionClientOptions, type CartSessionSummary, type CartShippingChange, CartTimeoutError, type CheckoutHandoff, type CheckoutHandoffInput, type CheckoutInput, type CreateCartInput, type CreateCartSessionInput, CurrencyLockedError, CurrencyNotAvailableInProductionError, type CurrencyNotEnabledDetails, CurrencyNotEnabledError, CurrencyNotSupportedError, DiscountCurrencyUnsupportedError, type ExternalShippingTaxSnapshotInput, type LegacyLineRecurring, type LineItem, type LineLimitReachedDetails, LineLimitReachedError, type LineNotPurchasableDetails, LineNotPurchasableError, type LineRecurringInput, type LineResolution, type LineResolverNotAvailableDetails, LineResolverNotAvailableError, type LineResolverUnavailableDetails, LineResolverUnavailableError, type Order, type PriceLockedDetails, PriceLockedError, type QuantityUnavailableDetails, QuantityUnavailableError, QuoteAmountsNeedReviewError, type RefusedCartLine, ResolvedLinesRequiredError, type SelectShippingInput, type SelectShippingMethodInput, type SelectedShipping, ShippingCurrencyUnsupportedError, ShippingMethodUnavailableError, ShippingQuoteUnavailableError, type ShippingTaxAddress, type ShippingTaxCalculationResponse, type ShippingTaxCartCalculateInput, type ShippingTaxMethod, type ShippingTaxQuoteInput, type ShippingTaxQuoteItem, type StoredLineRecurring, StorefrontQuoteClient, type SubscriptionInterval, type SubscriptionIntervalUnit, type TaxLine, type TaxLineInput, ThrottleApiError, type UpdateCartInput, type UpdateCartSessionInput, type UpdateLineItemInput, cartErrorFromResponse };
1132
+ export { type AddLineItemInput, type AddResolvedLineItemInput, AmountTooLargeError, type AppliedDiscount, type Cart, type CartAddress, type CartBranding, CartChangedError, CartClient, type CartErrorArgs, type CartEvent, CartNotFoundError, CartNotOpenError, type CartPricesChangedDetails, CartPricesChangedError, type CartSession, type CartSessionCart, CartSessionClient, type CartSessionClientOptions, type CartSessionSummary, type CartShippingChange, CartTimeoutError, type CheckoutHandoff, type CheckoutHandoffInput, type CheckoutInput, type CreateCartInput, type CreateCartSessionInput, CurrencyLockedError, CurrencyNotAvailableInProductionError, type CurrencyNotEnabledDetails, CurrencyNotEnabledError, CurrencyNotPayableError, CurrencyNotSupportedError, DiscountCurrencyUnsupportedError, type ExternalShippingTaxSnapshotInput, type LegacyLineRecurring, type LineItem, type LineLimitReachedDetails, LineLimitReachedError, type LineNotPurchasableDetails, LineNotPurchasableError, type LineRecurringInput, type LineResolution, type LineResolverNotAvailableDetails, LineResolverNotAvailableError, type LineResolverUnavailableDetails, LineResolverUnavailableError, type Order, type PriceLockedDetails, PriceLockedError, type QuantityUnavailableDetails, QuantityUnavailableError, QuoteAmountsNeedReviewError, type RefusedCartLine, ResolvedLinesRequiredError, type SelectShippingInput, type SelectShippingMethodInput, type SelectedShipping, ShippingCurrencyUnsupportedError, ShippingMethodUnavailableError, ShippingQuoteUnavailableError, type ShippingTaxAddress, type ShippingTaxCalculationResponse, type ShippingTaxCartCalculateInput, type ShippingTaxMethod, type ShippingTaxQuoteInput, type ShippingTaxQuoteItem, type StoredLineRecurring, StorefrontQuoteClient, type SubscriptionInterval, type SubscriptionIntervalUnit, type TaxLine, type TaxLineInput, ThrottleApiError, type UpdateCartInput, type UpdateCartSessionInput, type UpdateLineItemInput, cartErrorFromResponse };
package/dist/index.js CHANGED
@@ -178,6 +178,17 @@ var CurrencyNotAvailableInProductionError = class extends ThrottleApiError {
178
178
  this.name = "CurrencyNotAvailableInProductionError";
179
179
  }
180
180
  };
181
+ var CurrencyNotPayableError = class extends ThrottleApiError {
182
+ currency;
183
+ payableCurrencies;
184
+ constructor(args) {
185
+ super(coded("currency_not_payable", 422, args));
186
+ this.name = "CurrencyNotPayableError";
187
+ const d = args.details;
188
+ this.currency = str(d?.currency);
189
+ this.payableCurrencies = Array.isArray(d?.payableCurrencies) ? d.payableCurrencies.filter((c) => typeof c === "string") : [];
190
+ }
191
+ };
181
192
  var CurrencyLockedError = class extends ThrottleApiError {
182
193
  constructor(args) {
183
194
  super(coded("currency_locked", 409, args));
@@ -208,6 +219,7 @@ var RESOLVED_CART_ERRORS = {
208
219
  shipping_currency_unsupported: ShippingCurrencyUnsupportedError,
209
220
  currency_not_supported: CurrencyNotSupportedError,
210
221
  currency_not_available_in_production: CurrencyNotAvailableInProductionError,
222
+ currency_not_payable: CurrencyNotPayableError,
211
223
  currency_locked: CurrencyLockedError,
212
224
  quote_amounts_need_review: QuoteAmountsNeedReviewError
213
225
  };
@@ -641,6 +653,7 @@ export {
641
653
  CurrencyLockedError,
642
654
  CurrencyNotAvailableInProductionError,
643
655
  CurrencyNotEnabledError,
656
+ CurrencyNotPayableError,
644
657
  CurrencyNotSupportedError,
645
658
  DiscountCurrencyUnsupportedError,
646
659
  LineLimitReachedError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usethrottle/cart",
3
- "version": "3.17.0",
3
+ "version": "3.18.0",
4
4
  "description": "Typed REST client for the Throttle Cart API.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -19,7 +19,7 @@
19
19
  ],
20
20
  "dependencies": {
21
21
  "@usethrottle/errors": "^1.1.0",
22
- "@usethrottle/money": "^1.0.0"
22
+ "@usethrottle/money": "^1.1.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "tsup": "^8.0.0",