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