@usethrottle/cart 3.21.0 → 3.22.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.cts +14 -1
- package/dist/index.d.ts +14 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -49,6 +49,10 @@ interface Cart {
|
|
|
49
49
|
shippingTotal: number;
|
|
50
50
|
/** What a free-shipping code took off shipping, in minor units (0 when none). Original shipping is `shippingTotal + shippingDiscountTotal`. */
|
|
51
51
|
shippingDiscountTotal?: number;
|
|
52
|
+
/** Order fees in `total`, in minor units (0 when none). Absent from servers that predate fees. */
|
|
53
|
+
feeTotal?: number;
|
|
54
|
+
/** The fee rows behind `feeTotal` a buyer sees: only rows that charge something. Render after shipping, before tax. */
|
|
55
|
+
fees?: CartFee[];
|
|
52
56
|
total: number;
|
|
53
57
|
netN: number | null;
|
|
54
58
|
billingAddress: CartAddress | null;
|
|
@@ -87,6 +91,11 @@ interface Cart {
|
|
|
87
91
|
* compatibility with `@usethrottle/cart`'s original (order-snapshot-shaped)
|
|
88
92
|
* cart-session response.
|
|
89
93
|
*/
|
|
94
|
+
/** One order fee as a buyer sees it: a server-built label (`Processing fee (2.5%)`) and its amount in minor units. */
|
|
95
|
+
interface CartFee {
|
|
96
|
+
label: string;
|
|
97
|
+
amount: number;
|
|
98
|
+
}
|
|
90
99
|
interface CartSessionCart extends Omit<Cart, 'workspaceId'> {
|
|
91
100
|
cartId: string;
|
|
92
101
|
/**
|
|
@@ -589,7 +598,11 @@ interface ShippingTaxCalculationResponse {
|
|
|
589
598
|
total: number;
|
|
590
599
|
/** What a free-shipping code took off shipping; present only on a cart holding one. */
|
|
591
600
|
shippingDiscountTotal?: number;
|
|
601
|
+
/** Order fees in `total` (0 when none); absent from servers that predate fees. */
|
|
602
|
+
feeTotal?: number;
|
|
592
603
|
};
|
|
604
|
+
/** The fee rows behind `totals.feeTotal` a buyer sees (amount above 0); absent from servers that predate fees. */
|
|
605
|
+
fees?: CartFee[];
|
|
593
606
|
/** The cart's free-shipping code and how it stands; absent on a cart holding none. */
|
|
594
607
|
appliedShippingDiscount?: AppliedShippingDiscount | null;
|
|
595
608
|
/**
|
|
@@ -1229,4 +1242,4 @@ declare function cartErrorFromResponse(args: {
|
|
|
1229
1242
|
responseHeaders?: ThrottleErrorArgs['responseHeaders'];
|
|
1230
1243
|
}): ThrottleApiError;
|
|
1231
1244
|
|
|
1232
|
-
export { type AddLineItemInput, type AddResolvedLineItemInput, AmountTooLargeError, type AppliedDiscount, type AppliedShippingDiscount, type AppliedShippingDiscountStatus, 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, type RemoveDiscountOptions, ResolvedLinesRequiredError, type SelectShippingInput, type SelectShippingMethodInput, type SelectedShipping, ShippingCurrencyUnsupportedError, ShippingMethodUnavailableError, ShippingQuoteUnavailableError, type ShippingTarget, 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 };
|
|
1245
|
+
export { type AddLineItemInput, type AddResolvedLineItemInput, AmountTooLargeError, type AppliedDiscount, type AppliedShippingDiscount, type AppliedShippingDiscountStatus, type Cart, type CartAddress, type CartBranding, CartChangedError, CartClient, type CartErrorArgs, type CartEvent, type CartFee, 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, type RemoveDiscountOptions, ResolvedLinesRequiredError, type SelectShippingInput, type SelectShippingMethodInput, type SelectedShipping, ShippingCurrencyUnsupportedError, ShippingMethodUnavailableError, ShippingQuoteUnavailableError, type ShippingTarget, 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
|
@@ -49,6 +49,10 @@ interface Cart {
|
|
|
49
49
|
shippingTotal: number;
|
|
50
50
|
/** What a free-shipping code took off shipping, in minor units (0 when none). Original shipping is `shippingTotal + shippingDiscountTotal`. */
|
|
51
51
|
shippingDiscountTotal?: number;
|
|
52
|
+
/** Order fees in `total`, in minor units (0 when none). Absent from servers that predate fees. */
|
|
53
|
+
feeTotal?: number;
|
|
54
|
+
/** The fee rows behind `feeTotal` a buyer sees: only rows that charge something. Render after shipping, before tax. */
|
|
55
|
+
fees?: CartFee[];
|
|
52
56
|
total: number;
|
|
53
57
|
netN: number | null;
|
|
54
58
|
billingAddress: CartAddress | null;
|
|
@@ -87,6 +91,11 @@ interface Cart {
|
|
|
87
91
|
* compatibility with `@usethrottle/cart`'s original (order-snapshot-shaped)
|
|
88
92
|
* cart-session response.
|
|
89
93
|
*/
|
|
94
|
+
/** One order fee as a buyer sees it: a server-built label (`Processing fee (2.5%)`) and its amount in minor units. */
|
|
95
|
+
interface CartFee {
|
|
96
|
+
label: string;
|
|
97
|
+
amount: number;
|
|
98
|
+
}
|
|
90
99
|
interface CartSessionCart extends Omit<Cart, 'workspaceId'> {
|
|
91
100
|
cartId: string;
|
|
92
101
|
/**
|
|
@@ -589,7 +598,11 @@ interface ShippingTaxCalculationResponse {
|
|
|
589
598
|
total: number;
|
|
590
599
|
/** What a free-shipping code took off shipping; present only on a cart holding one. */
|
|
591
600
|
shippingDiscountTotal?: number;
|
|
601
|
+
/** Order fees in `total` (0 when none); absent from servers that predate fees. */
|
|
602
|
+
feeTotal?: number;
|
|
592
603
|
};
|
|
604
|
+
/** The fee rows behind `totals.feeTotal` a buyer sees (amount above 0); absent from servers that predate fees. */
|
|
605
|
+
fees?: CartFee[];
|
|
593
606
|
/** The cart's free-shipping code and how it stands; absent on a cart holding none. */
|
|
594
607
|
appliedShippingDiscount?: AppliedShippingDiscount | null;
|
|
595
608
|
/**
|
|
@@ -1229,4 +1242,4 @@ declare function cartErrorFromResponse(args: {
|
|
|
1229
1242
|
responseHeaders?: ThrottleErrorArgs['responseHeaders'];
|
|
1230
1243
|
}): ThrottleApiError;
|
|
1231
1244
|
|
|
1232
|
-
export { type AddLineItemInput, type AddResolvedLineItemInput, AmountTooLargeError, type AppliedDiscount, type AppliedShippingDiscount, type AppliedShippingDiscountStatus, 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, type RemoveDiscountOptions, ResolvedLinesRequiredError, type SelectShippingInput, type SelectShippingMethodInput, type SelectedShipping, ShippingCurrencyUnsupportedError, ShippingMethodUnavailableError, ShippingQuoteUnavailableError, type ShippingTarget, 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 };
|
|
1245
|
+
export { type AddLineItemInput, type AddResolvedLineItemInput, AmountTooLargeError, type AppliedDiscount, type AppliedShippingDiscount, type AppliedShippingDiscountStatus, type Cart, type CartAddress, type CartBranding, CartChangedError, CartClient, type CartErrorArgs, type CartEvent, type CartFee, 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, type RemoveDiscountOptions, ResolvedLinesRequiredError, type SelectShippingInput, type SelectShippingMethodInput, type SelectedShipping, ShippingCurrencyUnsupportedError, ShippingMethodUnavailableError, ShippingQuoteUnavailableError, type ShippingTarget, 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 };
|