@djust-b2b/djust-front-sdk 1.20.6 → 1.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.
@@ -19,7 +19,7 @@ export interface DeleteCartParameters {
19
19
  }
20
20
  export interface CreateCartParameters {
21
21
  name: string;
22
- type: string;
22
+ type?: CartTypeDto;
23
23
  }
24
24
  export interface UpdateCartParameters {
25
25
  cartId: string;
@@ -111,13 +111,13 @@ async function getCarts(params) {
111
111
  * @returns {Promise<GetCartResponse>} - A promise that resolves when the cart is created.
112
112
  */
113
113
  async function createCart(params) {
114
- const { name } = params;
114
+ const { name, type } = params;
115
115
  // Ensure required parameter is present
116
116
  (0, parameters_validation_1.required)({ name });
117
117
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
118
118
  method: "POST",
119
119
  path: `/v2/shop/carts`,
120
- body: JSON.stringify({ name }),
120
+ body: JSON.stringify({ name, type: type || "CART" }),
121
121
  });
122
122
  return data;
123
123
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djust-b2b/djust-front-sdk",
3
- "version": "1.20.6",
3
+ "version": "1.21.0",
4
4
  "description": "DJUST Front SDK is a versatile JavaScript Software Development Kit (SDK) ",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",