@usethrottle/cart 1.0.0 → 2.0.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/README.md CHANGED
@@ -95,8 +95,10 @@ const estimate = await quotes.quote({
95
95
  });
96
96
  ```
97
97
 
98
- For provider-owned totals, set the store to `provider_totals` mode and push the
99
- final snapshot from your backend:
98
+ For provider-owned totals, set the store to `byo` mode on the shipping or tax
99
+ axis (or both) and push the final snapshot through
100
+ `/api/v1/shipping-tax/external-snapshots`. Throttle accepts external pushes
101
+ when at least one axis is in `byo` mode:
100
102
 
101
103
  ```ts
102
104
  await client.shippingTax.pushExternalSnapshot({
package/dist/index.d.cts CHANGED
@@ -57,8 +57,9 @@ interface SelectedShipping {
57
57
  estimatedDeliveryDays: number | null;
58
58
  }
59
59
  interface AppliedDiscount {
60
+ discountId?: string | null;
60
61
  code: string;
61
- type: 'percentage' | 'fixed_amount' | 'free_shipping' | 'buy_x_get_y';
62
+ type: 'percentage' | 'fixed_amount';
62
63
  amount: number;
63
64
  currency: string;
64
65
  freeShipping: boolean;
@@ -212,7 +213,7 @@ interface ShippingTaxCalculationResponse {
212
213
  snapshotId?: string;
213
214
  kind: 'quote' | 'cart_estimate' | 'checkout_final' | 'external_snapshot';
214
215
  status: 'estimated' | 'final' | 'failed';
215
- source: 'throttle_engine' | 'provider_totals' | 'external_push';
216
+ source: 'off' | 'byo' | 'calculated' | 'app_based' | 'external_push';
216
217
  storeId: string;
217
218
  merchantId?: string;
218
219
  currency: string;
package/dist/index.d.ts CHANGED
@@ -57,8 +57,9 @@ interface SelectedShipping {
57
57
  estimatedDeliveryDays: number | null;
58
58
  }
59
59
  interface AppliedDiscount {
60
+ discountId?: string | null;
60
61
  code: string;
61
- type: 'percentage' | 'fixed_amount' | 'free_shipping' | 'buy_x_get_y';
62
+ type: 'percentage' | 'fixed_amount';
62
63
  amount: number;
63
64
  currency: string;
64
65
  freeShipping: boolean;
@@ -212,7 +213,7 @@ interface ShippingTaxCalculationResponse {
212
213
  snapshotId?: string;
213
214
  kind: 'quote' | 'cart_estimate' | 'checkout_final' | 'external_snapshot';
214
215
  status: 'estimated' | 'final' | 'failed';
215
- source: 'throttle_engine' | 'provider_totals' | 'external_push';
216
+ source: 'off' | 'byo' | 'calculated' | 'app_based' | 'external_push';
216
217
  storeId: string;
217
218
  merchantId?: string;
218
219
  currency: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usethrottle/cart",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "Typed REST client for the Throttle Cart API.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -13,10 +13,12 @@
13
13
  "require": "./dist/index.cjs"
14
14
  }
15
15
  },
16
- "files": [
17
- "dist",
18
- "README.md"
19
- ],
16
+ "files": ["dist", "README.md"],
17
+ "scripts": {
18
+ "build": "tsup",
19
+ "test": "vitest run",
20
+ "typecheck": "tsc --noEmit"
21
+ },
20
22
  "devDependencies": {
21
23
  "tsup": "^8.0.0",
22
24
  "vitest": "^2.1.9",
@@ -24,10 +26,5 @@
24
26
  },
25
27
  "publishConfig": {
26
28
  "access": "public"
27
- },
28
- "scripts": {
29
- "build": "tsup",
30
- "test": "vitest run",
31
- "typecheck": "tsc --noEmit"
32
29
  }
33
- }
30
+ }