@@ -30,19 +30,17 @@ export interface CartApiContent {
3030 subscribable : RemoteSubscribable < Cart > ;
3131
3232 /** Bulk update the cart
33+ *
3334 * @param cartState the cart state to set
3435 * @returns the updated cart
35- *
36- * @throws CartNotEditableError if the cart is not currently editable.
3736 */
3837 bulkCartUpdate ( cartState : CartUpdateInput ) : Promise < Cart > ;
3938
4039 /** Apply a cart level discount
40+ *
4141 * @param type the type of discount applied (example: 'Percentage')
4242 * @param title the title attributed with the discount
4343 * @param amount the percentage or fixed monetary amount deducted with the discount. Pass in `undefined` if using discount codes.
44- *
45- * @throws CartNotEditableError if the cart is not currently editable.
4644 */
4745 applyCartDiscount (
4846 type : CartDiscountType ,
@@ -52,98 +50,83 @@ export interface CartApiContent {
5250
5351 /**
5452 * Add a code discount to the cart
55- * @param code the code for the discount to add to the cart
5653 *
57- * @throws CartNotEditableError if the cart is not currently editable.
54+ * @param code the code for the discount to add to the cart
5855 */
5956 addCartCodeDiscount ( code : string ) : Promise < void > ;
6057
6158 /**
6259 * Remove the cart discount
63- *
64- * @throws CartNotEditableError if the cart is not currently editable.
6560 */
6661 removeCartDiscount ( ) : Promise < void > ;
6762
6863 /**
6964 * Remove all cart and line item discounts
70- * @param disableAutomaticDiscounts Whether or not automatic discounts should be enabled after removing the discounts.
7165 *
72- * @throws CartNotEditableError if the cart is not currently editable .
66+ * @param disableAutomaticDiscounts Whether or not automatic discounts should be enabled after removing the discounts .
7367 */
7468 removeAllDiscounts ( disableAutomaticDiscounts : boolean ) : Promise < void > ;
7569
7670 /**
7771 * Clear the cart
78- *
79- * @throws CartNotEditableError if the cart is not currently editable.
8072 */
8173 clearCart ( ) : Promise < void > ;
8274
8375 /**
8476 * Set the customer in the cart
85- * @param customer the customer object to add to the cart
8677 *
87- * @throws CartNotEditableError if the cart is not currently editable.
78+ * @param customer the customer object to add to the cart
8879 */
8980 setCustomer ( customer : Customer ) : Promise < void > ;
9081
9182 /**
9283 * Remove the current customer from the cart
93- *
94- * @throws CartNotEditableError if the cart is not currently editable.
9584 */
9685 removeCustomer ( ) : Promise < void > ;
9786
9887 /**
9988 * Add a custom sale to the cart
89+ *
10090 * @param customSale the custom sale object to add to the cart
10191 * @returns {string } the uuid of the line item added
102- *
103- * @throws CartNotEditableError if the cart is not currently editable.
10492 */
10593 addCustomSale ( customSale : CustomSale ) : Promise < string > ;
10694
10795 /**
10896 * Add a line item by variant ID to the cart
97+ *
10998 * @param variantId the product variant's numeric ID to add to the cart
11099 * @param quantity the number of this variant to add to the cart
111100 * @returns {string } the uuid of the line item added
112- *
113- * @throws CartNotEditableError if the cart is not currently editable.
114101 */
115102 addLineItem ( variantId : number , quantity : number ) : Promise < string > ;
116103
117104 /**
118105 * Remove the line item at this uuid from the cart
119- * @param uuid the uuid of the line item that should be removed
120106 *
121- * @throws CartNotEditableError if the cart is not currently editable.
107+ * @param uuid the uuid of the line item that should be removed
122108 */
123109 removeLineItem ( uuid : string ) : Promise < void > ;
124110
125111 /**
126112 * Adds custom properties to the cart
127- * @param properties the custom key to value object to attribute to the cart
128113 *
129- * @throws CartNotEditableError if the cart is not currently editable.
114+ * @param properties the custom key to value object to attribute to the cart
130115 */
131116 addCartProperties ( properties : Record < string , string > ) : Promise < void > ;
132117
133118 /**
134119 * Removes the specified cart properties
135- * @param keys the collection of keys to be removed from the cart properties
136120 *
137- * @throws CartNotEditableError if the cart is not currently editable.
121+ * @param keys the collection of keys to be removed from the cart properties
138122 */
139123 removeCartProperties ( keys : string [ ] ) : Promise < void > ;
140124
141125 /**
142126 * Adds custom properties to the specified line item
127+ *
143128 * @param uuid the uuid of the line item to which the properties should be stringd
144129 * @param properties the custom key to value object to attribute to the line item
145- *
146- * @throws CartNotEditableError if the cart is not currently editable.
147130 */
148131 addLineItemProperties (
149132 uuid : string ,
@@ -152,31 +135,28 @@ export interface CartApiContent {
152135
153136 /**
154137 * Adds custom properties to multiple line items at the same time.
155- * @param lineItemProperties the collection of custom line item properties to apply to their respective line items.
156138 *
157- * @throws CartNotEditableError if the cart is not currently editable .
139+ * @param lineItemProperties the collection of custom line item properties to apply to their respective line items .
158140 */
159141 bulkAddLineItemProperties (
160142 lineItemProperties : SetLineItemPropertiesInput [ ] ,
161143 ) : Promise < void > ;
162144
163145 /**
164146 * Removes the specified line item properties
147+ *
165148 * @param uuid the uuid of the line item to which the properties should be removed
166149 * @param keys the collection of keys to be removed from the line item properties
167- *
168- * @throws CartNotEditableError if the cart is not currently editable.
169150 */
170151 removeLineItemProperties ( uuid : string , keys : string [ ] ) : Promise < void > ;
171152
172153 /**
173154 * Add a discount on a line item to the cart
155+ *
174156 * @param uuid the uuid of the line item that should receive a discount
175157 * @param type the type of discount applied (example: 'Percentage')
176158 * @param title the title attributed with the discount
177159 * @param amount the percentage or fixed monetary amount deducted with the discout
178- *
179- * @throws CartNotEditableError if the cart is not currently editable.
180160 */
181161 setLineItemDiscount (
182162 uuid : string ,
@@ -187,28 +167,25 @@ export interface CartApiContent {
187167
188168 /**
189169 * Set line item discounts to multiple line items at the same time.
190- * @param lineItemDiscounts a map of discounts to add. They key is the uuid of the line item you want to add the discount to. The value is the discount input.
191170 *
192- * @throws CartNotEditableError if the cart is not currently editable .
171+ * @param lineItemDiscounts a map of discounts to add. They key is the uuid of the line item you want to add the discount to. The value is the discount input .
193172 */
194173 bulkSetLineItemDiscounts (
195174 lineItemDiscounts : SetLineItemDiscountInput [ ] ,
196175 ) : Promise < void > ;
197176
198177 /**
199178 * Sets an attributed staff to all line items in the cart.
200- * @param staffId the ID of the staff. Providing undefined will clear the attributed staff from all line items.
201179 *
202- * @throws CartNotEditableError if the cart is not currently editable .
180+ * @param staffId the ID of the staff. Providing undefined will clear the attributed staff from all line items .
203181 */
204182 setAttributedStaff ( staffId : number | undefined ) : Promise < void > ;
205183
206184 /**
207185 * Sets an attributed staff to a specific line items in the cart.
186+ *
208187 * @param staffId the ID of the staff. Providing undefined will clear the attributed staff on the line item.
209188 * @param lineItemUuid the UUID of the line item.
210- *
211- * @throws CartNotEditableError if the cart is not currently editable.
212189 */
213190 setAttributedStaffToLineItem (
214191 staffId : number | undefined ,
@@ -217,33 +194,29 @@ export interface CartApiContent {
217194
218195 /**
219196 * Remove all discounts from a line item
220- * @param uuid the uuid of the line item whose discounts should be removed
221197 *
222- * @throws CartNotEditableError if the cart is not currently editable.
198+ * @param uuid the uuid of the line item whose discounts should be removed
223199 */
224200 removeLineItemDiscount ( uuid : string ) : Promise < void > ;
225201
226202 /**
227203 * Add an address to the customer (Customer must be present)
228- * @param address the address object to add to the customer in cart
229204 *
230- * @throws CartNotEditableError if the cart is not currently editable.
205+ * @param address the address object to add to the customer in cart
231206 */
232207 addAddress ( address : Address ) : Promise < void > ;
233208
234209 /**
235210 * Delete an address from the customer (Customer must be present)
236- * @param addressId the address ID to delete
237211 *
238- * @throws CartNotEditableError if the cart is not currently editable.
212+ * @param addressId the address ID to delete
239213 */
240214 deleteAddress ( addressId : number ) : Promise < void > ;
241215
242216 /**
243217 * Update the default address for the customer (Customer must be present)
244- * @param addressId the address ID to set as the default address
245218 *
246- * @throws CartNotEditableError if the cart is not currently editable.
219+ * @param addressId the address ID to set as the default address
247220 */
248221 updateDefaultAddress ( addressId : number ) : Promise < void > ;
249222}
0 commit comments