@djust-b2b/djust-front-sdk 2.1.0 → 2.1.1

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.
Files changed (45) hide show
  1. package/lib/index.d.ts +21 -15
  2. package/lib/interfaces/models/attribute.d.ts +12 -2
  3. package/lib/interfaces/models/custom-field.d.ts +4 -0
  4. package/lib/interfaces/models/customer-account.d.ts +1 -0
  5. package/lib/interfaces/models/offer.d.ts +9 -0
  6. package/lib/interfaces/models/payment.d.ts +1 -0
  7. package/lib/services/attributes/definitions.d.ts +27 -0
  8. package/lib/services/attributes/definitions.js +2 -0
  9. package/lib/services/attributes/index.d.ts +32 -0
  10. package/lib/services/attributes/index.js +49 -0
  11. package/lib/services/auth/definitions.d.ts +39 -0
  12. package/lib/services/auth/definitions.requests.d.ts +4 -0
  13. package/lib/services/auth/index.d.ts +58 -3
  14. package/lib/services/auth/index.js +72 -2
  15. package/lib/services/cart/index.js +1 -0
  16. package/lib/services/custom-field/definitions.d.ts +6 -0
  17. package/lib/services/custom-field/index.d.ts +38 -1
  18. package/lib/services/custom-field/index.js +48 -2
  19. package/lib/services/customer-account/definitions.d.ts +15 -2
  20. package/lib/services/customer-account/index.d.ts +47 -5
  21. package/lib/services/customer-account/index.js +68 -5
  22. package/lib/services/customer-user/definitions.d.ts +2 -0
  23. package/lib/services/customer-user/index.d.ts +1 -1
  24. package/lib/services/customer-user/index.js +4 -1
  25. package/lib/services/incident/definitions.d.ts +14 -0
  26. package/lib/services/incident/index.d.ts +40 -1
  27. package/lib/services/incident/index.js +56 -0
  28. package/lib/services/logistic-order/definitions.d.ts +15 -4
  29. package/lib/services/logistic-order/index.d.ts +19 -10
  30. package/lib/services/logistic-order/index.js +40 -17
  31. package/lib/services/navigation-category/definitions.d.ts +7 -0
  32. package/lib/services/navigation-category/index.d.ts +33 -1
  33. package/lib/services/navigation-category/index.js +40 -0
  34. package/lib/services/offer-inventories/index.js +3 -3
  35. package/lib/services/offer-prices/definitions.d.ts +23 -0
  36. package/lib/services/offer-prices/definitions.js +2 -0
  37. package/lib/services/offer-prices/index.d.ts +35 -0
  38. package/lib/services/offer-prices/index.js +52 -0
  39. package/lib/services/product/definitions.d.ts +5 -0
  40. package/lib/services/product/index.d.ts +6 -29
  41. package/lib/services/product/index.js +8 -42
  42. package/lib/services/product-variant/definitions.d.ts +27 -0
  43. package/lib/services/product-variant/index.d.ts +30 -1
  44. package/lib/services/product-variant/index.js +40 -0
  45. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { CreateProductReviewParameters, CreateProductReviewResponse, GetProductOffersParameters, GetProductOffersResponse, GetProductParameters, GetProductReviewsParameters, GetProductReviewsResponse, GetProductStatReviewsParameters, GetProductStatReviewsResponse, GetProductVariantAttributesParameters, GetProductVariantAttributesResponse, GetProductVariantOffersParameters, GetProductVariantOffersResponse, GetProductVariantSuppliersParameters, GetProductVariantSuppliersResponse, GetProductVariantsListParameters, GetProductVariantsListResponse, GetProductsListParameters, GetProductsListResponse, GetRelatedProductsParameters, AutoCompleteSearchProductsParameters, SearchProductsResponse, UpdateProductReviewParameters, UpdateProductReviewResponse, GetProductPaginatedOffersParameters, GetProductPaginatedOffersResponse, GetRelatedProductsResponse } from "./definitions";
1
+ import { CreateProductReviewParameters, CreateProductReviewResponse, GetProductOffersParameters, GetProductOffersResponse, GetProductParameters, GetProductReviewsParameters, GetProductReviewsResponse, GetProductStatReviewsParameters, GetProductStatReviewsResponse, GetProductVariantAttributesParameters, GetProductVariantAttributesResponse, GetProductVariantOffersParameters, GetProductVariantOffersResponse, GetProductVariantSuppliersParameters, GetProductVariantSuppliersResponse, GetProductsListParameters, GetProductsListResponse, GetRelatedProductsParameters, AutoCompleteSearchProductsParameters, SearchProductsResponse, UpdateProductReviewParameters, UpdateProductReviewResponse, GetProductPaginatedOffersParameters, GetProductPaginatedOffersResponse, GetRelatedProductsResponse } from "./definitions";
2
2
  /**
3
3
  * 📄 Search products with a text expression for search and autocomplete.
4
4
  *
@@ -57,32 +57,6 @@ export declare function autoCompleteSearchProducts({ input, locale, currency, pa
57
57
  * ```
58
58
  */
59
59
  export declare function getProductsList({ locale, filters, pageable, }: GetProductsListParameters): Promise<GetProductsListResponse>;
60
- /**
61
- * 📄 Fetches product variants by product SKU.
62
- *
63
- * 🛠 **Endpoint**: `GET /v1/shop/product-variants`
64
- *
65
- * | Parameter | Type | Required | Description |
66
- * |-----------------|--------------|----------|--------------------------------------------|
67
- * | `productSku` | `string` | ✅ | The SKU of the product. |
68
- * | `locale` | `string` | ❌ | The locale for product variants. |
69
- * | `pageable.page` | `number` | ❌ | The page number to fetch (0-based index). |
70
- * | `pageable.size` | `number` | ❌ | The number of items per page. |
71
- *
72
- * 📤 **Returns**:
73
- * A `Promise` resolving to a `GetProductVariantsListResponse` containing the product variants.
74
- *
75
- * 🛠 **Example usage**:
76
- * ```typescript
77
- * const variants = await getProductVariantsList({
78
- * productSku: 'sku123',
79
- * locale: 'en-US',
80
- * pageable: { page: 0, size: 10 },
81
- * });
82
- * console.log(variants);
83
- * ```
84
- */
85
- export declare function getProductVariantsList({ productSku, locale, pageable, }: GetProductVariantsListParameters): Promise<GetProductVariantsListResponse>;
86
60
  /**
87
61
  * 📄 Fetches offers for a specific product variant.
88
62
  *
@@ -132,7 +106,7 @@ export declare function getProductVariantsList({ productSku, locale, pageable, }
132
106
  * }
133
107
  * ```
134
108
  */
135
- export declare function getProductVariantOffers({ productIdentifier, productIdType, currency, }: GetProductVariantOffersParameters): Promise<GetProductVariantOffersResponse>;
109
+ export declare function getProductVariantOffers({ productIdentifier, productIdType, currency, withoutPrice, }: GetProductVariantOffersParameters): Promise<GetProductVariantOffersResponse>;
136
110
  /**
137
111
  * 📄 Fetches suppliers associated with a product variant.
138
112
  *
@@ -186,6 +160,8 @@ export declare function getProductVariantSuppliers({ productVariantId, }: GetPro
186
160
  */
187
161
  export declare function getProduct({ productIdentifier, productIdType, locale, }: GetProductParameters): Promise<GetProductsListResponse>;
188
162
  /**
163
+ * @deprecated
164
+ *
189
165
  * 📄 Fetches product offers by SKU, ID, or external ID.
190
166
  *
191
167
  * 🛠 **Endpoint**: `GET /v1/shop/products/{productIdentifier}/offers`
@@ -208,8 +184,9 @@ export declare function getProduct({ productIdentifier, productIdType, locale, }
208
184
  * });
209
185
  * console.log(offers);
210
186
  * ```
187
+ * SWAGGER [PRODUCT-502]
211
188
  */
212
- export declare function getProductOffers({ productIdentifier, productIdType, locale, currency, }: GetProductOffersParameters): Promise<GetProductOffersResponse>;
189
+ export declare function getProductOffers({ productIdentifier, productIdType, locale, currency, withoutPrice, }: GetProductOffersParameters): Promise<GetProductOffersResponse>;
213
190
  /**
214
191
  * 📄 Fetches related products for a specific product.
215
192
  *
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.autoCompleteSearchProducts = autoCompleteSearchProducts;
4
4
  exports.getProductsList = getProductsList;
5
- exports.getProductVariantsList = getProductVariantsList;
6
5
  exports.getProductVariantOffers = getProductVariantOffers;
7
6
  exports.getProductVariantSuppliers = getProductVariantSuppliers;
8
7
  exports.getProduct = getProduct;
@@ -60,6 +59,7 @@ async function autoCompleteSearchProducts({ input, locale, currency, pageable, a
60
59
  productTags,
61
60
  page: pageable === null || pageable === void 0 ? void 0 : pageable.page,
62
61
  size: pageable === null || pageable === void 0 ? void 0 : pageable.size,
62
+ sort: pageable === null || pageable === void 0 ? void 0 : pageable.sort,
63
63
  },
64
64
  });
65
65
  return data;
@@ -104,45 +104,6 @@ async function getProductsList({ locale, filters, pageable, }) {
104
104
  });
105
105
  return data;
106
106
  }
107
- /**
108
- * 📄 Fetches product variants by product SKU.
109
- *
110
- * 🛠 **Endpoint**: `GET /v1/shop/product-variants`
111
- *
112
- * | Parameter | Type | Required | Description |
113
- * |-----------------|--------------|----------|--------------------------------------------|
114
- * | `productSku` | `string` | ✅ | The SKU of the product. |
115
- * | `locale` | `string` | ❌ | The locale for product variants. |
116
- * | `pageable.page` | `number` | ❌ | The page number to fetch (0-based index). |
117
- * | `pageable.size` | `number` | ❌ | The number of items per page. |
118
- *
119
- * 📤 **Returns**:
120
- * A `Promise` resolving to a `GetProductVariantsListResponse` containing the product variants.
121
- *
122
- * 🛠 **Example usage**:
123
- * ```typescript
124
- * const variants = await getProductVariantsList({
125
- * productSku: 'sku123',
126
- * locale: 'en-US',
127
- * pageable: { page: 0, size: 10 },
128
- * });
129
- * console.log(variants);
130
- * ```
131
- */
132
- async function getProductVariantsList({ productSku, locale, pageable, }) {
133
- (0, parameters_validation_1.required)({ productSku });
134
- const { data } = await (0, fetch_instance_1.enhancedFetch)({
135
- method: "GET",
136
- path: `/v1/shop/product-variants`,
137
- params: {
138
- productSku,
139
- locale,
140
- page: pageable === null || pageable === void 0 ? void 0 : pageable.page,
141
- size: pageable === null || pageable === void 0 ? void 0 : pageable.size,
142
- },
143
- });
144
- return data;
145
- }
146
107
  /**
147
108
  * 📄 Fetches offers for a specific product variant.
148
109
  *
@@ -192,7 +153,7 @@ async function getProductVariantsList({ productSku, locale, pageable, }) {
192
153
  * }
193
154
  * ```
194
155
  */
195
- async function getProductVariantOffers({ productIdentifier, productIdType, currency, }) {
156
+ async function getProductVariantOffers({ productIdentifier, productIdType, currency, withoutPrice, }) {
196
157
  (0, parameters_validation_1.required)({ productIdentifier, productIdType });
197
158
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
198
159
  method: "GET",
@@ -200,6 +161,7 @@ async function getProductVariantOffers({ productIdentifier, productIdType, curre
200
161
  params: {
201
162
  productIdType,
202
163
  currency,
164
+ withoutPrice,
203
165
  },
204
166
  });
205
167
  return data;
@@ -275,6 +237,8 @@ async function getProduct({ productIdentifier, productIdType, locale, }) {
275
237
  return data;
276
238
  }
277
239
  /**
240
+ * @deprecated
241
+ *
278
242
  * 📄 Fetches product offers by SKU, ID, or external ID.
279
243
  *
280
244
  * 🛠 **Endpoint**: `GET /v1/shop/products/{productIdentifier}/offers`
@@ -297,8 +261,9 @@ async function getProduct({ productIdentifier, productIdType, locale, }) {
297
261
  * });
298
262
  * console.log(offers);
299
263
  * ```
264
+ * SWAGGER [PRODUCT-502]
300
265
  */
301
- async function getProductOffers({ productIdentifier, productIdType, locale, currency, }) {
266
+ async function getProductOffers({ productIdentifier, productIdType, locale, currency, withoutPrice, }) {
302
267
  (0, parameters_validation_1.required)({ productIdentifier, productIdType });
303
268
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
304
269
  method: "GET",
@@ -307,6 +272,7 @@ async function getProductOffers({ productIdentifier, productIdType, locale, curr
307
272
  productIdType,
308
273
  locale,
309
274
  currency,
275
+ withoutPrice,
310
276
  },
311
277
  });
312
278
  return data;
@@ -141,4 +141,31 @@ export interface GetProductPaginatedOffersResponse {
141
141
  totalElements: number;
142
142
  totalPages: number;
143
143
  }
144
+ export interface GetProductVariantParameters {
145
+ productVariantId: string;
146
+ locale?: string;
147
+ }
148
+ export interface ProductVariantPictureUrl {
149
+ formatType: string;
150
+ heightInPx: number;
151
+ sizeType: string;
152
+ url: string;
153
+ widthInPx: number;
154
+ }
155
+ export interface ProductVariantPicture {
156
+ isMain: boolean;
157
+ urls: ProductVariantPictureUrl[];
158
+ }
159
+ export interface GetProductVariantResponse {
160
+ description: string;
161
+ ean: string;
162
+ externalId: string;
163
+ id: string;
164
+ name: string;
165
+ productExternalId: string;
166
+ skuProduct: string;
167
+ skuVariant: string;
168
+ status: string;
169
+ variantPictures: ProductVariantPicture[];
170
+ }
144
171
  export {};
@@ -1,4 +1,4 @@
1
- import { GetProductVariantAttributesParameters, GetProductVariantAttributesResponse, GetProductVariantSuppliersParameters, GetProductVariantSuppliersResponse, GetProductVariantsListParameters, GetProductVariantsListResponse } from "./definitions";
1
+ import { GetProductVariantAttributesParameters, GetProductVariantAttributesResponse, GetProductVariantParameters, GetProductVariantResponse, GetProductVariantSuppliersParameters, GetProductVariantSuppliersResponse, GetProductVariantsListParameters, GetProductVariantsListResponse } from "./definitions";
2
2
  /**
3
3
  * 📄 Fetches a paginated list of product variants.
4
4
  *
@@ -91,3 +91,32 @@ export declare function getProductVariantSuppliers({ productVariantId, }: GetPro
91
91
  * @returns {Promise<GetProductVariantAttributesResponse>} A promise resolving to the product variant attributes response.
92
92
  */
93
93
  export declare function getProductVariantAttributes({ productIdentifier, productIdType, locale, }: GetProductVariantAttributesParameters): Promise<GetProductVariantAttributesResponse>;
94
+ /**
95
+ * 📄 Fetches details of a specific product variant.
96
+ *
97
+ * This function retrieves detailed information about a product variant identified by its ID.
98
+ *
99
+ * 🛠 **Endpoint**: `GET /v1/shop/product-variants/{productVariantId}`
100
+ *
101
+ * | Parameter | Type | Required | Description |
102
+ * |---------------------|--------------|----------|-------------------------------------------------|
103
+ * | `productVariantId` | `string` | ✅ | The ID of the product variant to fetch. |
104
+ * | `locale` | `string` | ❌ | The locale for localized data (e.g., `en-US`). |
105
+ *
106
+ * 📤 **Returns**:
107
+ * A `Promise` resolving to a `GetProductVariantResponse` object, containing the product variant details.
108
+ *
109
+ * 🛠 **Example usage**:
110
+ * ```typescript
111
+ * const variant = await getProductVariant({
112
+ * productVariantId: 'variant123',
113
+ * locale: 'fr-FR',
114
+ * });
115
+ * console.log(variant);
116
+ * ```
117
+ *
118
+ * @param {GetProductVariantParameters} params - The parameters for fetching the product variant.
119
+ * @throws {Error} If `productVariantId` is missing.
120
+ * @returns {Promise<GetProductVariantResponse>} A promise resolving to the product variant response.
121
+ */
122
+ export declare function getProductVariant({ productVariantId, locale, }: GetProductVariantParameters): Promise<GetProductVariantResponse>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getProductVariantsList = getProductVariantsList;
4
4
  exports.getProductVariantSuppliers = getProductVariantSuppliers;
5
5
  exports.getProductVariantAttributes = getProductVariantAttributes;
6
+ exports.getProductVariant = getProductVariant;
6
7
  const parameters_validation_1 = require("../../helpers/parameters-validation");
7
8
  const fetch_instance_1 = require("../../settings/fetch-instance");
8
9
  /**
@@ -129,3 +130,42 @@ async function getProductVariantAttributes({ productIdentifier, productIdType, l
129
130
  });
130
131
  return data;
131
132
  }
133
+ /**
134
+ * 📄 Fetches details of a specific product variant.
135
+ *
136
+ * This function retrieves detailed information about a product variant identified by its ID.
137
+ *
138
+ * 🛠 **Endpoint**: `GET /v1/shop/product-variants/{productVariantId}`
139
+ *
140
+ * | Parameter | Type | Required | Description |
141
+ * |---------------------|--------------|----------|-------------------------------------------------|
142
+ * | `productVariantId` | `string` | ✅ | The ID of the product variant to fetch. |
143
+ * | `locale` | `string` | ❌ | The locale for localized data (e.g., `en-US`). |
144
+ *
145
+ * 📤 **Returns**:
146
+ * A `Promise` resolving to a `GetProductVariantResponse` object, containing the product variant details.
147
+ *
148
+ * 🛠 **Example usage**:
149
+ * ```typescript
150
+ * const variant = await getProductVariant({
151
+ * productVariantId: 'variant123',
152
+ * locale: 'fr-FR',
153
+ * });
154
+ * console.log(variant);
155
+ * ```
156
+ *
157
+ * @param {GetProductVariantParameters} params - The parameters for fetching the product variant.
158
+ * @throws {Error} If `productVariantId` is missing.
159
+ * @returns {Promise<GetProductVariantResponse>} A promise resolving to the product variant response.
160
+ */
161
+ async function getProductVariant({ productVariantId, locale, }) {
162
+ (0, parameters_validation_1.required)({ productVariantId });
163
+ const { data } = await (0, fetch_instance_1.enhancedFetch)({
164
+ method: "GET",
165
+ path: `/v1/shop/product-variants/${productVariantId}`,
166
+ params: {
167
+ locale,
168
+ },
169
+ });
170
+ return data;
171
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djust-b2b/djust-front-sdk",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
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",