@djust-b2b/djust-front-sdk 1.15.1 → 1.16.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.
@@ -17,31 +17,21 @@ const fetch_instance_1 = require("../../settings/fetch-instance");
17
17
  * CART ENDPOINT
18
18
  */
19
19
  /**
20
- * APICODE(cART135)
21
- * Deletes all carts associated with the user.
20
+ * 🛒 Deletes all carts associated with the user.
22
21
  *
23
22
  * This function sends a request to delete all carts of the logged-in user.
24
23
  *
25
- * @returns {Promise<DeleteCartsResponse>} - An array of objects containing details about the deleted carts.
24
+ * 🛠 **Endpoint**: `DELETE /v2/shop/carts [cART135]`
26
25
  *
27
- * @example
28
- * #### input
29
- * ```typescript
26
+ * 📤 **Returns**:
27
+ * A `Promise` resolving to an array of `DeleteCartsResponse` objects, containing the details of the deleted carts.
28
+ *
29
+ * 🛠 **Example usage**:
30
+ * ```ts
30
31
  * const deletedCarts = await deleteCarts();
31
32
  * ```
32
- * #### output
33
- * ```json
34
- * [
35
- * {
36
- * "id": "cart1",
37
- * "detail": "Deleted successfully"
38
- * },
39
- * {
40
- * "id": "cart2",
41
- * "detail": "Deleted successfully"
42
- * }
43
- * ]
44
- * ```
33
+ *
34
+ * @returns {Promise<DeleteCartsResponse>} - An array of objects containing the details of the deleted carts.
45
35
  */
46
36
  async function deleteCarts() {
47
37
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
@@ -51,50 +41,34 @@ async function deleteCarts() {
51
41
  return data;
52
42
  }
53
43
  /**
54
- * APICODE(cART550)
55
- * Retrieves all active carts of the logged-in user.
44
+ * 🛒 Retrieves all active carts of the logged-in user.
56
45
  *
57
46
  * This function allows fetching the list of active carts based on the provided parameters.
58
47
  *
59
- * @param {GetCartsParameters} params - The parameters for retrieving the carts, including:
60
- * #### currency - `string` | <strong style={{ color: 'red' }}>required</strong>
48
+ * 🛠 **Endpoint**: `GET /v2/shop/carts [cART550]`
61
49
  *
62
- * The currency in which to display the carts.
63
- * #### pageable - `object` | <strong style={{ color: 'red' }}>required</strong>
50
+ * | Parameter | Type | Required | Description |
51
+ * |------------------|----------------------|------------|------------------------------------------------------------|
52
+ * | `currency` | `string` | ✅ | The currency in which to display the carts. |
53
+ * | `pageable` | `object` | ✅ | The pagination parameters. |
54
+ * | `status` | `string[]` | ❌ | The status of the carts to retrieve. |
55
+ * | `type` | `string[]` | ❌ | The type of carts to retrieve. |
64
56
  *
65
- * The pagination parameters.
66
- * #### status - `string[]` | <strong style={{ color: 'red' }}>required</strong>
57
+ * 📤 **Returns**:
58
+ * A `Promise` resolving to a `GetCartsResponse` object, containing the list of carts and pagination information.
67
59
  *
68
- * The status of the carts to retrieve.
69
- * #### type - `string[]` | <strong style={{ color: 'red' }}>required</strong>
60
+ * 🛠 **Example usage**:
61
+ * ```ts
62
+ * const carts = await getCarts({ currency: 'USD', pageable: { page: 1, size: 10 } });
63
+ * ```
70
64
  *
71
- * The type of carts to retrieve.
65
+ * @param {GetCartsParameters} params - The parameters for retrieving the carts, including:
66
+ * - `currency` - The currency in which to display the carts.
67
+ * - `pageable` - The pagination parameters.
68
+ * - `status` - The status of the carts to retrieve.
69
+ * - `type` - The type of carts to retrieve.
72
70
  *
73
71
  * @returns {Promise<GetCartsResponse>} - An object containing the list of carts and pagination information.
74
- *
75
- * @example
76
- * #### input
77
- * ```typescript
78
- * const carts = await getCarts({ currency: 'USD', pageable: { page: 1, size: 10 } });
79
- * ```
80
- * #### output
81
- * ```json
82
- * {
83
- * carts: [
84
- * {
85
- * id: 'cart1',
86
- * name: 'My Cart'
87
- * },
88
- * {
89
- * id: 'cart2',
90
- * name: 'Another Cart'
91
- * }
92
- * ],
93
- * page: 1,
94
- * size: 10,
95
- * totalElement: 2
96
- * }
97
- * ```
98
72
  */
99
73
  async function getCarts(params) {
100
74
  const { currency, pageable, status, type } = params;
@@ -112,32 +86,33 @@ async function getCarts(params) {
112
86
  return data;
113
87
  }
114
88
  /**
115
- * APICODE(cART100)
116
- * Creates a new cart.
89
+ * 🛒 Creates a new cart.
117
90
  *
118
91
  * This function sends a request to create a new cart with the specified name.
119
92
  *
120
- * @param {CreateCartParameters} params - The parameters for creating the cart, including:
121
- * #### name - `string` | <strong style={{ color: 'red' }}>required</strong>
93
+ * 🛠 **Endpoint**: `POST /v2/shop/carts [cART100]`
122
94
  *
123
- * The name of the cart to create.
95
+ * | Parameter | Type | Required | Description |
96
+ * |------------|----------|------------|---------------------------------|
97
+ * | `name` | `string` | ✅ | The name of the cart to create. |
124
98
  *
125
- * @returns {Promise<GetCartResponse>} - A promise that resolves when the cart is created.
99
+ * 📤 **Returns**:
100
+ * A `Promise` resolving to a `GetCartResponse` object, confirming the creation of the cart.
126
101
  *
127
- * @example
128
- * #### input
129
- * ```typescript
102
+ * 🛠 **Example usage**:
103
+ * ```ts
130
104
  * await createCart({ name: 'New Cart' });
131
105
  * ```
132
- * #### output
133
- * ```json
134
- * {
135
- * "message": "Cart created successfully"
136
- * }
137
- * ```
106
+ *
107
+ * @param {CreateCartParameters} params - The parameters for creating the cart:
108
+ * - `name` - The name of the cart to create.
109
+ *
110
+ * @returns {Promise<GetCartResponse>} - A promise that resolves when the cart is created.
138
111
  */
139
112
  async function createCart(params) {
140
113
  const { name } = params;
114
+ // Ensure required parameter is present
115
+ (0, parameters_validation_1.required)({ name });
141
116
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
142
117
  method: "POST",
143
118
  path: `/v2/shop/carts`,
@@ -146,79 +121,69 @@ async function createCart(params) {
146
121
  return data;
147
122
  }
148
123
  /**
149
- * APICODE(cART300)
150
- * Deletes a specific cart.
124
+ * 🗑️ Deletes a specific cart.
151
125
  *
152
126
  * This function sends a request to delete the cart identified by its ID.
153
127
  *
154
- * @param {DeleteCartParameters} params - The parameters to identify the cart to delete, including:
155
- * #### cartId - `string` | <strong style={{ color: 'red' }}>required</strong>
128
+ * 🛠 **Endpoint**: `DELETE /v2/shop/carts/{cartId} [cART300]`
156
129
  *
157
- * The ID of the cart to delete.
130
+ * | Parameter | Type | Required | Description |
131
+ * |------------|----------|------------|----------------------------------|
132
+ * | `cartId` | `string` | ✅ | The ID of the cart to delete. |
158
133
  *
159
- * @returns {Promise<void>} - A promise that resolves when the cart is deleted.
134
+ * 📤 **Returns**:
135
+ * A `Promise<void>` that resolves when the cart is successfully deleted.
160
136
  *
161
- * @example
162
- * #### input
163
- * ```typescript
137
+ * 🛠 **Example usage**:
138
+ * ```ts
164
139
  * await deleteCart({ cartId: 'cart1' });
165
140
  * ```
166
- * #### output
167
- * ```json
168
- * {
169
- * "message": "Cart deleted successfully"
170
- * }
171
- * ```
141
+ *
142
+ * @param {DeleteCartParameters} params - The parameters to identify the cart to delete:
143
+ * - `cartId` - The ID of the cart to delete.
144
+ *
145
+ * @returns {Promise<void>} - A promise that resolves when the cart is deleted.
172
146
  */
173
147
  async function deleteCart(params) {
174
148
  const { cartId } = params;
149
+ // Ensure required parameter is present
175
150
  (0, parameters_validation_1.required)({ cartId });
176
- (0, fetch_instance_1.enhancedFetch)({
151
+ await (0, fetch_instance_1.enhancedFetch)({
177
152
  method: "DELETE",
178
153
  path: `/v2/shop/carts/${cartId}`,
179
154
  });
180
155
  }
181
156
  /**
182
- * APICODE(cART500)
183
- * Retrieves the details of a specific cart.
157
+ * 🛒 Retrieves the details of a specific cart.
184
158
  *
185
159
  * This function allows fetching the information of a cart based on its ID.
186
160
  *
187
- * @param {GetCartParameters} params - The parameters for identifying the cart, including:
188
- * #### cartId - `string` | <strong style={{ color: 'red' }}>required</strong>
189
- *
190
- * The ID of the cart to retrieve.
191
- * #### currency - `string` | <strong style={{ color: 'red' }}>required</strong>
192
- *
193
- * The currency in which to display the cart.
194
- * #### nbFirstLines - `number[]`
161
+ * 🛠 **Endpoint**: `GET /v2/shop/carts/{cartId} [cART500]`
195
162
  *
196
- * The number of lines to retrieve.
163
+ * | Parameter | Type | Required | Description |
164
+ * |-----------------|-----------|------------|-------------------------------------------------|
165
+ * | `cartId` | `string` | ✅ | The ID of the cart to retrieve. |
166
+ * | `currency` | `string` | ✅ | The currency in which to display the cart. |
167
+ * | `nbFirstLines` | `number[]`| ❌ | The number of lines to retrieve. |
197
168
  *
198
- * @returns {Promise<GetCartResponse>} - An object containing the details of the cart.
169
+ * 📤 **Returns**:
170
+ * A `Promise<GetCartResponse>` containing the details of the requested cart.
199
171
  *
200
- * @example
201
- * #### input
202
- * ```typescript
172
+ * 🛠 **Example usage**:
173
+ * ```ts
203
174
  * const cartDetails = await getCart({ cartId: 'cart1', currency: 'USD' });
204
175
  * ```
205
- * #### output
206
- * ```json
207
- * {
208
- * "id": "cart1",
209
- * "name": "My Cart",
210
- * "totalPrice": 100,
211
- * "lines": [
212
- * {
213
- * "productName": "Product A",
214
- * "quantity": 2
215
- * }
216
- * ]
217
- * }
218
- * ```
176
+ *
177
+ * @param {GetCartParameters} params - The parameters for identifying the cart:
178
+ * - `cartId` - The ID of the cart to retrieve.
179
+ * - `currency` - The currency in which to display the cart.
180
+ * - `nbFirstLines` - (Optional) The number of lines to retrieve.
181
+ *
182
+ * @returns {Promise<GetCartResponse>} - A promise resolving to the cart details.
219
183
  */
220
184
  async function getCart(params) {
221
185
  const { cartId, currency, nbFirstLines } = params;
186
+ // Ensure required parameters are present
222
187
  (0, parameters_validation_1.required)({ cartId, currency });
223
188
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
224
189
  method: "GET",
@@ -231,35 +196,34 @@ async function getCart(params) {
231
196
  return data;
232
197
  }
233
198
  /**
234
- * APICODE(cART200)
235
- * Updates an existing cart.
199
+ * ✏️ Updates an existing cart.
236
200
  *
237
201
  * This function sends a request to update the name of a cart identified by its ID.
238
202
  *
239
- * @param {UpdateCartParameters} params - The parameters for updating the cart, including:
240
- * #### cartId - `string` | <strong style={{ color: 'red' }}>required</strong>
203
+ * 🛠 **Endpoint**: `PUT /v2/shop/carts/{cartId} [cART200]`
241
204
  *
242
- * The ID of the cart to update.
243
- * #### name - `string` | <strong style={{ color: 'red' }}>required</strong>
205
+ * | Parameter | Type | Required | Description |
206
+ * |------------|----------|------------|---------------------------------------|
207
+ * | `cartId` | `string` | ✅ | The ID of the cart to update. |
208
+ * | `name` | `string` | ✅ | The new name of the cart. |
244
209
  *
245
- * The new name of the cart.
210
+ * 📤 **Returns**:
211
+ * A `Promise<void>` that resolves when the cart is successfully updated.
246
212
  *
247
- * @returns {Promise<void>} - A promise that resolves when the cart is updated.
248
- *
249
- * @example
250
- * #### input
251
- * ```typescript
213
+ * 🛠 **Example usage**:
214
+ * ```ts
252
215
  * await updateCart({ cartId: 'cart1', name: 'Updated Cart Name' });
253
216
  * ```
254
- * #### output
255
- * ```json
256
- * {
257
- * "message": "Cart updated successfully"
258
- * }
259
- * ```
217
+ *
218
+ * @param {UpdateCartParameters} params - The parameters for updating the cart:
219
+ * - `cartId` - The ID of the cart to update.
220
+ * - `name` - The new name of the cart.
221
+ *
222
+ * @returns {Promise<void>} - A promise that resolves when the update is successful.
260
223
  */
261
224
  async function updateCart(params) {
262
225
  const { cartId, name } = params;
226
+ // Ensure required parameters are present
263
227
  (0, parameters_validation_1.required)({ cartId, name });
264
228
  (0, fetch_instance_1.enhancedFetch)({
265
229
  method: "PUT",
@@ -268,32 +232,32 @@ async function updateCart(params) {
268
232
  });
269
233
  }
270
234
  /**
271
- * APICODE(cART101)
272
- * Initializes orders from a cart.
235
+ * 🛒 Initializes orders from a cart.
273
236
  *
274
237
  * This function sends a request to initialize an order from a specified cart.
275
238
  *
276
- * @param {InitializeOrdersFromCartParameters} params - The parameters for initializing orders, including:
277
- * #### cartId - `string` | <strong style={{ color: 'red' }}>required</strong>
239
+ * 🛠 **Endpoint**: `POST /v2/shop/carts/{cartId}/initialize-orders [cART101]`
278
240
  *
279
- * The ID of the cart from which to initialize the order.
241
+ * | Parameter | Type | Required | Description |
242
+ * |------------|----------|------------|------------------------------------------|
243
+ * | `cartId` | `string` | ✅ | The ID of the cart to initialize orders. |
280
244
  *
281
- * @returns {Promise<string>} - The business ID of the commercial order if the initialization succeeds.
245
+ * 📤 **Returns**:
246
+ * A `Promise<string>` containing the business ID of the created order.
282
247
  *
283
- * @example
284
- * #### input
285
- * ```typescript
248
+ * 🛠 **Example usage**:
249
+ * ```ts
286
250
  * const orderId = await initializeOrdersFromCart({ cartId: 'cart1' });
287
251
  * ```
288
- * #### output
289
- * ```json
290
- * {
291
- * "orderId": "order123"
292
- * }
293
- * ```
252
+ *
253
+ * @param {InitializeOrdersFromCartParameters} params - Parameters for initializing orders:
254
+ * - `cartId` - The ID of the cart to initialize orders from.
255
+ *
256
+ * @returns {Promise<string>} - The business ID of the created order.
294
257
  */
295
258
  async function initializeOrdersFromCart(params) {
296
259
  const { cartId } = params;
260
+ // Ensure required parameters are present
297
261
  (0, parameters_validation_1.required)({ cartId });
298
262
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
299
263
  method: "POST",
@@ -302,39 +266,38 @@ async function initializeOrdersFromCart(params) {
302
266
  return data;
303
267
  }
304
268
  /**
305
- * CARTLINES ENDPOINT
306
- */
307
- /**
308
- * APICODE(cART350)
309
- * Deletes lines from a cart.
269
+ * 🗑️ Deletes lines from a cart.
310
270
  *
311
271
  * This function sends a request to delete specific lines from a cart.
312
272
  *
313
- * @param {DeleteCartLinesParameters} params - The parameters for deleting lines from the cart, including:
314
- * #### cartId - `string` | <strong style={{ color: 'red' }}>required</strong>
315
- *
316
- * The ID of the cart.
317
- * #### `lineIdsToDelete` - `string[]` | <strong style={{ color: 'red' }}>required</strong>
273
+ * 🛠 **Endpoint**: `DELETE /v2/shop/carts/{cartId}/lines [cART350]`
318
274
  *
319
- * The IDs of the lines to delete.
275
+ * | Parameter | Type | Required | Description |
276
+ * |--------------------|------------|------------|--------------------------------------|
277
+ * | `cartId` | `string` | ✅ | The ID of the cart. |
278
+ * | `lineIdsToDelete` | `string[]` | ✅ | The IDs of the lines to delete. |
320
279
  *
321
- * @returns {Promise<DeleteCartLinesResponse>} - An object containing information about the deleted lines.
280
+ * 📤 **Returns**:
281
+ * A `Promise<DeleteCartLinesResponse>` containing details about the deleted lines.
322
282
  *
323
- * @example
324
- * #### input
325
- * ```typescript
326
- * const response = await deleteCartLines({ cartId: 'cart1', lineIdsToDelete: ['line1', 'line2'] });
327
- * ```
328
- * #### output
329
- * ```json
330
- * {
331
- * "singleWarningReportDto": []
332
- * }
283
+ * 🛠 **Example usage**:
284
+ * ```ts
285
+ * const response = await deleteCartLines({
286
+ * cartId: 'cart1',
287
+ * lineIdsToDelete: ['line1', 'line2']
288
+ * });
333
289
  * ```
290
+ *
291
+ * @param {DeleteCartLinesParameters} params - Parameters for deleting cart lines:
292
+ * - `cartId` - The ID of the cart.
293
+ * - `lineIdsToDelete` - The IDs of the lines to delete.
294
+ *
295
+ * @returns {Promise<DeleteCartLinesResponse>} - Response with details about the deleted lines.
334
296
  */
335
297
  async function deleteCartLines(params) {
336
298
  const { cartId, lineIdsToDelete } = params;
337
- (0, parameters_validation_1.required)({ cartId });
299
+ // Ensure required parameters are present
300
+ (0, parameters_validation_1.required)({ cartId, lineIdsToDelete });
338
301
  const body = lineIdsToDelete.map((lineId) => ({ offerPriceId: lineId }));
339
302
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
340
303
  method: "DELETE",
@@ -344,64 +307,49 @@ async function deleteCartLines(params) {
344
307
  return data;
345
308
  }
346
309
  /**
347
- * APICODE(cART551)
348
- * Fetches the lines of a shopping cart based on the provided parameters.
310
+ * 📋 Fetches the lines of a shopping cart.
349
311
  *
350
312
  * This function retrieves detailed information about the items (lines) in a shopping cart.
351
313
  * It supports filtering by supplier, product variant, or offer price and handles pagination.
352
314
  *
353
- * @param {GetCartLinesParameters} params - The parameters for retrieving cart lines, including:
354
- * #### cartId - `string` | <strong style={{ color: 'red' }}>required</strong>
355
- *
356
- * The ID of the cart.
357
- * #### currency - `string` | <strong style={{ color: 'red' }}>required</strong>
358
- *
359
- * The currency in which prices should be returned (e.g., "USD").
360
- * #### pageable - `object` | <strong style={{ color: 'red' }}>required</strong>
361
- *
362
- * Pagination details, such as page number and size.
363
- * #### supplierId - `string[]`
364
- *
365
- * Filter by a specific supplier's ID.
366
- * #### productVariantId - `string[]`
315
+ * 🛠 **Endpoint**: `GET /v2/shop/carts/{cartId}/lines [cART551]`
367
316
  *
368
- * Filter by a specific product variant's ID.
369
- * #### offerPriceId - `string[]`
317
+ * | Parameter | Type | Required | Description |
318
+ * |---------------------|------------|------------|------------------------------------------|
319
+ * | `cartId` | `string` | ✅ | The ID of the cart. |
320
+ * | `currency` | `string` | ✅ | The currency in which prices are shown. |
321
+ * | `pageable` | `object` | ✅ | Pagination details (page number, size). |
322
+ * | `supplierId` | `string[]` | ❌ | Filter by specific supplier IDs. |
323
+ * | `productVariantId` | `string[]` | ❌ | Filter by specific product variants. |
324
+ * | `offerPriceId` | `string[]` | ❌ | Filter by specific offer price IDs. |
370
325
  *
371
- * Filter by a specific offer price ID.
326
+ * 📤 **Returns**:
327
+ * A `Promise<GetCartLinesResponse>` containing the lines of the cart.
372
328
  *
373
- * @returns {Promise<GetCartLinesResponse>} - A promise resolving to the response containing cart lines information.
374
- *
375
- * @example
376
- * #### input
377
- * ```typescript
329
+ * 🛠 **Example usage**:
330
+ * ```ts
378
331
  * const cartLines = await getCartLines({
379
332
  * cartId: 'cart1',
380
333
  * currency: 'USD',
381
334
  * pageable: { page: 1, size: 10 },
382
- * supplierId: ['supplier1'],
383
- * productVariantId: ['variant1'],
384
- * offerPriceId: ['offer1']
335
+ * supplierId: ['supplier1']
385
336
  * });
386
337
  * ```
387
- * #### output
388
- * ```json
389
- * {
390
- * "lines": [
391
- * {
392
- * "productName": "Product A",
393
- * "quantity": 2,
394
- * "price": 20
395
- * }
396
- * ],
397
- * "totalItems": 1,
398
- * "totalPages": 1
399
- * }
400
- * ```
338
+ *
339
+ * @param {GetCartLinesParameters} params - Parameters for fetching cart lines:
340
+ * - `cartId` - The ID of the cart.
341
+ * - `currency` - The currency for prices.
342
+ * - `pageable` - Pagination details.
343
+ * - `supplierId` (optional) - Supplier IDs for filtering.
344
+ * - `productVariantId` (optional) - Product variant IDs for filtering.
345
+ * - `offerPriceId` (optional) - Offer price IDs for filtering.
346
+ *
347
+ * @returns {Promise<GetCartLinesResponse>} - Response containing cart lines information.
401
348
  */
402
349
  async function getCartLines(params) {
403
350
  const { cartId, currency, pageable, supplierId, productVariantId, offerPriceId, } = params;
404
- (0, parameters_validation_1.required)({ cartId });
351
+ // Ensure required parameters are present
352
+ (0, parameters_validation_1.required)({ cartId, currency, pageable });
405
353
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
406
354
  method: "GET",
407
355
  path: `/v2/shop/carts/${cartId}/lines`,
@@ -416,40 +364,39 @@ async function getCartLines(params) {
416
364
  return data;
417
365
  }
418
366
  /**
419
- * APICODE(cART150)
420
- * Updates the lines of a cart.
421
- *
422
- * This function sends a request to update the lines of a specified cart.
367
+ * ✏️ Updates the lines of a cart.
423
368
  *
424
- * @param {UpdateCartLinesParameters} params - The parameters for updating the cart lines, including:
425
- * #### cartId - `string` | <strong style={{ color: 'red' }}>required</strong>
369
+ * This function sends a request to update specific lines of a shopping cart.
426
370
  *
427
- * The ID of the cart.
428
- * #### `linesToUpdate` - `object[]` | <strong style={{ color: 'red' }}>required</strong>
371
+ * 🛠 **Endpoint**: `PUT /v2/shop/carts/{cartId}/lines [cART150]`
429
372
  *
430
- * The lines to update with their details.
373
+ * | Parameter | Type | Required | Description |
374
+ * |-------------------|------------|------------|----------------------------------------|
375
+ * | `cartId` | `string` | ✅ | The ID of the cart. |
376
+ * | `linesToUpdate` | `object[]` | ✅ | Details of the lines to update. |
431
377
  *
432
- * @returns {Promise<UpdateCartLinesResponse>} - An object containing information about the updated lines.
378
+ * 📤 **Returns**:
379
+ * A `Promise<UpdateCartLinesResponse>` containing the updated lines' information.
433
380
  *
434
- * @example
435
- * #### input
436
- * ```typescript
381
+ * 🛠 **Example usage**:
382
+ * ```ts
437
383
  * const response = await updateCartLines({
438
384
  * cartId: 'cart1',
439
385
  * linesToUpdate: [
440
386
  * { offerPriceId: 'line1', quantity: 3, updateAction: 'update' }
441
- * ],
387
+ * ]
442
388
  * });
443
389
  * ```
444
- * #### output
445
- * ```json
446
- * {
447
- * "singleWarningReportDto": []
448
- * }
449
- * ```
390
+ *
391
+ * @param {UpdateCartLinesParameters} params - Parameters for updating cart lines:
392
+ * - `cartId` - The ID of the cart.
393
+ * - `linesToUpdate` - Details of the lines to update.
394
+ *
395
+ * @returns {Promise<UpdateCartLinesResponse>} - Response with details about the updated lines.
450
396
  */
451
397
  async function updateCartLines(params) {
452
398
  const { cartId, linesToUpdate } = params;
399
+ // Ensure required parameters are present
453
400
  (0, parameters_validation_1.required)({ cartId, linesToUpdate });
454
401
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
455
402
  method: "PUT",
@@ -459,40 +406,39 @@ async function updateCartLines(params) {
459
406
  return data;
460
407
  }
461
408
  /**
462
- * APICODE(cART151)
463
- * Updates the lines of a cart by variant.
409
+ * ✏️ Updates the lines of a cart by variant.
464
410
  *
465
- * This function sends a request to update the lines of a cart based on the product variant.
411
+ * This function sends a request to update cart lines based on product variants.
466
412
  *
467
- * @param {UpdateCartLinesByVariantParameters} params - The parameters for updating the cart lines by variant, including:
468
- * #### cartId - `string` | <strong style={{ color: 'red' }}>required</strong>
413
+ * 🛠 **Endpoint**: `PUT /v2/shop/carts/{cartId}/lines-by-variant [cART151]`
469
414
  *
470
- * The ID of the cart.
471
- * #### linesToUpdate - `object[]` | <strong style={{ color: 'red' }}>required</strong>
415
+ * | Parameter | Type | Required | Description |
416
+ * |-------------------|------------|------------|----------------------------------------|
417
+ * | `cartId` | `string` | ✅ | The ID of the cart. |
418
+ * | `linesToUpdate` | `object[]` | ✅ | Details of the lines to update. |
472
419
  *
473
- * The lines to update with their details.
420
+ * 📤 **Returns**:
421
+ * A `Promise<UpdateCartLinesByVariantResponse>` containing the updated lines' information.
474
422
  *
475
- * @returns {Promise<UpdateCartLinesByVariantResponse>} - An object containing information about the updated lines by variant.
476
- *
477
- * @example
478
- * #### input
479
- * ```typescript
423
+ * 🛠 **Example usage**:
424
+ * ```ts
480
425
  * const response = await updateCartLinesByVariant({
481
426
  * cartId: 'cart1',
482
427
  * linesToUpdate: [
483
428
  * { offerPriceId: 'variant1', quantity: 2, updateAction: 'update' }
484
- * ],
429
+ * ]
485
430
  * });
486
431
  * ```
487
- * #### output
488
- * ```json
489
- * {
490
- * "singleWarningReportDto": []
491
- * }
492
- * ```
432
+ *
433
+ * @param {UpdateCartLinesByVariantParameters} params - Parameters for updating cart lines by variant:
434
+ * - `cartId` - The ID of the cart.
435
+ * - `linesToUpdate` - Details of the lines to update.
436
+ *
437
+ * @returns {Promise<UpdateCartLinesByVariantResponse>} - Response with details about the updated lines by variant.
493
438
  */
494
439
  async function updateCartLinesByVariant(params) {
495
440
  const { cartId, linesToUpdate } = params;
441
+ // Ensure required parameters are present
496
442
  (0, parameters_validation_1.required)({ cartId, linesToUpdate });
497
443
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
498
444
  method: "PUT",