@usethrottle/cart 3.20.0 → 3.21.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
@@ -654,8 +654,8 @@ var CartSessionClient = class _CartSessionClient {
654
654
  }
655
655
  /**
656
656
  * Ask the app that prices a resolved cart to re-check every line it owns.
657
- * `changed` is true when a price, name or refusal changed. An unresolved
658
- * cart comes back unchanged. Throws `LineResolverUnavailableError` (nothing
657
+ * `changed` is true when a price, name, refusal or a catalog weight or
658
+ * dimension on a line changed. An unresolved cart comes back unchanged. Throws `LineResolverUnavailableError` (nothing
659
659
  * changed) when the app does not answer.
660
660
  */
661
661
  async refresh() {
package/dist/index.d.cts CHANGED
@@ -182,6 +182,14 @@ interface LineItem {
182
182
  subscriptionId: string | null;
183
183
  imageUrl: string | null;
184
184
  position: number;
185
+ /**
186
+ * Free-form line metadata. A line from the Product Catalog also carries the
187
+ * variant's shipping measures, set by Throttle and read-only: `weight` (kg)
188
+ * with `weightUnit`, and `length`, `width` and `height` (cm) with
189
+ * `dimensionUnit`. A key is absent when the catalog has no value for it;
190
+ * the three dimensions come together or not at all. Writing any of them
191
+ * answers `400 price_locked`.
192
+ */
185
193
  metadata: Record<string, unknown>;
186
194
  /**
187
195
  * Resolved carts only: the app's last answer for this line, or null on a
@@ -208,6 +216,13 @@ interface LineResolution {
208
216
  code: string | null;
209
217
  maxQuantity: number | null;
210
218
  minQuantity: number | null;
219
+ /**
220
+ * Present only while the line's price is a volume (bulk) tier price:
221
+ * `minQuantity` is the quantity that tier starts at. Absent otherwise.
222
+ */
223
+ bulk?: {
224
+ minQuantity: number;
225
+ };
211
226
  }
212
227
  /**
213
228
  * A line of a resolved cart: the app sets its name, price and image, so the
@@ -856,8 +871,8 @@ declare class CartSessionClient {
856
871
  addResolvedItem(input: AddResolvedLineItemInput): Promise<CartSessionCart>;
857
872
  /**
858
873
  * Ask the app that prices a resolved cart to re-check every line it owns.
859
- * `changed` is true when a price, name or refusal changed. An unresolved
860
- * cart comes back unchanged. Throws `LineResolverUnavailableError` (nothing
874
+ * `changed` is true when a price, name, refusal or a catalog weight or
875
+ * dimension on a line changed. An unresolved cart comes back unchanged. Throws `LineResolverUnavailableError` (nothing
861
876
  * changed) when the app does not answer.
862
877
  */
863
878
  refresh(): Promise<CartSessionCart & {
package/dist/index.d.ts CHANGED
@@ -182,6 +182,14 @@ interface LineItem {
182
182
  subscriptionId: string | null;
183
183
  imageUrl: string | null;
184
184
  position: number;
185
+ /**
186
+ * Free-form line metadata. A line from the Product Catalog also carries the
187
+ * variant's shipping measures, set by Throttle and read-only: `weight` (kg)
188
+ * with `weightUnit`, and `length`, `width` and `height` (cm) with
189
+ * `dimensionUnit`. A key is absent when the catalog has no value for it;
190
+ * the three dimensions come together or not at all. Writing any of them
191
+ * answers `400 price_locked`.
192
+ */
185
193
  metadata: Record<string, unknown>;
186
194
  /**
187
195
  * Resolved carts only: the app's last answer for this line, or null on a
@@ -208,6 +216,13 @@ interface LineResolution {
208
216
  code: string | null;
209
217
  maxQuantity: number | null;
210
218
  minQuantity: number | null;
219
+ /**
220
+ * Present only while the line's price is a volume (bulk) tier price:
221
+ * `minQuantity` is the quantity that tier starts at. Absent otherwise.
222
+ */
223
+ bulk?: {
224
+ minQuantity: number;
225
+ };
211
226
  }
212
227
  /**
213
228
  * A line of a resolved cart: the app sets its name, price and image, so the
@@ -856,8 +871,8 @@ declare class CartSessionClient {
856
871
  addResolvedItem(input: AddResolvedLineItemInput): Promise<CartSessionCart>;
857
872
  /**
858
873
  * Ask the app that prices a resolved cart to re-check every line it owns.
859
- * `changed` is true when a price, name or refusal changed. An unresolved
860
- * cart comes back unchanged. Throws `LineResolverUnavailableError` (nothing
874
+ * `changed` is true when a price, name, refusal or a catalog weight or
875
+ * dimension on a line changed. An unresolved cart comes back unchanged. Throws `LineResolverUnavailableError` (nothing
861
876
  * changed) when the app does not answer.
862
877
  */
863
878
  refresh(): Promise<CartSessionCart & {
package/dist/index.js CHANGED
@@ -578,8 +578,8 @@ var CartSessionClient = class _CartSessionClient {
578
578
  }
579
579
  /**
580
580
  * Ask the app that prices a resolved cart to re-check every line it owns.
581
- * `changed` is true when a price, name or refusal changed. An unresolved
582
- * cart comes back unchanged. Throws `LineResolverUnavailableError` (nothing
581
+ * `changed` is true when a price, name, refusal or a catalog weight or
582
+ * dimension on a line changed. An unresolved cart comes back unchanged. Throws `LineResolverUnavailableError` (nothing
583
583
  * changed) when the app does not answer.
584
584
  */
585
585
  async refresh() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usethrottle/cart",
3
- "version": "3.20.0",
3
+ "version": "3.21.0",
4
4
  "description": "Typed REST client for the Throttle Cart API.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -18,8 +18,8 @@
18
18
  "README.md"
19
19
  ],
20
20
  "dependencies": {
21
- "@usethrottle/errors": "^1.1.0",
22
- "@usethrottle/money": "^1.1.0"
21
+ "@usethrottle/money": "^1.1.0",
22
+ "@usethrottle/errors": "^1.1.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "tsup": "^8.0.0",