hey-pharmacist-ecommerce 1.1.28 → 1.1.30

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 (91) hide show
  1. package/dist/index.d.mts +10552 -1370
  2. package/dist/index.d.ts +10552 -1370
  3. package/dist/index.js +4696 -1281
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +4640 -1283
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +1 -1
  8. package/src/components/AccountOrdersTab.tsx +1 -1
  9. package/src/components/AccountSettingsTab.tsx +88 -6
  10. package/src/components/CartItem.tsx +1 -1
  11. package/src/components/Header.tsx +8 -2
  12. package/src/components/OrderCard.tsx +4 -4
  13. package/src/components/ProductCard.tsx +59 -42
  14. package/src/components/QuickViewModal.tsx +13 -13
  15. package/src/hooks/useAddresses.ts +4 -1
  16. package/src/hooks/usePaymentMethods.ts +26 -31
  17. package/src/hooks/useProducts.ts +63 -64
  18. package/src/hooks/useStoreCapabilities.ts +87 -0
  19. package/src/hooks/useWishlistProducts.ts +4 -5
  20. package/src/index.ts +6 -0
  21. package/src/lib/Apis/api.ts +0 -1
  22. package/src/lib/Apis/apis/auth-api.ts +37 -36
  23. package/src/lib/Apis/apis/categories-api.ts +97 -0
  24. package/src/lib/Apis/apis/products-api.ts +942 -405
  25. package/src/lib/Apis/apis/shipping-api.ts +105 -0
  26. package/src/lib/Apis/apis/stores-api.ts +356 -0
  27. package/src/lib/Apis/apis/sub-categories-api.ts +97 -0
  28. package/src/lib/Apis/apis/users-api.ts +8 -8
  29. package/src/lib/Apis/models/address-created-request.ts +0 -12
  30. package/src/lib/Apis/models/address.ts +0 -12
  31. package/src/lib/Apis/models/api-key-info-dto.ts +49 -0
  32. package/src/lib/Apis/models/category-populated.ts +0 -12
  33. package/src/lib/Apis/models/category-sub-category-populated.ts +2 -2
  34. package/src/lib/Apis/models/category.ts +0 -18
  35. package/src/lib/Apis/models/{table-cell-dto.ts → change-password-dto.ts} +6 -6
  36. package/src/lib/Apis/models/create-address-dto.ts +0 -12
  37. package/src/lib/Apis/models/create-discount-dto.ts +0 -8
  38. package/src/lib/Apis/models/create-product-dto.ts +30 -23
  39. package/src/lib/Apis/models/create-store-address-dto.ts +0 -12
  40. package/src/lib/Apis/models/create-store-dto-settings.ts +51 -0
  41. package/src/lib/Apis/models/create-store-dto.ts +7 -0
  42. package/src/lib/Apis/models/create-sub-category-dto.ts +6 -0
  43. package/src/lib/Apis/models/create-variant-dto.ts +26 -32
  44. package/src/lib/Apis/models/discount.ts +0 -8
  45. package/src/lib/Apis/models/index.ts +16 -7
  46. package/src/lib/Apis/models/paginated-products-dto.ts +6 -6
  47. package/src/lib/Apis/models/populated-discount.ts +0 -8
  48. package/src/lib/Apis/models/product-summary.ts +69 -0
  49. package/src/lib/Apis/models/product-variant.ts +31 -68
  50. package/src/lib/Apis/models/product.ts +138 -0
  51. package/src/lib/Apis/models/products-insights-dto.ts +12 -0
  52. package/src/lib/Apis/models/reorder-categories-dto.ts +27 -0
  53. package/src/lib/Apis/models/reorder-products-dto.ts +49 -0
  54. package/src/lib/Apis/models/{table-dto.ts → reorder-products-success-response-dto.ts} +8 -9
  55. package/src/lib/Apis/models/reorder-subcategories-dto.ts +33 -0
  56. package/src/lib/Apis/models/{shallow-parent-category-dto.ts → reorder-success-response-dto.ts} +7 -7
  57. package/src/lib/Apis/models/shipment-with-order.ts +18 -0
  58. package/src/lib/Apis/models/shipment.ts +18 -0
  59. package/src/lib/Apis/models/single-product-media.ts +0 -12
  60. package/src/lib/Apis/models/store-api-keys-response-dto.ts +34 -0
  61. package/src/lib/Apis/models/store-capabilities-dto.ts +63 -0
  62. package/src/lib/Apis/models/store-entity.ts +7 -0
  63. package/src/lib/Apis/models/store.ts +7 -0
  64. package/src/lib/Apis/models/sub-category.ts +6 -12
  65. package/src/lib/Apis/models/update-address-dto.ts +0 -12
  66. package/src/lib/Apis/models/update-api-keys-dto.ts +39 -0
  67. package/src/lib/Apis/models/update-discount-dto.ts +0 -8
  68. package/src/lib/Apis/models/update-manual-shipment-status-dto.ts +47 -0
  69. package/src/lib/Apis/models/update-product-dto.ts +30 -19
  70. package/src/lib/Apis/models/update-store-dto.ts +7 -0
  71. package/src/lib/Apis/models/update-sub-category-dto.ts +6 -0
  72. package/src/lib/Apis/models/{update-product-variant-dto.ts → update-variant-dto.ts} +46 -46
  73. package/src/lib/Apis/models/variant-id-inventory-body.ts +27 -0
  74. package/src/lib/api-adapter/config.ts +53 -0
  75. package/src/lib/validations/address.ts +1 -1
  76. package/src/providers/FavoritesProvider.tsx +5 -5
  77. package/src/providers/WishlistProvider.tsx +4 -4
  78. package/src/screens/CartScreen.tsx +1 -1
  79. package/src/screens/ChangePasswordScreen.tsx +2 -6
  80. package/src/screens/CheckoutScreen.tsx +402 -288
  81. package/src/screens/ForgotPasswordScreen.tsx +153 -0
  82. package/src/screens/ProductDetailScreen.tsx +51 -60
  83. package/src/screens/RegisterScreen.tsx +31 -31
  84. package/src/screens/ResetPasswordScreen.tsx +208 -0
  85. package/src/screens/SearchResultsScreen.tsx +264 -26
  86. package/src/screens/ShopScreen.tsx +42 -45
  87. package/src/screens/WishlistScreen.tsx +35 -31
  88. package/src/lib/Apis/apis/product-variants-api.ts +0 -552
  89. package/src/lib/Apis/models/create-single-variant-product-dto.ts +0 -154
  90. package/src/lib/Apis/models/extended-product-dto.ts +0 -206
  91. package/src/lib/Apis/models/frequently-bought-product-dto.ts +0 -71
@@ -16,13 +16,16 @@ import { Configuration } from '../configuration';
16
16
  // Some imports not used depending on template conditions
17
17
  // @ts-ignore
18
18
  import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
19
- import { CategoryFilters } from '../models';
20
19
  import { CreateProductDto } from '../models';
21
- import { CreateSingleVariantProductDTO } from '../models';
22
- import { ExtendedProductDTO } from '../models';
20
+ import { CreateVariantDto } from '../models';
23
21
  import { PaginatedProductsDto } from '../models';
22
+ import { Product } from '../models';
24
23
  import { ProductsInsightsDto } from '../models';
24
+ import { ReorderProductsDto } from '../models';
25
+ import { ReorderProductsSuccessResponseDto } from '../models';
25
26
  import { UpdateProductDto } from '../models';
27
+ import { UpdateVariantDto } from '../models';
28
+ import { VariantIdInventoryBody } from '../models';
26
29
  /**
27
30
  * ProductsApi - axios parameter creator
28
31
  * @export
@@ -31,17 +34,23 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
31
34
  return {
32
35
  /**
33
36
  *
34
- * @summary Create a product
35
- * @param {CreateProductDto} body
37
+ * @summary Add a new variant to a product
38
+ * @param {CreateVariantDto} body
39
+ * @param {string} productId Product ID
36
40
  * @param {*} [options] Override http request option.
37
41
  * @throws {RequiredError}
38
42
  */
39
- createProduct: async (body: CreateProductDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
43
+ addVariant: async (body: CreateVariantDto, productId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
40
44
  // verify required parameter 'body' is not null or undefined
41
45
  if (body === null || body === undefined) {
42
- throw new RequiredError('body','Required parameter body was null or undefined when calling createProduct.');
46
+ throw new RequiredError('body','Required parameter body was null or undefined when calling addVariant.');
43
47
  }
44
- const localVarPath = `/products/create`;
48
+ // verify required parameter 'productId' is not null or undefined
49
+ if (productId === null || productId === undefined) {
50
+ throw new RequiredError('productId','Required parameter productId was null or undefined when calling addVariant.');
51
+ }
52
+ const localVarPath = `/products/{productId}/variants`
53
+ .replace(`{${"productId"}}`, encodeURIComponent(String(productId)));
45
54
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
46
55
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
47
56
  let baseOptions;
@@ -91,17 +100,17 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
91
100
  },
92
101
  /**
93
102
  *
94
- * @summary Create a Product that has a single variant
95
- * @param {CreateSingleVariantProductDTO} body
103
+ * @summary Create a new product with variants
104
+ * @param {CreateProductDto} body
96
105
  * @param {*} [options] Override http request option.
97
106
  * @throws {RequiredError}
98
107
  */
99
- createSingleVariantProduct: async (body: CreateSingleVariantProductDTO, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
108
+ createProduct: async (body: CreateProductDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
100
109
  // verify required parameter 'body' is not null or undefined
101
110
  if (body === null || body === undefined) {
102
- throw new RequiredError('body','Required parameter body was null or undefined when calling createSingleVariantProduct.');
111
+ throw new RequiredError('body','Required parameter body was null or undefined when calling createProduct.');
103
112
  }
104
- const localVarPath = `/products/create-single-variant`;
113
+ const localVarPath = `/products`;
105
114
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
106
115
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
107
116
  let baseOptions;
@@ -151,25 +160,24 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
151
160
  },
152
161
  /**
153
162
  *
154
- * @summary Delete a product
155
- * @param {string} id
163
+ * @summary [DEPRECATED] Use POST /products instead
164
+ * @param {CreateProductDto} body
156
165
  * @param {*} [options] Override http request option.
157
166
  * @throws {RequiredError}
158
167
  */
159
- deleteProduct: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
160
- // verify required parameter 'id' is not null or undefined
161
- if (id === null || id === undefined) {
162
- throw new RequiredError('id','Required parameter id was null or undefined when calling deleteProduct.');
168
+ createProductLegacy: async (body: CreateProductDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
169
+ // verify required parameter 'body' is not null or undefined
170
+ if (body === null || body === undefined) {
171
+ throw new RequiredError('body','Required parameter body was null or undefined when calling createProductLegacy.');
163
172
  }
164
- const localVarPath = `/products/{id}`
165
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
173
+ const localVarPath = `/products/create`;
166
174
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
167
175
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
168
176
  let baseOptions;
169
177
  if (configuration) {
170
178
  baseOptions = configuration.baseOptions;
171
179
  }
172
- const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options};
180
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
173
181
  const localVarHeaderParameter = {} as any;
174
182
  const localVarQueryParameter = {} as any;
175
183
 
@@ -190,6 +198,8 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
190
198
  localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
191
199
  }
192
200
 
201
+ localVarHeaderParameter['Content-Type'] = 'application/json';
202
+
193
203
  const query = new URLSearchParams(localVarUrlObj.search);
194
204
  for (const key in localVarQueryParameter) {
195
205
  query.set(key, localVarQueryParameter[key]);
@@ -200,6 +210,8 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
200
210
  localVarUrlObj.search = (new URLSearchParams(query)).toString();
201
211
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
202
212
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
213
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
214
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
203
215
 
204
216
  return {
205
217
  url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
@@ -208,35 +220,25 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
208
220
  },
209
221
  /**
210
222
  *
211
- * @summary Get all products of a specific category
212
- * @param {string} categoryId Category ID
213
- * @param {string} [searchTerm] OpenAI Search Query
214
- * @param {number} [maxPrice] highest price to filter with
215
- * @param {number} [minPrice] lowest price to filter with
216
- * @param {string} [brandFilter] brands to filter with (comma separated string)
217
- * @param {string} [availability] specifies whether to show available products or out of stock ones
218
- * @param {string} [sort] specifies which attribute to sort with
219
- * @param {boolean} [includeNoVariantProducts]
220
- * @param {boolean} [isActive]
221
- * @param {number} [limit]
222
- * @param {number} [page]
223
+ * @summary Delete a product and all its variants
224
+ * @param {string} id Product ID
223
225
  * @param {*} [options] Override http request option.
224
226
  * @throws {RequiredError}
225
227
  */
226
- getAllCategoryProducts: async (categoryId: string, searchTerm?: string, maxPrice?: number, minPrice?: number, brandFilter?: string, availability?: string, sort?: string, includeNoVariantProducts?: boolean, isActive?: boolean, limit?: number, page?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
227
- // verify required parameter 'categoryId' is not null or undefined
228
- if (categoryId === null || categoryId === undefined) {
229
- throw new RequiredError('categoryId','Required parameter categoryId was null or undefined when calling getAllCategoryProducts.');
228
+ deleteProduct: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
229
+ // verify required parameter 'id' is not null or undefined
230
+ if (id === null || id === undefined) {
231
+ throw new RequiredError('id','Required parameter id was null or undefined when calling deleteProduct.');
230
232
  }
231
- const localVarPath = `/products/allCategoryProducts/{categoryId}`
232
- .replace(`{${"categoryId"}}`, encodeURIComponent(String(categoryId)));
233
+ const localVarPath = `/products/{id}`
234
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
233
235
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
234
236
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
235
237
  let baseOptions;
236
238
  if (configuration) {
237
239
  baseOptions = configuration.baseOptions;
238
240
  }
239
- const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
241
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options};
240
242
  const localVarHeaderParameter = {} as any;
241
243
  const localVarQueryParameter = {} as any;
242
244
 
@@ -257,44 +259,67 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
257
259
  localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
258
260
  }
259
261
 
260
- if (searchTerm !== undefined) {
261
- localVarQueryParameter['searchTerm'] = searchTerm;
262
- }
263
-
264
- if (maxPrice !== undefined) {
265
- localVarQueryParameter['maxPrice'] = maxPrice;
266
- }
267
-
268
- if (minPrice !== undefined) {
269
- localVarQueryParameter['minPrice'] = minPrice;
270
- }
271
-
272
- if (brandFilter !== undefined) {
273
- localVarQueryParameter['brandFilter'] = brandFilter;
262
+ const query = new URLSearchParams(localVarUrlObj.search);
263
+ for (const key in localVarQueryParameter) {
264
+ query.set(key, localVarQueryParameter[key]);
274
265
  }
275
-
276
- if (availability !== undefined) {
277
- localVarQueryParameter['availability'] = availability;
266
+ for (const key in options.params) {
267
+ query.set(key, options.params[key]);
278
268
  }
269
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
270
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
271
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
279
272
 
280
- if (sort !== undefined) {
281
- localVarQueryParameter['sort'] = sort;
273
+ return {
274
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
275
+ options: localVarRequestOptions,
276
+ };
277
+ },
278
+ /**
279
+ *
280
+ * @summary Delete a variant from a product
281
+ * @param {string} productId Product ID
282
+ * @param {string} variantId Variant ID
283
+ * @param {*} [options] Override http request option.
284
+ * @throws {RequiredError}
285
+ */
286
+ deleteVariant: async (productId: string, variantId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
287
+ // verify required parameter 'productId' is not null or undefined
288
+ if (productId === null || productId === undefined) {
289
+ throw new RequiredError('productId','Required parameter productId was null or undefined when calling deleteVariant.');
282
290
  }
283
-
284
- if (includeNoVariantProducts !== undefined) {
285
- localVarQueryParameter['includeNoVariantProducts'] = includeNoVariantProducts;
291
+ // verify required parameter 'variantId' is not null or undefined
292
+ if (variantId === null || variantId === undefined) {
293
+ throw new RequiredError('variantId','Required parameter variantId was null or undefined when calling deleteVariant.');
286
294
  }
287
-
288
- if (isActive !== undefined) {
289
- localVarQueryParameter['isActive'] = isActive;
295
+ const localVarPath = `/products/{productId}/variants/{variantId}`
296
+ .replace(`{${"productId"}}`, encodeURIComponent(String(productId)))
297
+ .replace(`{${"variantId"}}`, encodeURIComponent(String(variantId)));
298
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
299
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
300
+ let baseOptions;
301
+ if (configuration) {
302
+ baseOptions = configuration.baseOptions;
290
303
  }
304
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options};
305
+ const localVarHeaderParameter = {} as any;
306
+ const localVarQueryParameter = {} as any;
291
307
 
292
- if (limit !== undefined) {
293
- localVarQueryParameter['limit'] = limit;
308
+ // authentication bearer required
309
+ // http bearer authentication required
310
+ if (configuration && configuration.accessToken) {
311
+ const accessToken = typeof configuration.accessToken === 'function'
312
+ ? await configuration.accessToken()
313
+ : await configuration.accessToken;
314
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
294
315
  }
295
316
 
296
- if (page !== undefined) {
297
- localVarQueryParameter['page'] = page;
317
+ // authentication x-store-key required
318
+ if (configuration && configuration.apiKey) {
319
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
320
+ ? await configuration.apiKey("x-store-key")
321
+ : await configuration.apiKey;
322
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
298
323
  }
299
324
 
300
325
  const query = new URLSearchParams(localVarUrlObj.search);
@@ -315,12 +340,18 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
315
340
  },
316
341
  /**
317
342
  *
318
- * @summary Get all filters for products
343
+ * @summary [DEPRECATED] Use GET /products/all?categoryId=:id instead
344
+ * @param {string} categoryId
319
345
  * @param {*} [options] Override http request option.
320
346
  * @throws {RequiredError}
321
347
  */
322
- getAllFilters: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
323
- const localVarPath = `/products/allFilters`;
348
+ getAllCategoryProducts: async (categoryId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
349
+ // verify required parameter 'categoryId' is not null or undefined
350
+ if (categoryId === null || categoryId === undefined) {
351
+ throw new RequiredError('categoryId','Required parameter categoryId was null or undefined when calling getAllCategoryProducts.');
352
+ }
353
+ const localVarPath = `/products/allCategoryProducts/{categoryId}`
354
+ .replace(`{${"categoryId"}}`, encodeURIComponent(String(categoryId)));
324
355
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
325
356
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
326
357
  let baseOptions;
@@ -366,28 +397,12 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
366
397
  },
367
398
  /**
368
399
  *
369
- * @summary Get all products of a specific sub category
370
- * @param {string} subCategoryId Sub Category ID
371
- * @param {string} [searchTerm] OpenAI Search Query
372
- * @param {number} [maxPrice] highest price to filter with
373
- * @param {number} [minPrice] lowest price to filter with
374
- * @param {string} [brandFilter] brands to filter with (comma separated string)
375
- * @param {string} [availability] specifies whether to show available products or out of stock ones
376
- * @param {string} [sort] specifies which attribute to sort with
377
- * @param {boolean} [includeNoVariantProducts]
378
- * @param {boolean} [isActive]
379
- * @param {number} [limit]
380
- * @param {number} [page]
400
+ * @summary Get all available filters (brands, price range)
381
401
  * @param {*} [options] Override http request option.
382
402
  * @throws {RequiredError}
383
403
  */
384
- getAllProducts: async (subCategoryId: string, searchTerm?: string, maxPrice?: number, minPrice?: number, brandFilter?: string, availability?: string, sort?: string, includeNoVariantProducts?: boolean, isActive?: boolean, limit?: number, page?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
385
- // verify required parameter 'subCategoryId' is not null or undefined
386
- if (subCategoryId === null || subCategoryId === undefined) {
387
- throw new RequiredError('subCategoryId','Required parameter subCategoryId was null or undefined when calling getAllProducts.');
388
- }
389
- const localVarPath = `/products/allProducts/{subCategoryId}`
390
- .replace(`{${"subCategoryId"}}`, encodeURIComponent(String(subCategoryId)));
404
+ getAllFilters: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
405
+ const localVarPath = `/products/filters`;
391
406
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
392
407
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
393
408
  let baseOptions;
@@ -415,46 +430,6 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
415
430
  localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
416
431
  }
417
432
 
418
- if (searchTerm !== undefined) {
419
- localVarQueryParameter['searchTerm'] = searchTerm;
420
- }
421
-
422
- if (maxPrice !== undefined) {
423
- localVarQueryParameter['maxPrice'] = maxPrice;
424
- }
425
-
426
- if (minPrice !== undefined) {
427
- localVarQueryParameter['minPrice'] = minPrice;
428
- }
429
-
430
- if (brandFilter !== undefined) {
431
- localVarQueryParameter['brandFilter'] = brandFilter;
432
- }
433
-
434
- if (availability !== undefined) {
435
- localVarQueryParameter['availability'] = availability;
436
- }
437
-
438
- if (sort !== undefined) {
439
- localVarQueryParameter['sort'] = sort;
440
- }
441
-
442
- if (includeNoVariantProducts !== undefined) {
443
- localVarQueryParameter['includeNoVariantProducts'] = includeNoVariantProducts;
444
- }
445
-
446
- if (isActive !== undefined) {
447
- localVarQueryParameter['isActive'] = isActive;
448
- }
449
-
450
- if (limit !== undefined) {
451
- localVarQueryParameter['limit'] = limit;
452
- }
453
-
454
- if (page !== undefined) {
455
- localVarQueryParameter['page'] = page;
456
- }
457
-
458
433
  const query = new URLSearchParams(localVarUrlObj.search);
459
434
  for (const key in localVarQueryParameter) {
460
435
  query.set(key, localVarQueryParameter[key]);
@@ -473,23 +448,22 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
473
448
  },
474
449
  /**
475
450
  *
476
- * @summary Get all products
477
- * @param {string} [searchTerm] OpenAI Search Query
478
- * @param {string} [productType] Product Type
479
- * @param {string} [categoryId] Category ID
480
- * @param {number} [maxPrice] highest price to filter with
481
- * @param {number} [minPrice] lowest price to filter with
482
- * @param {string} [brandFilter] brands to filter with (comma separated string)
483
- * @param {string} [availability] specifies whether to show available products or out of stock ones
484
- * @param {string} [sort] specifies which attribute to sort with
485
- * @param {boolean} [includeNoVariantProducts]
451
+ * @summary Get all products with filtering and pagination
452
+ * @param {string} [searchTerm]
453
+ * @param {number} [maxPrice]
454
+ * @param {number} [minPrice]
455
+ * @param {string} [brandFilter] Comma-separated brand names
456
+ * @param {string} [availability]
457
+ * @param {string} [sort]
458
+ * @param {string} [subCategoryId]
459
+ * @param {string} [categoryId]
486
460
  * @param {boolean} [isActive]
487
461
  * @param {number} [limit]
488
462
  * @param {number} [page]
489
463
  * @param {*} [options] Override http request option.
490
464
  * @throws {RequiredError}
491
465
  */
492
- getAllProductsForStore: async (searchTerm?: string, productType?: string, categoryId?: string, maxPrice?: number, minPrice?: number, brandFilter?: string, availability?: string, sort?: string, includeNoVariantProducts?: boolean, isActive?: boolean, limit?: number, page?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
466
+ getAllProducts: async (searchTerm?: string, maxPrice?: number, minPrice?: number, brandFilter?: string, availability?: string, sort?: string, subCategoryId?: string, categoryId?: string, isActive?: boolean, limit?: number, page?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
493
467
  const localVarPath = `/products/all`;
494
468
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
495
469
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
@@ -522,14 +496,6 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
522
496
  localVarQueryParameter['searchTerm'] = searchTerm;
523
497
  }
524
498
 
525
- if (productType !== undefined) {
526
- localVarQueryParameter['productType'] = productType;
527
- }
528
-
529
- if (categoryId !== undefined) {
530
- localVarQueryParameter['categoryId'] = categoryId;
531
- }
532
-
533
499
  if (maxPrice !== undefined) {
534
500
  localVarQueryParameter['maxPrice'] = maxPrice;
535
501
  }
@@ -550,8 +516,12 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
550
516
  localVarQueryParameter['sort'] = sort;
551
517
  }
552
518
 
553
- if (includeNoVariantProducts !== undefined) {
554
- localVarQueryParameter['includeNoVariantProducts'] = includeNoVariantProducts;
519
+ if (subCategoryId !== undefined) {
520
+ localVarQueryParameter['subCategoryId'] = subCategoryId;
521
+ }
522
+
523
+ if (categoryId !== undefined) {
524
+ localVarQueryParameter['categoryId'] = categoryId;
555
525
  }
556
526
 
557
527
  if (isActive !== undefined) {
@@ -584,12 +554,18 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
584
554
  },
585
555
  /**
586
556
  *
587
- * @summary Get the featured product for home screen
557
+ * @summary [DEPRECATED] Use GET /products/all?subCategoryId=:id instead
558
+ * @param {string} subCategoryId
588
559
  * @param {*} [options] Override http request option.
589
560
  * @throws {RequiredError}
590
561
  */
591
- getFeaturedProduct: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
592
- const localVarPath = `/products/featured`;
562
+ getAllProductsBySubCategory: async (subCategoryId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
563
+ // verify required parameter 'subCategoryId' is not null or undefined
564
+ if (subCategoryId === null || subCategoryId === undefined) {
565
+ throw new RequiredError('subCategoryId','Required parameter subCategoryId was null or undefined when calling getAllProductsBySubCategory.');
566
+ }
567
+ const localVarPath = `/products/allProducts/{subCategoryId}`
568
+ .replace(`{${"subCategoryId"}}`, encodeURIComponent(String(subCategoryId)));
593
569
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
594
570
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
595
571
  let baseOptions;
@@ -635,12 +611,12 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
635
611
  },
636
612
  /**
637
613
  *
638
- * @summary Get insights on store Products
614
+ * @summary Get the featured product for home screen
639
615
  * @param {*} [options] Override http request option.
640
616
  * @throws {RequiredError}
641
617
  */
642
- getProductsInsights: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
643
- const localVarPath = `/products/insights`;
618
+ getFeaturedProduct: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
619
+ const localVarPath = `/products/featured`;
644
620
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
645
621
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
646
622
  let baseOptions;
@@ -686,18 +662,12 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
686
662
  },
687
663
  /**
688
664
  *
689
- * @summary Get related products
690
- * @param {string} productId Product ID
665
+ * @summary Get product insights for the store
691
666
  * @param {*} [options] Override http request option.
692
667
  * @throws {RequiredError}
693
668
  */
694
- getRelatedProducts: async (productId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
695
- // verify required parameter 'productId' is not null or undefined
696
- if (productId === null || productId === undefined) {
697
- throw new RequiredError('productId','Required parameter productId was null or undefined when calling getRelatedProducts.');
698
- }
699
- const localVarPath = `/products/relatedProducts/{productId}`
700
- .replace(`{${"productId"}}`, encodeURIComponent(String(productId)));
669
+ getProductsInsights: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
670
+ const localVarPath = `/products/insights`;
701
671
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
702
672
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
703
673
  let baseOptions;
@@ -743,17 +713,18 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
743
713
  },
744
714
  /**
745
715
  *
746
- * @summary Get a single product
716
+ * @summary Get related products
747
717
  * @param {string} id Product ID
718
+ * @param {number} [limit]
748
719
  * @param {*} [options] Override http request option.
749
720
  * @throws {RequiredError}
750
721
  */
751
- getSingleProduct: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
722
+ getRelatedProducts: async (id: string, limit?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
752
723
  // verify required parameter 'id' is not null or undefined
753
724
  if (id === null || id === undefined) {
754
- throw new RequiredError('id','Required parameter id was null or undefined when calling getSingleProduct.');
725
+ throw new RequiredError('id','Required parameter id was null or undefined when calling getRelatedProducts.');
755
726
  }
756
- const localVarPath = `/products/singleProduct/{id}`
727
+ const localVarPath = `/products/{id}/related`
757
728
  .replace(`{${"id"}}`, encodeURIComponent(String(id)));
758
729
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
759
730
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
@@ -782,6 +753,10 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
782
753
  localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
783
754
  }
784
755
 
756
+ if (limit !== undefined) {
757
+ localVarQueryParameter['limit'] = limit;
758
+ }
759
+
785
760
  const query = new URLSearchParams(localVarUrlObj.search);
786
761
  for (const key in localVarQueryParameter) {
787
762
  query.set(key, localVarQueryParameter[key]);
@@ -800,16 +775,18 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
800
775
  },
801
776
  /**
802
777
  *
803
- * @summary Get top selling products
804
- * @param {number} [limit]
805
- * @param {number} [page]
806
- * @param {boolean} [isActive]
807
- * @param {boolean} [includeNoVariantProducts]
778
+ * @summary [DEPRECATED] Use GET /products/:id/related instead
779
+ * @param {string} productId
808
780
  * @param {*} [options] Override http request option.
809
781
  * @throws {RequiredError}
810
782
  */
811
- getTopSellingProducts: async (limit?: number, page?: number, isActive?: boolean, includeNoVariantProducts?: boolean, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
812
- const localVarPath = `/products/top-selling`;
783
+ getRelatedProductsLegacy: async (productId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
784
+ // verify required parameter 'productId' is not null or undefined
785
+ if (productId === null || productId === undefined) {
786
+ throw new RequiredError('productId','Required parameter productId was null or undefined when calling getRelatedProductsLegacy.');
787
+ }
788
+ const localVarPath = `/products/relatedProducts/{productId}`
789
+ .replace(`{${"productId"}}`, encodeURIComponent(String(productId)));
813
790
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
814
791
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
815
792
  let baseOptions;
@@ -837,22 +814,6 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
837
814
  localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
838
815
  }
839
816
 
840
- if (limit !== undefined) {
841
- localVarQueryParameter['limit'] = limit;
842
- }
843
-
844
- if (page !== undefined) {
845
- localVarQueryParameter['page'] = page;
846
- }
847
-
848
- if (isActive !== undefined) {
849
- localVarQueryParameter['isActive'] = isActive;
850
- }
851
-
852
- if (includeNoVariantProducts !== undefined) {
853
- localVarQueryParameter['includeNoVariantProducts'] = includeNoVariantProducts;
854
- }
855
-
856
817
  const query = new URLSearchParams(localVarUrlObj.search);
857
818
  for (const key in localVarQueryParameter) {
858
819
  query.set(key, localVarQueryParameter[key]);
@@ -871,20 +832,15 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
871
832
  },
872
833
  /**
873
834
  *
874
- * @summary Update a product
875
- * @param {UpdateProductDto} body
835
+ * @summary Get a single product with all details
876
836
  * @param {string} id Product ID
877
837
  * @param {*} [options] Override http request option.
878
838
  * @throws {RequiredError}
879
839
  */
880
- updateProduct: async (body: UpdateProductDto, id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
881
- // verify required parameter 'body' is not null or undefined
882
- if (body === null || body === undefined) {
883
- throw new RequiredError('body','Required parameter body was null or undefined when calling updateProduct.');
884
- }
840
+ getSingleProduct: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
885
841
  // verify required parameter 'id' is not null or undefined
886
842
  if (id === null || id === undefined) {
887
- throw new RequiredError('id','Required parameter id was null or undefined when calling updateProduct.');
843
+ throw new RequiredError('id','Required parameter id was null or undefined when calling getSingleProduct.');
888
844
  }
889
845
  const localVarPath = `/products/{id}`
890
846
  .replace(`{${"id"}}`, encodeURIComponent(String(id)));
@@ -894,7 +850,7 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
894
850
  if (configuration) {
895
851
  baseOptions = configuration.baseOptions;
896
852
  }
897
- const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
853
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
898
854
  const localVarHeaderParameter = {} as any;
899
855
  const localVarQueryParameter = {} as any;
900
856
 
@@ -915,8 +871,6 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
915
871
  localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
916
872
  }
917
873
 
918
- localVarHeaderParameter['Content-Type'] = 'application/json';
919
-
920
874
  const query = new URLSearchParams(localVarUrlObj.search);
921
875
  for (const key in localVarQueryParameter) {
922
876
  query.set(key, localVarQueryParameter[key]);
@@ -927,31 +881,432 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
927
881
  localVarUrlObj.search = (new URLSearchParams(query)).toString();
928
882
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
929
883
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
930
- const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
931
- localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
932
884
 
933
885
  return {
934
886
  url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
935
887
  options: localVarRequestOptions,
936
888
  };
937
889
  },
938
- }
939
- };
940
-
941
- /**
942
- * ProductsApi - functional programming interface
943
- * @export
944
- */
945
- export const ProductsApiFp = function(configuration?: Configuration) {
890
+ /**
891
+ *
892
+ * @summary [DEPRECATED] Use GET /products/:id instead
893
+ * @param {string} id Product ID
894
+ * @param {*} [options] Override http request option.
895
+ * @throws {RequiredError}
896
+ */
897
+ getSingleProductLegacy: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
898
+ // verify required parameter 'id' is not null or undefined
899
+ if (id === null || id === undefined) {
900
+ throw new RequiredError('id','Required parameter id was null or undefined when calling getSingleProductLegacy.');
901
+ }
902
+ const localVarPath = `/products/singleProduct/{id}`
903
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
904
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
905
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
906
+ let baseOptions;
907
+ if (configuration) {
908
+ baseOptions = configuration.baseOptions;
909
+ }
910
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
911
+ const localVarHeaderParameter = {} as any;
912
+ const localVarQueryParameter = {} as any;
913
+
914
+ // authentication bearer required
915
+ // http bearer authentication required
916
+ if (configuration && configuration.accessToken) {
917
+ const accessToken = typeof configuration.accessToken === 'function'
918
+ ? await configuration.accessToken()
919
+ : await configuration.accessToken;
920
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
921
+ }
922
+
923
+ // authentication x-store-key required
924
+ if (configuration && configuration.apiKey) {
925
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
926
+ ? await configuration.apiKey("x-store-key")
927
+ : await configuration.apiKey;
928
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
929
+ }
930
+
931
+ const query = new URLSearchParams(localVarUrlObj.search);
932
+ for (const key in localVarQueryParameter) {
933
+ query.set(key, localVarQueryParameter[key]);
934
+ }
935
+ for (const key in options.params) {
936
+ query.set(key, options.params[key]);
937
+ }
938
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
939
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
940
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
941
+
942
+ return {
943
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
944
+ options: localVarRequestOptions,
945
+ };
946
+ },
947
+ /**
948
+ *
949
+ * @summary Get top selling products
950
+ * @param {number} [limit]
951
+ * @param {number} [page]
952
+ * @param {*} [options] Override http request option.
953
+ * @throws {RequiredError}
954
+ */
955
+ getTopSellingProducts: async (limit?: number, page?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
956
+ const localVarPath = `/products/top-selling`;
957
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
958
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
959
+ let baseOptions;
960
+ if (configuration) {
961
+ baseOptions = configuration.baseOptions;
962
+ }
963
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
964
+ const localVarHeaderParameter = {} as any;
965
+ const localVarQueryParameter = {} as any;
966
+
967
+ // authentication bearer required
968
+ // http bearer authentication required
969
+ if (configuration && configuration.accessToken) {
970
+ const accessToken = typeof configuration.accessToken === 'function'
971
+ ? await configuration.accessToken()
972
+ : await configuration.accessToken;
973
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
974
+ }
975
+
976
+ // authentication x-store-key required
977
+ if (configuration && configuration.apiKey) {
978
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
979
+ ? await configuration.apiKey("x-store-key")
980
+ : await configuration.apiKey;
981
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
982
+ }
983
+
984
+ if (limit !== undefined) {
985
+ localVarQueryParameter['limit'] = limit;
986
+ }
987
+
988
+ if (page !== undefined) {
989
+ localVarQueryParameter['page'] = page;
990
+ }
991
+
992
+ const query = new URLSearchParams(localVarUrlObj.search);
993
+ for (const key in localVarQueryParameter) {
994
+ query.set(key, localVarQueryParameter[key]);
995
+ }
996
+ for (const key in options.params) {
997
+ query.set(key, options.params[key]);
998
+ }
999
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
1000
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1001
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1002
+
1003
+ return {
1004
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
1005
+ options: localVarRequestOptions,
1006
+ };
1007
+ },
1008
+ /**
1009
+ *
1010
+ * @summary Reorder products within a category or subcategory
1011
+ * @param {ReorderProductsDto} body
1012
+ * @param {*} [options] Override http request option.
1013
+ * @throws {RequiredError}
1014
+ */
1015
+ reorderProducts: async (body: ReorderProductsDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1016
+ // verify required parameter 'body' is not null or undefined
1017
+ if (body === null || body === undefined) {
1018
+ throw new RequiredError('body','Required parameter body was null or undefined when calling reorderProducts.');
1019
+ }
1020
+ const localVarPath = `/products/reorder`;
1021
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1022
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
1023
+ let baseOptions;
1024
+ if (configuration) {
1025
+ baseOptions = configuration.baseOptions;
1026
+ }
1027
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
1028
+ const localVarHeaderParameter = {} as any;
1029
+ const localVarQueryParameter = {} as any;
1030
+
1031
+ // authentication bearer required
1032
+ // http bearer authentication required
1033
+ if (configuration && configuration.accessToken) {
1034
+ const accessToken = typeof configuration.accessToken === 'function'
1035
+ ? await configuration.accessToken()
1036
+ : await configuration.accessToken;
1037
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
1038
+ }
1039
+
1040
+ // authentication x-store-key required
1041
+ if (configuration && configuration.apiKey) {
1042
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
1043
+ ? await configuration.apiKey("x-store-key")
1044
+ : await configuration.apiKey;
1045
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
1046
+ }
1047
+
1048
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1049
+
1050
+ const query = new URLSearchParams(localVarUrlObj.search);
1051
+ for (const key in localVarQueryParameter) {
1052
+ query.set(key, localVarQueryParameter[key]);
1053
+ }
1054
+ for (const key in options.params) {
1055
+ query.set(key, options.params[key]);
1056
+ }
1057
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
1058
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1059
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1060
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
1061
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
1062
+
1063
+ return {
1064
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
1065
+ options: localVarRequestOptions,
1066
+ };
1067
+ },
1068
+ /**
1069
+ *
1070
+ * @summary Update variant inventory (add or subtract)
1071
+ * @param {VariantIdInventoryBody} body
1072
+ * @param {string} productId Product ID
1073
+ * @param {string} variantId Variant ID
1074
+ * @param {*} [options] Override http request option.
1075
+ * @throws {RequiredError}
1076
+ */
1077
+ updateInventory: async (body: VariantIdInventoryBody, productId: string, variantId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1078
+ // verify required parameter 'body' is not null or undefined
1079
+ if (body === null || body === undefined) {
1080
+ throw new RequiredError('body','Required parameter body was null or undefined when calling updateInventory.');
1081
+ }
1082
+ // verify required parameter 'productId' is not null or undefined
1083
+ if (productId === null || productId === undefined) {
1084
+ throw new RequiredError('productId','Required parameter productId was null or undefined when calling updateInventory.');
1085
+ }
1086
+ // verify required parameter 'variantId' is not null or undefined
1087
+ if (variantId === null || variantId === undefined) {
1088
+ throw new RequiredError('variantId','Required parameter variantId was null or undefined when calling updateInventory.');
1089
+ }
1090
+ const localVarPath = `/products/{productId}/variants/{variantId}/inventory`
1091
+ .replace(`{${"productId"}}`, encodeURIComponent(String(productId)))
1092
+ .replace(`{${"variantId"}}`, encodeURIComponent(String(variantId)));
1093
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1094
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
1095
+ let baseOptions;
1096
+ if (configuration) {
1097
+ baseOptions = configuration.baseOptions;
1098
+ }
1099
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
1100
+ const localVarHeaderParameter = {} as any;
1101
+ const localVarQueryParameter = {} as any;
1102
+
1103
+ // authentication bearer required
1104
+ // http bearer authentication required
1105
+ if (configuration && configuration.accessToken) {
1106
+ const accessToken = typeof configuration.accessToken === 'function'
1107
+ ? await configuration.accessToken()
1108
+ : await configuration.accessToken;
1109
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
1110
+ }
1111
+
1112
+ // authentication x-store-key required
1113
+ if (configuration && configuration.apiKey) {
1114
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
1115
+ ? await configuration.apiKey("x-store-key")
1116
+ : await configuration.apiKey;
1117
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
1118
+ }
1119
+
1120
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1121
+
1122
+ const query = new URLSearchParams(localVarUrlObj.search);
1123
+ for (const key in localVarQueryParameter) {
1124
+ query.set(key, localVarQueryParameter[key]);
1125
+ }
1126
+ for (const key in options.params) {
1127
+ query.set(key, options.params[key]);
1128
+ }
1129
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
1130
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1131
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1132
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
1133
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
1134
+
1135
+ return {
1136
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
1137
+ options: localVarRequestOptions,
1138
+ };
1139
+ },
1140
+ /**
1141
+ *
1142
+ * @summary Update a product (not variants)
1143
+ * @param {UpdateProductDto} body
1144
+ * @param {string} id Product ID
1145
+ * @param {*} [options] Override http request option.
1146
+ * @throws {RequiredError}
1147
+ */
1148
+ updateProduct: async (body: UpdateProductDto, id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1149
+ // verify required parameter 'body' is not null or undefined
1150
+ if (body === null || body === undefined) {
1151
+ throw new RequiredError('body','Required parameter body was null or undefined when calling updateProduct.');
1152
+ }
1153
+ // verify required parameter 'id' is not null or undefined
1154
+ if (id === null || id === undefined) {
1155
+ throw new RequiredError('id','Required parameter id was null or undefined when calling updateProduct.');
1156
+ }
1157
+ const localVarPath = `/products/{id}`
1158
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
1159
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1160
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
1161
+ let baseOptions;
1162
+ if (configuration) {
1163
+ baseOptions = configuration.baseOptions;
1164
+ }
1165
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
1166
+ const localVarHeaderParameter = {} as any;
1167
+ const localVarQueryParameter = {} as any;
1168
+
1169
+ // authentication bearer required
1170
+ // http bearer authentication required
1171
+ if (configuration && configuration.accessToken) {
1172
+ const accessToken = typeof configuration.accessToken === 'function'
1173
+ ? await configuration.accessToken()
1174
+ : await configuration.accessToken;
1175
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
1176
+ }
1177
+
1178
+ // authentication x-store-key required
1179
+ if (configuration && configuration.apiKey) {
1180
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
1181
+ ? await configuration.apiKey("x-store-key")
1182
+ : await configuration.apiKey;
1183
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
1184
+ }
1185
+
1186
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1187
+
1188
+ const query = new URLSearchParams(localVarUrlObj.search);
1189
+ for (const key in localVarQueryParameter) {
1190
+ query.set(key, localVarQueryParameter[key]);
1191
+ }
1192
+ for (const key in options.params) {
1193
+ query.set(key, options.params[key]);
1194
+ }
1195
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
1196
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1197
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1198
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
1199
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
1200
+
1201
+ return {
1202
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
1203
+ options: localVarRequestOptions,
1204
+ };
1205
+ },
1206
+ /**
1207
+ *
1208
+ * @summary Update a variant
1209
+ * @param {UpdateVariantDto} body
1210
+ * @param {string} productId Product ID
1211
+ * @param {string} variantId Variant ID
1212
+ * @param {*} [options] Override http request option.
1213
+ * @throws {RequiredError}
1214
+ */
1215
+ updateVariant: async (body: UpdateVariantDto, productId: string, variantId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1216
+ // verify required parameter 'body' is not null or undefined
1217
+ if (body === null || body === undefined) {
1218
+ throw new RequiredError('body','Required parameter body was null or undefined when calling updateVariant.');
1219
+ }
1220
+ // verify required parameter 'productId' is not null or undefined
1221
+ if (productId === null || productId === undefined) {
1222
+ throw new RequiredError('productId','Required parameter productId was null or undefined when calling updateVariant.');
1223
+ }
1224
+ // verify required parameter 'variantId' is not null or undefined
1225
+ if (variantId === null || variantId === undefined) {
1226
+ throw new RequiredError('variantId','Required parameter variantId was null or undefined when calling updateVariant.');
1227
+ }
1228
+ const localVarPath = `/products/{productId}/variants/{variantId}`
1229
+ .replace(`{${"productId"}}`, encodeURIComponent(String(productId)))
1230
+ .replace(`{${"variantId"}}`, encodeURIComponent(String(variantId)));
1231
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1232
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
1233
+ let baseOptions;
1234
+ if (configuration) {
1235
+ baseOptions = configuration.baseOptions;
1236
+ }
1237
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
1238
+ const localVarHeaderParameter = {} as any;
1239
+ const localVarQueryParameter = {} as any;
1240
+
1241
+ // authentication bearer required
1242
+ // http bearer authentication required
1243
+ if (configuration && configuration.accessToken) {
1244
+ const accessToken = typeof configuration.accessToken === 'function'
1245
+ ? await configuration.accessToken()
1246
+ : await configuration.accessToken;
1247
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
1248
+ }
1249
+
1250
+ // authentication x-store-key required
1251
+ if (configuration && configuration.apiKey) {
1252
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
1253
+ ? await configuration.apiKey("x-store-key")
1254
+ : await configuration.apiKey;
1255
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
1256
+ }
1257
+
1258
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1259
+
1260
+ const query = new URLSearchParams(localVarUrlObj.search);
1261
+ for (const key in localVarQueryParameter) {
1262
+ query.set(key, localVarQueryParameter[key]);
1263
+ }
1264
+ for (const key in options.params) {
1265
+ query.set(key, options.params[key]);
1266
+ }
1267
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
1268
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1269
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1270
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
1271
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
1272
+
1273
+ return {
1274
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
1275
+ options: localVarRequestOptions,
1276
+ };
1277
+ },
1278
+ }
1279
+ };
1280
+
1281
+ /**
1282
+ * ProductsApi - functional programming interface
1283
+ * @export
1284
+ */
1285
+ export const ProductsApiFp = function(configuration?: Configuration) {
946
1286
  return {
947
1287
  /**
948
1288
  *
949
- * @summary Create a product
1289
+ * @summary Add a new variant to a product
1290
+ * @param {CreateVariantDto} body
1291
+ * @param {string} productId Product ID
1292
+ * @param {*} [options] Override http request option.
1293
+ * @throws {RequiredError}
1294
+ */
1295
+ async addVariant(body: CreateVariantDto, productId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Product>>> {
1296
+ const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).addVariant(body, productId, options);
1297
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1298
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1299
+ return axios.request(axiosRequestArgs);
1300
+ };
1301
+ },
1302
+ /**
1303
+ *
1304
+ * @summary Create a new product with variants
950
1305
  * @param {CreateProductDto} body
951
1306
  * @param {*} [options] Override http request option.
952
1307
  * @throws {RequiredError}
953
1308
  */
954
- async createProduct(body: CreateProductDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ExtendedProductDTO>>> {
1309
+ async createProduct(body: CreateProductDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Product>>> {
955
1310
  const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).createProduct(body, options);
956
1311
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
957
1312
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
@@ -960,13 +1315,13 @@ export const ProductsApiFp = function(configuration?: Configuration) {
960
1315
  },
961
1316
  /**
962
1317
  *
963
- * @summary Create a Product that has a single variant
964
- * @param {CreateSingleVariantProductDTO} body
1318
+ * @summary [DEPRECATED] Use POST /products instead
1319
+ * @param {CreateProductDto} body
965
1320
  * @param {*} [options] Override http request option.
966
1321
  * @throws {RequiredError}
967
1322
  */
968
- async createSingleVariantProduct(body: CreateSingleVariantProductDTO, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ExtendedProductDTO>>> {
969
- const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).createSingleVariantProduct(body, options);
1323
+ async createProductLegacy(body: CreateProductDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
1324
+ const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).createProductLegacy(body, options);
970
1325
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
971
1326
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
972
1327
  return axios.request(axiosRequestArgs);
@@ -974,8 +1329,8 @@ export const ProductsApiFp = function(configuration?: Configuration) {
974
1329
  },
975
1330
  /**
976
1331
  *
977
- * @summary Delete a product
978
- * @param {string} id
1332
+ * @summary Delete a product and all its variants
1333
+ * @param {string} id Product ID
979
1334
  * @param {*} [options] Override http request option.
980
1335
  * @throws {RequiredError}
981
1336
  */
@@ -988,23 +1343,28 @@ export const ProductsApiFp = function(configuration?: Configuration) {
988
1343
  },
989
1344
  /**
990
1345
  *
991
- * @summary Get all products of a specific category
992
- * @param {string} categoryId Category ID
993
- * @param {string} [searchTerm] OpenAI Search Query
994
- * @param {number} [maxPrice] highest price to filter with
995
- * @param {number} [minPrice] lowest price to filter with
996
- * @param {string} [brandFilter] brands to filter with (comma separated string)
997
- * @param {string} [availability] specifies whether to show available products or out of stock ones
998
- * @param {string} [sort] specifies which attribute to sort with
999
- * @param {boolean} [includeNoVariantProducts]
1000
- * @param {boolean} [isActive]
1001
- * @param {number} [limit]
1002
- * @param {number} [page]
1346
+ * @summary Delete a variant from a product
1347
+ * @param {string} productId Product ID
1348
+ * @param {string} variantId Variant ID
1349
+ * @param {*} [options] Override http request option.
1350
+ * @throws {RequiredError}
1351
+ */
1352
+ async deleteVariant(productId: string, variantId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Product>>> {
1353
+ const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).deleteVariant(productId, variantId, options);
1354
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1355
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1356
+ return axios.request(axiosRequestArgs);
1357
+ };
1358
+ },
1359
+ /**
1360
+ *
1361
+ * @summary [DEPRECATED] Use GET /products/all?categoryId=:id instead
1362
+ * @param {string} categoryId
1003
1363
  * @param {*} [options] Override http request option.
1004
1364
  * @throws {RequiredError}
1005
1365
  */
1006
- async getAllCategoryProducts(categoryId: string, searchTerm?: string, maxPrice?: number, minPrice?: number, brandFilter?: string, availability?: string, sort?: string, includeNoVariantProducts?: boolean, isActive?: boolean, limit?: number, page?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PaginatedProductsDto>>> {
1007
- const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getAllCategoryProducts(categoryId, searchTerm, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options);
1366
+ async getAllCategoryProducts(categoryId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
1367
+ const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getAllCategoryProducts(categoryId, options);
1008
1368
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1009
1369
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1010
1370
  return axios.request(axiosRequestArgs);
@@ -1012,11 +1372,11 @@ export const ProductsApiFp = function(configuration?: Configuration) {
1012
1372
  },
1013
1373
  /**
1014
1374
  *
1015
- * @summary Get all filters for products
1375
+ * @summary Get all available filters (brands, price range)
1016
1376
  * @param {*} [options] Override http request option.
1017
1377
  * @throws {RequiredError}
1018
1378
  */
1019
- async getAllFilters(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<CategoryFilters>>> {
1379
+ async getAllFilters(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
1020
1380
  const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getAllFilters(options);
1021
1381
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1022
1382
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
@@ -1025,23 +1385,23 @@ export const ProductsApiFp = function(configuration?: Configuration) {
1025
1385
  },
1026
1386
  /**
1027
1387
  *
1028
- * @summary Get all products of a specific sub category
1029
- * @param {string} subCategoryId Sub Category ID
1030
- * @param {string} [searchTerm] OpenAI Search Query
1031
- * @param {number} [maxPrice] highest price to filter with
1032
- * @param {number} [minPrice] lowest price to filter with
1033
- * @param {string} [brandFilter] brands to filter with (comma separated string)
1034
- * @param {string} [availability] specifies whether to show available products or out of stock ones
1035
- * @param {string} [sort] specifies which attribute to sort with
1036
- * @param {boolean} [includeNoVariantProducts]
1388
+ * @summary Get all products with filtering and pagination
1389
+ * @param {string} [searchTerm]
1390
+ * @param {number} [maxPrice]
1391
+ * @param {number} [minPrice]
1392
+ * @param {string} [brandFilter] Comma-separated brand names
1393
+ * @param {string} [availability]
1394
+ * @param {string} [sort]
1395
+ * @param {string} [subCategoryId]
1396
+ * @param {string} [categoryId]
1037
1397
  * @param {boolean} [isActive]
1038
1398
  * @param {number} [limit]
1039
1399
  * @param {number} [page]
1040
1400
  * @param {*} [options] Override http request option.
1041
1401
  * @throws {RequiredError}
1042
1402
  */
1043
- async getAllProducts(subCategoryId: string, searchTerm?: string, maxPrice?: number, minPrice?: number, brandFilter?: string, availability?: string, sort?: string, includeNoVariantProducts?: boolean, isActive?: boolean, limit?: number, page?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PaginatedProductsDto>>> {
1044
- const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getAllProducts(subCategoryId, searchTerm, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options);
1403
+ async getAllProducts(searchTerm?: string, maxPrice?: number, minPrice?: number, brandFilter?: string, availability?: string, sort?: string, subCategoryId?: string, categoryId?: string, isActive?: boolean, limit?: number, page?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PaginatedProductsDto>>> {
1404
+ const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getAllProducts(searchTerm, maxPrice, minPrice, brandFilter, availability, sort, subCategoryId, categoryId, isActive, limit, page, options);
1045
1405
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1046
1406
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1047
1407
  return axios.request(axiosRequestArgs);
@@ -1049,24 +1409,13 @@ export const ProductsApiFp = function(configuration?: Configuration) {
1049
1409
  },
1050
1410
  /**
1051
1411
  *
1052
- * @summary Get all products
1053
- * @param {string} [searchTerm] OpenAI Search Query
1054
- * @param {string} [productType] Product Type
1055
- * @param {string} [categoryId] Category ID
1056
- * @param {number} [maxPrice] highest price to filter with
1057
- * @param {number} [minPrice] lowest price to filter with
1058
- * @param {string} [brandFilter] brands to filter with (comma separated string)
1059
- * @param {string} [availability] specifies whether to show available products or out of stock ones
1060
- * @param {string} [sort] specifies which attribute to sort with
1061
- * @param {boolean} [includeNoVariantProducts]
1062
- * @param {boolean} [isActive]
1063
- * @param {number} [limit]
1064
- * @param {number} [page]
1412
+ * @summary [DEPRECATED] Use GET /products/all?subCategoryId=:id instead
1413
+ * @param {string} subCategoryId
1065
1414
  * @param {*} [options] Override http request option.
1066
1415
  * @throws {RequiredError}
1067
1416
  */
1068
- async getAllProductsForStore(searchTerm?: string, productType?: string, categoryId?: string, maxPrice?: number, minPrice?: number, brandFilter?: string, availability?: string, sort?: string, includeNoVariantProducts?: boolean, isActive?: boolean, limit?: number, page?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PaginatedProductsDto>>> {
1069
- const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getAllProductsForStore(searchTerm, productType, categoryId, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options);
1417
+ async getAllProductsBySubCategory(subCategoryId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
1418
+ const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getAllProductsBySubCategory(subCategoryId, options);
1070
1419
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1071
1420
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1072
1421
  return axios.request(axiosRequestArgs);
@@ -1078,7 +1427,7 @@ export const ProductsApiFp = function(configuration?: Configuration) {
1078
1427
  * @param {*} [options] Override http request option.
1079
1428
  * @throws {RequiredError}
1080
1429
  */
1081
- async getFeaturedProduct(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ExtendedProductDTO>>> {
1430
+ async getFeaturedProduct(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Product>>> {
1082
1431
  const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getFeaturedProduct(options);
1083
1432
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1084
1433
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
@@ -1087,7 +1436,7 @@ export const ProductsApiFp = function(configuration?: Configuration) {
1087
1436
  },
1088
1437
  /**
1089
1438
  *
1090
- * @summary Get insights on store Products
1439
+ * @summary Get product insights for the store
1091
1440
  * @param {*} [options] Override http request option.
1092
1441
  * @throws {RequiredError}
1093
1442
  */
@@ -1101,12 +1450,27 @@ export const ProductsApiFp = function(configuration?: Configuration) {
1101
1450
  /**
1102
1451
  *
1103
1452
  * @summary Get related products
1104
- * @param {string} productId Product ID
1453
+ * @param {string} id Product ID
1454
+ * @param {number} [limit]
1455
+ * @param {*} [options] Override http request option.
1456
+ * @throws {RequiredError}
1457
+ */
1458
+ async getRelatedProducts(id: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<Product>>>> {
1459
+ const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getRelatedProducts(id, limit, options);
1460
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1461
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1462
+ return axios.request(axiosRequestArgs);
1463
+ };
1464
+ },
1465
+ /**
1466
+ *
1467
+ * @summary [DEPRECATED] Use GET /products/:id/related instead
1468
+ * @param {string} productId
1105
1469
  * @param {*} [options] Override http request option.
1106
1470
  * @throws {RequiredError}
1107
1471
  */
1108
- async getRelatedProducts(productId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<ExtendedProductDTO>>>> {
1109
- const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getRelatedProducts(productId, options);
1472
+ async getRelatedProductsLegacy(productId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
1473
+ const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getRelatedProductsLegacy(productId, options);
1110
1474
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1111
1475
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1112
1476
  return axios.request(axiosRequestArgs);
@@ -1114,30 +1478,72 @@ export const ProductsApiFp = function(configuration?: Configuration) {
1114
1478
  },
1115
1479
  /**
1116
1480
  *
1117
- * @summary Get a single product
1481
+ * @summary Get a single product with all details
1118
1482
  * @param {string} id Product ID
1119
1483
  * @param {*} [options] Override http request option.
1120
1484
  * @throws {RequiredError}
1121
1485
  */
1122
- async getSingleProduct(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ExtendedProductDTO>>> {
1486
+ async getSingleProduct(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Product>>> {
1123
1487
  const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getSingleProduct(id, options);
1124
1488
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1125
1489
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1126
1490
  return axios.request(axiosRequestArgs);
1127
1491
  };
1128
1492
  },
1493
+ /**
1494
+ *
1495
+ * @summary [DEPRECATED] Use GET /products/:id instead
1496
+ * @param {string} id Product ID
1497
+ * @param {*} [options] Override http request option.
1498
+ * @throws {RequiredError}
1499
+ */
1500
+ async getSingleProductLegacy(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
1501
+ const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getSingleProductLegacy(id, options);
1502
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1503
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1504
+ return axios.request(axiosRequestArgs);
1505
+ };
1506
+ },
1129
1507
  /**
1130
1508
  *
1131
1509
  * @summary Get top selling products
1132
1510
  * @param {number} [limit]
1133
1511
  * @param {number} [page]
1134
- * @param {boolean} [isActive]
1135
- * @param {boolean} [includeNoVariantProducts]
1136
1512
  * @param {*} [options] Override http request option.
1137
1513
  * @throws {RequiredError}
1138
1514
  */
1139
- async getTopSellingProducts(limit?: number, page?: number, isActive?: boolean, includeNoVariantProducts?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PaginatedProductsDto>>> {
1140
- const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getTopSellingProducts(limit, page, isActive, includeNoVariantProducts, options);
1515
+ async getTopSellingProducts(limit?: number, page?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PaginatedProductsDto>>> {
1516
+ const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getTopSellingProducts(limit, page, options);
1517
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1518
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1519
+ return axios.request(axiosRequestArgs);
1520
+ };
1521
+ },
1522
+ /**
1523
+ *
1524
+ * @summary Reorder products within a category or subcategory
1525
+ * @param {ReorderProductsDto} body
1526
+ * @param {*} [options] Override http request option.
1527
+ * @throws {RequiredError}
1528
+ */
1529
+ async reorderProducts(body: ReorderProductsDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ReorderProductsSuccessResponseDto>>> {
1530
+ const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).reorderProducts(body, options);
1531
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1532
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1533
+ return axios.request(axiosRequestArgs);
1534
+ };
1535
+ },
1536
+ /**
1537
+ *
1538
+ * @summary Update variant inventory (add or subtract)
1539
+ * @param {VariantIdInventoryBody} body
1540
+ * @param {string} productId Product ID
1541
+ * @param {string} variantId Variant ID
1542
+ * @param {*} [options] Override http request option.
1543
+ * @throws {RequiredError}
1544
+ */
1545
+ async updateInventory(body: VariantIdInventoryBody, productId: string, variantId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
1546
+ const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).updateInventory(body, productId, variantId, options);
1141
1547
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1142
1548
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1143
1549
  return axios.request(axiosRequestArgs);
@@ -1145,19 +1551,35 @@ export const ProductsApiFp = function(configuration?: Configuration) {
1145
1551
  },
1146
1552
  /**
1147
1553
  *
1148
- * @summary Update a product
1554
+ * @summary Update a product (not variants)
1149
1555
  * @param {UpdateProductDto} body
1150
1556
  * @param {string} id Product ID
1151
1557
  * @param {*} [options] Override http request option.
1152
1558
  * @throws {RequiredError}
1153
1559
  */
1154
- async updateProduct(body: UpdateProductDto, id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ExtendedProductDTO>>> {
1560
+ async updateProduct(body: UpdateProductDto, id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Product>>> {
1155
1561
  const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).updateProduct(body, id, options);
1156
1562
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1157
1563
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1158
1564
  return axios.request(axiosRequestArgs);
1159
1565
  };
1160
1566
  },
1567
+ /**
1568
+ *
1569
+ * @summary Update a variant
1570
+ * @param {UpdateVariantDto} body
1571
+ * @param {string} productId Product ID
1572
+ * @param {string} variantId Variant ID
1573
+ * @param {*} [options] Override http request option.
1574
+ * @throws {RequiredError}
1575
+ */
1576
+ async updateVariant(body: UpdateVariantDto, productId: string, variantId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Product>>> {
1577
+ const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).updateVariant(body, productId, variantId, options);
1578
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1579
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1580
+ return axios.request(axiosRequestArgs);
1581
+ };
1582
+ },
1161
1583
  }
1162
1584
  };
1163
1585
 
@@ -1169,28 +1591,39 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP
1169
1591
  return {
1170
1592
  /**
1171
1593
  *
1172
- * @summary Create a product
1594
+ * @summary Add a new variant to a product
1595
+ * @param {CreateVariantDto} body
1596
+ * @param {string} productId Product ID
1597
+ * @param {*} [options] Override http request option.
1598
+ * @throws {RequiredError}
1599
+ */
1600
+ async addVariant(body: CreateVariantDto, productId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Product>> {
1601
+ return ProductsApiFp(configuration).addVariant(body, productId, options).then((request) => request(axios, basePath));
1602
+ },
1603
+ /**
1604
+ *
1605
+ * @summary Create a new product with variants
1173
1606
  * @param {CreateProductDto} body
1174
1607
  * @param {*} [options] Override http request option.
1175
1608
  * @throws {RequiredError}
1176
1609
  */
1177
- async createProduct(body: CreateProductDto, options?: AxiosRequestConfig): Promise<AxiosResponse<ExtendedProductDTO>> {
1610
+ async createProduct(body: CreateProductDto, options?: AxiosRequestConfig): Promise<AxiosResponse<Product>> {
1178
1611
  return ProductsApiFp(configuration).createProduct(body, options).then((request) => request(axios, basePath));
1179
1612
  },
1180
1613
  /**
1181
1614
  *
1182
- * @summary Create a Product that has a single variant
1183
- * @param {CreateSingleVariantProductDTO} body
1615
+ * @summary [DEPRECATED] Use POST /products instead
1616
+ * @param {CreateProductDto} body
1184
1617
  * @param {*} [options] Override http request option.
1185
1618
  * @throws {RequiredError}
1186
1619
  */
1187
- async createSingleVariantProduct(body: CreateSingleVariantProductDTO, options?: AxiosRequestConfig): Promise<AxiosResponse<ExtendedProductDTO>> {
1188
- return ProductsApiFp(configuration).createSingleVariantProduct(body, options).then((request) => request(axios, basePath));
1620
+ async createProductLegacy(body: CreateProductDto, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
1621
+ return ProductsApiFp(configuration).createProductLegacy(body, options).then((request) => request(axios, basePath));
1189
1622
  },
1190
1623
  /**
1191
1624
  *
1192
- * @summary Delete a product
1193
- * @param {string} id
1625
+ * @summary Delete a product and all its variants
1626
+ * @param {string} id Product ID
1194
1627
  * @param {*} [options] Override http request option.
1195
1628
  * @throws {RequiredError}
1196
1629
  */
@@ -1199,73 +1632,63 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP
1199
1632
  },
1200
1633
  /**
1201
1634
  *
1202
- * @summary Get all products of a specific category
1203
- * @param {string} categoryId Category ID
1204
- * @param {string} [searchTerm] OpenAI Search Query
1205
- * @param {number} [maxPrice] highest price to filter with
1206
- * @param {number} [minPrice] lowest price to filter with
1207
- * @param {string} [brandFilter] brands to filter with (comma separated string)
1208
- * @param {string} [availability] specifies whether to show available products or out of stock ones
1209
- * @param {string} [sort] specifies which attribute to sort with
1210
- * @param {boolean} [includeNoVariantProducts]
1211
- * @param {boolean} [isActive]
1212
- * @param {number} [limit]
1213
- * @param {number} [page]
1635
+ * @summary Delete a variant from a product
1636
+ * @param {string} productId Product ID
1637
+ * @param {string} variantId Variant ID
1214
1638
  * @param {*} [options] Override http request option.
1215
1639
  * @throws {RequiredError}
1216
1640
  */
1217
- async getAllCategoryProducts(categoryId: string, searchTerm?: string, maxPrice?: number, minPrice?: number, brandFilter?: string, availability?: string, sort?: string, includeNoVariantProducts?: boolean, isActive?: boolean, limit?: number, page?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<PaginatedProductsDto>> {
1218
- return ProductsApiFp(configuration).getAllCategoryProducts(categoryId, searchTerm, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options).then((request) => request(axios, basePath));
1641
+ async deleteVariant(productId: string, variantId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Product>> {
1642
+ return ProductsApiFp(configuration).deleteVariant(productId, variantId, options).then((request) => request(axios, basePath));
1219
1643
  },
1220
1644
  /**
1221
1645
  *
1222
- * @summary Get all filters for products
1646
+ * @summary [DEPRECATED] Use GET /products/all?categoryId=:id instead
1647
+ * @param {string} categoryId
1223
1648
  * @param {*} [options] Override http request option.
1224
1649
  * @throws {RequiredError}
1225
1650
  */
1226
- async getAllFilters(options?: AxiosRequestConfig): Promise<AxiosResponse<CategoryFilters>> {
1651
+ async getAllCategoryProducts(categoryId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
1652
+ return ProductsApiFp(configuration).getAllCategoryProducts(categoryId, options).then((request) => request(axios, basePath));
1653
+ },
1654
+ /**
1655
+ *
1656
+ * @summary Get all available filters (brands, price range)
1657
+ * @param {*} [options] Override http request option.
1658
+ * @throws {RequiredError}
1659
+ */
1660
+ async getAllFilters(options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
1227
1661
  return ProductsApiFp(configuration).getAllFilters(options).then((request) => request(axios, basePath));
1228
1662
  },
1229
1663
  /**
1230
1664
  *
1231
- * @summary Get all products of a specific sub category
1232
- * @param {string} subCategoryId Sub Category ID
1233
- * @param {string} [searchTerm] OpenAI Search Query
1234
- * @param {number} [maxPrice] highest price to filter with
1235
- * @param {number} [minPrice] lowest price to filter with
1236
- * @param {string} [brandFilter] brands to filter with (comma separated string)
1237
- * @param {string} [availability] specifies whether to show available products or out of stock ones
1238
- * @param {string} [sort] specifies which attribute to sort with
1239
- * @param {boolean} [includeNoVariantProducts]
1665
+ * @summary Get all products with filtering and pagination
1666
+ * @param {string} [searchTerm]
1667
+ * @param {number} [maxPrice]
1668
+ * @param {number} [minPrice]
1669
+ * @param {string} [brandFilter] Comma-separated brand names
1670
+ * @param {string} [availability]
1671
+ * @param {string} [sort]
1672
+ * @param {string} [subCategoryId]
1673
+ * @param {string} [categoryId]
1240
1674
  * @param {boolean} [isActive]
1241
1675
  * @param {number} [limit]
1242
1676
  * @param {number} [page]
1243
1677
  * @param {*} [options] Override http request option.
1244
1678
  * @throws {RequiredError}
1245
1679
  */
1246
- async getAllProducts(subCategoryId: string, searchTerm?: string, maxPrice?: number, minPrice?: number, brandFilter?: string, availability?: string, sort?: string, includeNoVariantProducts?: boolean, isActive?: boolean, limit?: number, page?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<PaginatedProductsDto>> {
1247
- return ProductsApiFp(configuration).getAllProducts(subCategoryId, searchTerm, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options).then((request) => request(axios, basePath));
1680
+ async getAllProducts(searchTerm?: string, maxPrice?: number, minPrice?: number, brandFilter?: string, availability?: string, sort?: string, subCategoryId?: string, categoryId?: string, isActive?: boolean, limit?: number, page?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<PaginatedProductsDto>> {
1681
+ return ProductsApiFp(configuration).getAllProducts(searchTerm, maxPrice, minPrice, brandFilter, availability, sort, subCategoryId, categoryId, isActive, limit, page, options).then((request) => request(axios, basePath));
1248
1682
  },
1249
1683
  /**
1250
1684
  *
1251
- * @summary Get all products
1252
- * @param {string} [searchTerm] OpenAI Search Query
1253
- * @param {string} [productType] Product Type
1254
- * @param {string} [categoryId] Category ID
1255
- * @param {number} [maxPrice] highest price to filter with
1256
- * @param {number} [minPrice] lowest price to filter with
1257
- * @param {string} [brandFilter] brands to filter with (comma separated string)
1258
- * @param {string} [availability] specifies whether to show available products or out of stock ones
1259
- * @param {string} [sort] specifies which attribute to sort with
1260
- * @param {boolean} [includeNoVariantProducts]
1261
- * @param {boolean} [isActive]
1262
- * @param {number} [limit]
1263
- * @param {number} [page]
1685
+ * @summary [DEPRECATED] Use GET /products/all?subCategoryId=:id instead
1686
+ * @param {string} subCategoryId
1264
1687
  * @param {*} [options] Override http request option.
1265
1688
  * @throws {RequiredError}
1266
1689
  */
1267
- async getAllProductsForStore(searchTerm?: string, productType?: string, categoryId?: string, maxPrice?: number, minPrice?: number, brandFilter?: string, availability?: string, sort?: string, includeNoVariantProducts?: boolean, isActive?: boolean, limit?: number, page?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<PaginatedProductsDto>> {
1268
- return ProductsApiFp(configuration).getAllProductsForStore(searchTerm, productType, categoryId, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options).then((request) => request(axios, basePath));
1690
+ async getAllProductsBySubCategory(subCategoryId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
1691
+ return ProductsApiFp(configuration).getAllProductsBySubCategory(subCategoryId, options).then((request) => request(axios, basePath));
1269
1692
  },
1270
1693
  /**
1271
1694
  *
@@ -1273,12 +1696,12 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP
1273
1696
  * @param {*} [options] Override http request option.
1274
1697
  * @throws {RequiredError}
1275
1698
  */
1276
- async getFeaturedProduct(options?: AxiosRequestConfig): Promise<AxiosResponse<ExtendedProductDTO>> {
1699
+ async getFeaturedProduct(options?: AxiosRequestConfig): Promise<AxiosResponse<Product>> {
1277
1700
  return ProductsApiFp(configuration).getFeaturedProduct(options).then((request) => request(axios, basePath));
1278
1701
  },
1279
1702
  /**
1280
1703
  *
1281
- * @summary Get insights on store Products
1704
+ * @summary Get product insights for the store
1282
1705
  * @param {*} [options] Override http request option.
1283
1706
  * @throws {RequiredError}
1284
1707
  */
@@ -1288,47 +1711,100 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP
1288
1711
  /**
1289
1712
  *
1290
1713
  * @summary Get related products
1291
- * @param {string} productId Product ID
1714
+ * @param {string} id Product ID
1715
+ * @param {number} [limit]
1716
+ * @param {*} [options] Override http request option.
1717
+ * @throws {RequiredError}
1718
+ */
1719
+ async getRelatedProducts(id: string, limit?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<Product>>> {
1720
+ return ProductsApiFp(configuration).getRelatedProducts(id, limit, options).then((request) => request(axios, basePath));
1721
+ },
1722
+ /**
1723
+ *
1724
+ * @summary [DEPRECATED] Use GET /products/:id/related instead
1725
+ * @param {string} productId
1292
1726
  * @param {*} [options] Override http request option.
1293
1727
  * @throws {RequiredError}
1294
1728
  */
1295
- async getRelatedProducts(productId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<ExtendedProductDTO>>> {
1296
- return ProductsApiFp(configuration).getRelatedProducts(productId, options).then((request) => request(axios, basePath));
1729
+ async getRelatedProductsLegacy(productId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
1730
+ return ProductsApiFp(configuration).getRelatedProductsLegacy(productId, options).then((request) => request(axios, basePath));
1297
1731
  },
1298
1732
  /**
1299
1733
  *
1300
- * @summary Get a single product
1734
+ * @summary Get a single product with all details
1301
1735
  * @param {string} id Product ID
1302
1736
  * @param {*} [options] Override http request option.
1303
1737
  * @throws {RequiredError}
1304
1738
  */
1305
- async getSingleProduct(id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ExtendedProductDTO>> {
1739
+ async getSingleProduct(id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Product>> {
1306
1740
  return ProductsApiFp(configuration).getSingleProduct(id, options).then((request) => request(axios, basePath));
1307
1741
  },
1742
+ /**
1743
+ *
1744
+ * @summary [DEPRECATED] Use GET /products/:id instead
1745
+ * @param {string} id Product ID
1746
+ * @param {*} [options] Override http request option.
1747
+ * @throws {RequiredError}
1748
+ */
1749
+ async getSingleProductLegacy(id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
1750
+ return ProductsApiFp(configuration).getSingleProductLegacy(id, options).then((request) => request(axios, basePath));
1751
+ },
1308
1752
  /**
1309
1753
  *
1310
1754
  * @summary Get top selling products
1311
1755
  * @param {number} [limit]
1312
1756
  * @param {number} [page]
1313
- * @param {boolean} [isActive]
1314
- * @param {boolean} [includeNoVariantProducts]
1315
1757
  * @param {*} [options] Override http request option.
1316
1758
  * @throws {RequiredError}
1317
1759
  */
1318
- async getTopSellingProducts(limit?: number, page?: number, isActive?: boolean, includeNoVariantProducts?: boolean, options?: AxiosRequestConfig): Promise<AxiosResponse<PaginatedProductsDto>> {
1319
- return ProductsApiFp(configuration).getTopSellingProducts(limit, page, isActive, includeNoVariantProducts, options).then((request) => request(axios, basePath));
1760
+ async getTopSellingProducts(limit?: number, page?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<PaginatedProductsDto>> {
1761
+ return ProductsApiFp(configuration).getTopSellingProducts(limit, page, options).then((request) => request(axios, basePath));
1762
+ },
1763
+ /**
1764
+ *
1765
+ * @summary Reorder products within a category or subcategory
1766
+ * @param {ReorderProductsDto} body
1767
+ * @param {*} [options] Override http request option.
1768
+ * @throws {RequiredError}
1769
+ */
1770
+ async reorderProducts(body: ReorderProductsDto, options?: AxiosRequestConfig): Promise<AxiosResponse<ReorderProductsSuccessResponseDto>> {
1771
+ return ProductsApiFp(configuration).reorderProducts(body, options).then((request) => request(axios, basePath));
1320
1772
  },
1321
1773
  /**
1322
1774
  *
1323
- * @summary Update a product
1775
+ * @summary Update variant inventory (add or subtract)
1776
+ * @param {VariantIdInventoryBody} body
1777
+ * @param {string} productId Product ID
1778
+ * @param {string} variantId Variant ID
1779
+ * @param {*} [options] Override http request option.
1780
+ * @throws {RequiredError}
1781
+ */
1782
+ async updateInventory(body: VariantIdInventoryBody, productId: string, variantId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
1783
+ return ProductsApiFp(configuration).updateInventory(body, productId, variantId, options).then((request) => request(axios, basePath));
1784
+ },
1785
+ /**
1786
+ *
1787
+ * @summary Update a product (not variants)
1324
1788
  * @param {UpdateProductDto} body
1325
1789
  * @param {string} id Product ID
1326
1790
  * @param {*} [options] Override http request option.
1327
1791
  * @throws {RequiredError}
1328
1792
  */
1329
- async updateProduct(body: UpdateProductDto, id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ExtendedProductDTO>> {
1793
+ async updateProduct(body: UpdateProductDto, id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Product>> {
1330
1794
  return ProductsApiFp(configuration).updateProduct(body, id, options).then((request) => request(axios, basePath));
1331
1795
  },
1796
+ /**
1797
+ *
1798
+ * @summary Update a variant
1799
+ * @param {UpdateVariantDto} body
1800
+ * @param {string} productId Product ID
1801
+ * @param {string} variantId Variant ID
1802
+ * @param {*} [options] Override http request option.
1803
+ * @throws {RequiredError}
1804
+ */
1805
+ async updateVariant(body: UpdateVariantDto, productId: string, variantId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Product>> {
1806
+ return ProductsApiFp(configuration).updateVariant(body, productId, variantId, options).then((request) => request(axios, basePath));
1807
+ },
1332
1808
  };
1333
1809
  };
1334
1810
 
@@ -1341,30 +1817,42 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP
1341
1817
  export class ProductsApi extends BaseAPI {
1342
1818
  /**
1343
1819
  *
1344
- * @summary Create a product
1820
+ * @summary Add a new variant to a product
1821
+ * @param {CreateVariantDto} body
1822
+ * @param {string} productId Product ID
1823
+ * @param {*} [options] Override http request option.
1824
+ * @throws {RequiredError}
1825
+ * @memberof ProductsApi
1826
+ */
1827
+ public async addVariant(body: CreateVariantDto, productId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Product>> {
1828
+ return ProductsApiFp(this.configuration).addVariant(body, productId, options).then((request) => request(this.axios, this.basePath));
1829
+ }
1830
+ /**
1831
+ *
1832
+ * @summary Create a new product with variants
1345
1833
  * @param {CreateProductDto} body
1346
1834
  * @param {*} [options] Override http request option.
1347
1835
  * @throws {RequiredError}
1348
1836
  * @memberof ProductsApi
1349
1837
  */
1350
- public async createProduct(body: CreateProductDto, options?: AxiosRequestConfig) : Promise<AxiosResponse<ExtendedProductDTO>> {
1838
+ public async createProduct(body: CreateProductDto, options?: AxiosRequestConfig) : Promise<AxiosResponse<Product>> {
1351
1839
  return ProductsApiFp(this.configuration).createProduct(body, options).then((request) => request(this.axios, this.basePath));
1352
1840
  }
1353
1841
  /**
1354
1842
  *
1355
- * @summary Create a Product that has a single variant
1356
- * @param {CreateSingleVariantProductDTO} body
1843
+ * @summary [DEPRECATED] Use POST /products instead
1844
+ * @param {CreateProductDto} body
1357
1845
  * @param {*} [options] Override http request option.
1358
1846
  * @throws {RequiredError}
1359
1847
  * @memberof ProductsApi
1360
1848
  */
1361
- public async createSingleVariantProduct(body: CreateSingleVariantProductDTO, options?: AxiosRequestConfig) : Promise<AxiosResponse<ExtendedProductDTO>> {
1362
- return ProductsApiFp(this.configuration).createSingleVariantProduct(body, options).then((request) => request(this.axios, this.basePath));
1849
+ public async createProductLegacy(body: CreateProductDto, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
1850
+ return ProductsApiFp(this.configuration).createProductLegacy(body, options).then((request) => request(this.axios, this.basePath));
1363
1851
  }
1364
1852
  /**
1365
1853
  *
1366
- * @summary Delete a product
1367
- * @param {string} id
1854
+ * @summary Delete a product and all its variants
1855
+ * @param {string} id Product ID
1368
1856
  * @param {*} [options] Override http request option.
1369
1857
  * @throws {RequiredError}
1370
1858
  * @memberof ProductsApi
@@ -1374,46 +1862,48 @@ export class ProductsApi extends BaseAPI {
1374
1862
  }
1375
1863
  /**
1376
1864
  *
1377
- * @summary Get all products of a specific category
1378
- * @param {string} categoryId Category ID
1379
- * @param {string} [searchTerm] OpenAI Search Query
1380
- * @param {number} [maxPrice] highest price to filter with
1381
- * @param {number} [minPrice] lowest price to filter with
1382
- * @param {string} [brandFilter] brands to filter with (comma separated string)
1383
- * @param {string} [availability] specifies whether to show available products or out of stock ones
1384
- * @param {string} [sort] specifies which attribute to sort with
1385
- * @param {boolean} [includeNoVariantProducts]
1386
- * @param {boolean} [isActive]
1387
- * @param {number} [limit]
1388
- * @param {number} [page]
1865
+ * @summary Delete a variant from a product
1866
+ * @param {string} productId Product ID
1867
+ * @param {string} variantId Variant ID
1868
+ * @param {*} [options] Override http request option.
1869
+ * @throws {RequiredError}
1870
+ * @memberof ProductsApi
1871
+ */
1872
+ public async deleteVariant(productId: string, variantId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Product>> {
1873
+ return ProductsApiFp(this.configuration).deleteVariant(productId, variantId, options).then((request) => request(this.axios, this.basePath));
1874
+ }
1875
+ /**
1876
+ *
1877
+ * @summary [DEPRECATED] Use GET /products/all?categoryId=:id instead
1878
+ * @param {string} categoryId
1389
1879
  * @param {*} [options] Override http request option.
1390
1880
  * @throws {RequiredError}
1391
1881
  * @memberof ProductsApi
1392
1882
  */
1393
- public async getAllCategoryProducts(categoryId: string, searchTerm?: string, maxPrice?: number, minPrice?: number, brandFilter?: string, availability?: string, sort?: string, includeNoVariantProducts?: boolean, isActive?: boolean, limit?: number, page?: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<PaginatedProductsDto>> {
1394
- return ProductsApiFp(this.configuration).getAllCategoryProducts(categoryId, searchTerm, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options).then((request) => request(this.axios, this.basePath));
1883
+ public async getAllCategoryProducts(categoryId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
1884
+ return ProductsApiFp(this.configuration).getAllCategoryProducts(categoryId, options).then((request) => request(this.axios, this.basePath));
1395
1885
  }
1396
1886
  /**
1397
1887
  *
1398
- * @summary Get all filters for products
1888
+ * @summary Get all available filters (brands, price range)
1399
1889
  * @param {*} [options] Override http request option.
1400
1890
  * @throws {RequiredError}
1401
1891
  * @memberof ProductsApi
1402
1892
  */
1403
- public async getAllFilters(options?: AxiosRequestConfig) : Promise<AxiosResponse<CategoryFilters>> {
1893
+ public async getAllFilters(options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
1404
1894
  return ProductsApiFp(this.configuration).getAllFilters(options).then((request) => request(this.axios, this.basePath));
1405
1895
  }
1406
1896
  /**
1407
1897
  *
1408
- * @summary Get all products of a specific sub category
1409
- * @param {string} subCategoryId Sub Category ID
1410
- * @param {string} [searchTerm] OpenAI Search Query
1411
- * @param {number} [maxPrice] highest price to filter with
1412
- * @param {number} [minPrice] lowest price to filter with
1413
- * @param {string} [brandFilter] brands to filter with (comma separated string)
1414
- * @param {string} [availability] specifies whether to show available products or out of stock ones
1415
- * @param {string} [sort] specifies which attribute to sort with
1416
- * @param {boolean} [includeNoVariantProducts]
1898
+ * @summary Get all products with filtering and pagination
1899
+ * @param {string} [searchTerm]
1900
+ * @param {number} [maxPrice]
1901
+ * @param {number} [minPrice]
1902
+ * @param {string} [brandFilter] Comma-separated brand names
1903
+ * @param {string} [availability]
1904
+ * @param {string} [sort]
1905
+ * @param {string} [subCategoryId]
1906
+ * @param {string} [categoryId]
1417
1907
  * @param {boolean} [isActive]
1418
1908
  * @param {number} [limit]
1419
1909
  * @param {number} [page]
@@ -1421,30 +1911,19 @@ export class ProductsApi extends BaseAPI {
1421
1911
  * @throws {RequiredError}
1422
1912
  * @memberof ProductsApi
1423
1913
  */
1424
- public async getAllProducts(subCategoryId: string, searchTerm?: string, maxPrice?: number, minPrice?: number, brandFilter?: string, availability?: string, sort?: string, includeNoVariantProducts?: boolean, isActive?: boolean, limit?: number, page?: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<PaginatedProductsDto>> {
1425
- return ProductsApiFp(this.configuration).getAllProducts(subCategoryId, searchTerm, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options).then((request) => request(this.axios, this.basePath));
1914
+ public async getAllProducts(searchTerm?: string, maxPrice?: number, minPrice?: number, brandFilter?: string, availability?: string, sort?: string, subCategoryId?: string, categoryId?: string, isActive?: boolean, limit?: number, page?: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<PaginatedProductsDto>> {
1915
+ return ProductsApiFp(this.configuration).getAllProducts(searchTerm, maxPrice, minPrice, brandFilter, availability, sort, subCategoryId, categoryId, isActive, limit, page, options).then((request) => request(this.axios, this.basePath));
1426
1916
  }
1427
1917
  /**
1428
1918
  *
1429
- * @summary Get all products
1430
- * @param {string} [searchTerm] OpenAI Search Query
1431
- * @param {string} [productType] Product Type
1432
- * @param {string} [categoryId] Category ID
1433
- * @param {number} [maxPrice] highest price to filter with
1434
- * @param {number} [minPrice] lowest price to filter with
1435
- * @param {string} [brandFilter] brands to filter with (comma separated string)
1436
- * @param {string} [availability] specifies whether to show available products or out of stock ones
1437
- * @param {string} [sort] specifies which attribute to sort with
1438
- * @param {boolean} [includeNoVariantProducts]
1439
- * @param {boolean} [isActive]
1440
- * @param {number} [limit]
1441
- * @param {number} [page]
1919
+ * @summary [DEPRECATED] Use GET /products/all?subCategoryId=:id instead
1920
+ * @param {string} subCategoryId
1442
1921
  * @param {*} [options] Override http request option.
1443
1922
  * @throws {RequiredError}
1444
1923
  * @memberof ProductsApi
1445
1924
  */
1446
- public async getAllProductsForStore(searchTerm?: string, productType?: string, categoryId?: string, maxPrice?: number, minPrice?: number, brandFilter?: string, availability?: string, sort?: string, includeNoVariantProducts?: boolean, isActive?: boolean, limit?: number, page?: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<PaginatedProductsDto>> {
1447
- return ProductsApiFp(this.configuration).getAllProductsForStore(searchTerm, productType, categoryId, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options).then((request) => request(this.axios, this.basePath));
1925
+ public async getAllProductsBySubCategory(subCategoryId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
1926
+ return ProductsApiFp(this.configuration).getAllProductsBySubCategory(subCategoryId, options).then((request) => request(this.axios, this.basePath));
1448
1927
  }
1449
1928
  /**
1450
1929
  *
@@ -1453,12 +1932,12 @@ export class ProductsApi extends BaseAPI {
1453
1932
  * @throws {RequiredError}
1454
1933
  * @memberof ProductsApi
1455
1934
  */
1456
- public async getFeaturedProduct(options?: AxiosRequestConfig) : Promise<AxiosResponse<ExtendedProductDTO>> {
1935
+ public async getFeaturedProduct(options?: AxiosRequestConfig) : Promise<AxiosResponse<Product>> {
1457
1936
  return ProductsApiFp(this.configuration).getFeaturedProduct(options).then((request) => request(this.axios, this.basePath));
1458
1937
  }
1459
1938
  /**
1460
1939
  *
1461
- * @summary Get insights on store Products
1940
+ * @summary Get product insights for the store
1462
1941
  * @param {*} [options] Override http request option.
1463
1942
  * @throws {RequiredError}
1464
1943
  * @memberof ProductsApi
@@ -1469,49 +1948,107 @@ export class ProductsApi extends BaseAPI {
1469
1948
  /**
1470
1949
  *
1471
1950
  * @summary Get related products
1472
- * @param {string} productId Product ID
1951
+ * @param {string} id Product ID
1952
+ * @param {number} [limit]
1953
+ * @param {*} [options] Override http request option.
1954
+ * @throws {RequiredError}
1955
+ * @memberof ProductsApi
1956
+ */
1957
+ public async getRelatedProducts(id: string, limit?: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<Product>>> {
1958
+ return ProductsApiFp(this.configuration).getRelatedProducts(id, limit, options).then((request) => request(this.axios, this.basePath));
1959
+ }
1960
+ /**
1961
+ *
1962
+ * @summary [DEPRECATED] Use GET /products/:id/related instead
1963
+ * @param {string} productId
1473
1964
  * @param {*} [options] Override http request option.
1474
1965
  * @throws {RequiredError}
1475
1966
  * @memberof ProductsApi
1476
1967
  */
1477
- public async getRelatedProducts(productId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<ExtendedProductDTO>>> {
1478
- return ProductsApiFp(this.configuration).getRelatedProducts(productId, options).then((request) => request(this.axios, this.basePath));
1968
+ public async getRelatedProductsLegacy(productId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
1969
+ return ProductsApiFp(this.configuration).getRelatedProductsLegacy(productId, options).then((request) => request(this.axios, this.basePath));
1479
1970
  }
1480
1971
  /**
1481
1972
  *
1482
- * @summary Get a single product
1973
+ * @summary Get a single product with all details
1483
1974
  * @param {string} id Product ID
1484
1975
  * @param {*} [options] Override http request option.
1485
1976
  * @throws {RequiredError}
1486
1977
  * @memberof ProductsApi
1487
1978
  */
1488
- public async getSingleProduct(id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ExtendedProductDTO>> {
1979
+ public async getSingleProduct(id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Product>> {
1489
1980
  return ProductsApiFp(this.configuration).getSingleProduct(id, options).then((request) => request(this.axios, this.basePath));
1490
1981
  }
1982
+ /**
1983
+ *
1984
+ * @summary [DEPRECATED] Use GET /products/:id instead
1985
+ * @param {string} id Product ID
1986
+ * @param {*} [options] Override http request option.
1987
+ * @throws {RequiredError}
1988
+ * @memberof ProductsApi
1989
+ */
1990
+ public async getSingleProductLegacy(id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
1991
+ return ProductsApiFp(this.configuration).getSingleProductLegacy(id, options).then((request) => request(this.axios, this.basePath));
1992
+ }
1491
1993
  /**
1492
1994
  *
1493
1995
  * @summary Get top selling products
1494
1996
  * @param {number} [limit]
1495
1997
  * @param {number} [page]
1496
- * @param {boolean} [isActive]
1497
- * @param {boolean} [includeNoVariantProducts]
1498
1998
  * @param {*} [options] Override http request option.
1499
1999
  * @throws {RequiredError}
1500
2000
  * @memberof ProductsApi
1501
2001
  */
1502
- public async getTopSellingProducts(limit?: number, page?: number, isActive?: boolean, includeNoVariantProducts?: boolean, options?: AxiosRequestConfig) : Promise<AxiosResponse<PaginatedProductsDto>> {
1503
- return ProductsApiFp(this.configuration).getTopSellingProducts(limit, page, isActive, includeNoVariantProducts, options).then((request) => request(this.axios, this.basePath));
2002
+ public async getTopSellingProducts(limit?: number, page?: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<PaginatedProductsDto>> {
2003
+ return ProductsApiFp(this.configuration).getTopSellingProducts(limit, page, options).then((request) => request(this.axios, this.basePath));
2004
+ }
2005
+ /**
2006
+ *
2007
+ * @summary Reorder products within a category or subcategory
2008
+ * @param {ReorderProductsDto} body
2009
+ * @param {*} [options] Override http request option.
2010
+ * @throws {RequiredError}
2011
+ * @memberof ProductsApi
2012
+ */
2013
+ public async reorderProducts(body: ReorderProductsDto, options?: AxiosRequestConfig) : Promise<AxiosResponse<ReorderProductsSuccessResponseDto>> {
2014
+ return ProductsApiFp(this.configuration).reorderProducts(body, options).then((request) => request(this.axios, this.basePath));
1504
2015
  }
1505
2016
  /**
1506
2017
  *
1507
- * @summary Update a product
2018
+ * @summary Update variant inventory (add or subtract)
2019
+ * @param {VariantIdInventoryBody} body
2020
+ * @param {string} productId Product ID
2021
+ * @param {string} variantId Variant ID
2022
+ * @param {*} [options] Override http request option.
2023
+ * @throws {RequiredError}
2024
+ * @memberof ProductsApi
2025
+ */
2026
+ public async updateInventory(body: VariantIdInventoryBody, productId: string, variantId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
2027
+ return ProductsApiFp(this.configuration).updateInventory(body, productId, variantId, options).then((request) => request(this.axios, this.basePath));
2028
+ }
2029
+ /**
2030
+ *
2031
+ * @summary Update a product (not variants)
1508
2032
  * @param {UpdateProductDto} body
1509
2033
  * @param {string} id Product ID
1510
2034
  * @param {*} [options] Override http request option.
1511
2035
  * @throws {RequiredError}
1512
2036
  * @memberof ProductsApi
1513
2037
  */
1514
- public async updateProduct(body: UpdateProductDto, id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ExtendedProductDTO>> {
2038
+ public async updateProduct(body: UpdateProductDto, id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Product>> {
1515
2039
  return ProductsApiFp(this.configuration).updateProduct(body, id, options).then((request) => request(this.axios, this.basePath));
1516
2040
  }
2041
+ /**
2042
+ *
2043
+ * @summary Update a variant
2044
+ * @param {UpdateVariantDto} body
2045
+ * @param {string} productId Product ID
2046
+ * @param {string} variantId Variant ID
2047
+ * @param {*} [options] Override http request option.
2048
+ * @throws {RequiredError}
2049
+ * @memberof ProductsApi
2050
+ */
2051
+ public async updateVariant(body: UpdateVariantDto, productId: string, variantId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Product>> {
2052
+ return ProductsApiFp(this.configuration).updateVariant(body, productId, variantId, options).then((request) => request(this.axios, this.basePath));
2053
+ }
1517
2054
  }