hey-pharmacist-ecommerce 1.1.27 → 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.
Files changed (61) hide show
  1. package/dist/index.d.mts +344 -640
  2. package/dist/index.d.ts +344 -640
  3. package/dist/index.js +1814 -835
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +1814 -837
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +1 -1
  8. package/src/components/AccountOrdersTab.tsx +1 -1
  9. package/src/components/AccountSettingsTab.tsx +88 -6
  10. package/src/components/CartItem.tsx +1 -1
  11. package/src/components/Header.tsx +8 -2
  12. package/src/components/OrderCard.tsx +4 -4
  13. package/src/components/ProductCard.tsx +59 -42
  14. package/src/components/QuickViewModal.tsx +13 -13
  15. package/src/hooks/useAddresses.ts +4 -1
  16. package/src/hooks/usePaymentMethods.ts +26 -31
  17. package/src/hooks/useProducts.ts +63 -64
  18. package/src/hooks/useWishlistProducts.ts +4 -5
  19. package/src/index.ts +2 -0
  20. package/src/lib/Apis/api.ts +0 -1
  21. package/src/lib/Apis/apis/auth-api.ts +18 -29
  22. package/src/lib/Apis/apis/products-api.ts +845 -405
  23. package/src/lib/Apis/models/category-populated.ts +0 -12
  24. package/src/lib/Apis/models/category-sub-category-populated.ts +2 -2
  25. package/src/lib/Apis/models/category.ts +0 -18
  26. package/src/lib/Apis/models/{table-cell-dto.ts → change-password-dto.ts} +6 -6
  27. package/src/lib/Apis/models/create-product-dto.ts +30 -23
  28. package/src/lib/Apis/models/create-sub-category-dto.ts +6 -0
  29. package/src/lib/Apis/models/create-variant-dto.ts +29 -29
  30. package/src/lib/Apis/models/index.ts +5 -7
  31. package/src/lib/Apis/models/paginated-products-dto.ts +6 -6
  32. package/src/lib/Apis/models/product-summary.ts +69 -0
  33. package/src/lib/Apis/models/product-variant.ts +34 -65
  34. package/src/lib/Apis/models/product.ts +138 -0
  35. package/src/lib/Apis/models/products-insights-dto.ts +12 -0
  36. package/src/lib/Apis/models/single-product-media.ts +0 -12
  37. package/src/lib/Apis/models/sub-category.ts +6 -12
  38. package/src/lib/Apis/models/update-product-dto.ts +30 -19
  39. package/src/lib/Apis/models/update-sub-category-dto.ts +6 -0
  40. package/src/lib/Apis/models/{update-product-variant-dto.ts → update-variant-dto.ts} +51 -45
  41. package/src/lib/Apis/models/{shallow-parent-category-dto.ts → variant-id-inventory-body.ts} +5 -11
  42. package/src/lib/api-adapter/config.ts +53 -0
  43. package/src/lib/validations/address.ts +1 -1
  44. package/src/providers/FavoritesProvider.tsx +5 -5
  45. package/src/providers/WishlistProvider.tsx +4 -4
  46. package/src/screens/CartScreen.tsx +1 -1
  47. package/src/screens/ChangePasswordScreen.tsx +2 -6
  48. package/src/screens/CheckoutScreen.tsx +40 -11
  49. package/src/screens/EditProfileScreen.tsx +5 -1
  50. package/src/screens/ForgotPasswordScreen.tsx +153 -0
  51. package/src/screens/ProductDetailScreen.tsx +51 -60
  52. package/src/screens/RegisterScreen.tsx +31 -31
  53. package/src/screens/ResetPasswordScreen.tsx +202 -0
  54. package/src/screens/SearchResultsScreen.tsx +264 -26
  55. package/src/screens/ShopScreen.tsx +42 -45
  56. package/src/screens/WishlistScreen.tsx +35 -31
  57. package/src/lib/Apis/apis/product-variants-api.ts +0 -552
  58. package/src/lib/Apis/models/create-single-variant-product-dto.ts +0 -154
  59. package/src/lib/Apis/models/extended-product-dto.ts +0 -206
  60. package/src/lib/Apis/models/frequently-bought-product-dto.ts +0 -71
  61. package/src/lib/Apis/models/table-dto.ts +0 -34
@@ -1,552 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Hey Pharamcist API
5
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
6
- *
7
- * OpenAPI spec version: 1.0
8
- *
9
- *
10
- * NOTE: This class is auto generated by the swagger code generator program.
11
- * https://github.com/swagger-api/swagger-codegen.git
12
- * Do not edit the class manually.
13
- */
14
- import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
15
- import { Configuration } from '../configuration';
16
- // Some imports not used depending on template conditions
17
- // @ts-ignore
18
- import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
19
- import { CreateVariantDto } from '../models';
20
- import { ProductVariant } from '../models';
21
- import { UpdateProductVariantDto } from '../models';
22
- /**
23
- * ProductVariantsApi - axios parameter creator
24
- * @export
25
- */
26
- export const ProductVariantsApiAxiosParamCreator = function (configuration?: Configuration) {
27
- return {
28
- /**
29
- *
30
- * @summary Create bulk variants for a product
31
- * @param {Array<CreateVariantDto>} body
32
- * @param {string} productId Product ID
33
- * @param {*} [options] Override http request option.
34
- * @throws {RequiredError}
35
- */
36
- createBulkVariants: async (body: Array<CreateVariantDto>, productId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
37
- // verify required parameter 'body' is not null or undefined
38
- if (body === null || body === undefined) {
39
- throw new RequiredError('body','Required parameter body was null or undefined when calling createBulkVariants.');
40
- }
41
- // verify required parameter 'productId' is not null or undefined
42
- if (productId === null || productId === undefined) {
43
- throw new RequiredError('productId','Required parameter productId was null or undefined when calling createBulkVariants.');
44
- }
45
- const localVarPath = `/product-variants/create-bulk-variants/{productId}`
46
- .replace(`{${"productId"}}`, encodeURIComponent(String(productId)));
47
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
48
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
49
- let baseOptions;
50
- if (configuration) {
51
- baseOptions = configuration.baseOptions;
52
- }
53
- const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
54
- const localVarHeaderParameter = {} as any;
55
- const localVarQueryParameter = {} as any;
56
-
57
- // authentication bearer required
58
- // http bearer authentication required
59
- if (configuration && configuration.accessToken) {
60
- const accessToken = typeof configuration.accessToken === 'function'
61
- ? await configuration.accessToken()
62
- : await configuration.accessToken;
63
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
64
- }
65
-
66
- // authentication x-store-key required
67
- if (configuration && configuration.apiKey) {
68
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
69
- ? await configuration.apiKey("x-store-key")
70
- : await configuration.apiKey;
71
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
72
- }
73
-
74
- localVarHeaderParameter['Content-Type'] = 'application/json';
75
-
76
- const query = new URLSearchParams(localVarUrlObj.search);
77
- for (const key in localVarQueryParameter) {
78
- query.set(key, localVarQueryParameter[key]);
79
- }
80
- for (const key in options.params) {
81
- query.set(key, options.params[key]);
82
- }
83
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
84
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
85
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
86
- const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
87
- localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
88
-
89
- return {
90
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
91
- options: localVarRequestOptions,
92
- };
93
- },
94
- /**
95
- *
96
- * @summary Create a variant for a product
97
- * @param {CreateVariantDto} body
98
- * @param {string} productId Product ID
99
- * @param {*} [options] Override http request option.
100
- * @throws {RequiredError}
101
- */
102
- createVariant: async (body: CreateVariantDto, productId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
103
- // verify required parameter 'body' is not null or undefined
104
- if (body === null || body === undefined) {
105
- throw new RequiredError('body','Required parameter body was null or undefined when calling createVariant.');
106
- }
107
- // verify required parameter 'productId' is not null or undefined
108
- if (productId === null || productId === undefined) {
109
- throw new RequiredError('productId','Required parameter productId was null or undefined when calling createVariant.');
110
- }
111
- const localVarPath = `/product-variants/create/{productId}`
112
- .replace(`{${"productId"}}`, encodeURIComponent(String(productId)));
113
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
114
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
115
- let baseOptions;
116
- if (configuration) {
117
- baseOptions = configuration.baseOptions;
118
- }
119
- const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
120
- const localVarHeaderParameter = {} as any;
121
- const localVarQueryParameter = {} as any;
122
-
123
- // authentication bearer required
124
- // http bearer authentication required
125
- if (configuration && configuration.accessToken) {
126
- const accessToken = typeof configuration.accessToken === 'function'
127
- ? await configuration.accessToken()
128
- : await configuration.accessToken;
129
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
130
- }
131
-
132
- // authentication x-store-key required
133
- if (configuration && configuration.apiKey) {
134
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
135
- ? await configuration.apiKey("x-store-key")
136
- : await configuration.apiKey;
137
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
138
- }
139
-
140
- localVarHeaderParameter['Content-Type'] = 'application/json';
141
-
142
- const query = new URLSearchParams(localVarUrlObj.search);
143
- for (const key in localVarQueryParameter) {
144
- query.set(key, localVarQueryParameter[key]);
145
- }
146
- for (const key in options.params) {
147
- query.set(key, options.params[key]);
148
- }
149
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
150
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
151
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
152
- const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
153
- localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
154
-
155
- return {
156
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
157
- options: localVarRequestOptions,
158
- };
159
- },
160
- /**
161
- *
162
- * @summary Delete a variant
163
- * @param {string} variantId
164
- * @param {*} [options] Override http request option.
165
- * @throws {RequiredError}
166
- */
167
- deleteVariant: async (variantId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
168
- // verify required parameter 'variantId' is not null or undefined
169
- if (variantId === null || variantId === undefined) {
170
- throw new RequiredError('variantId','Required parameter variantId was null or undefined when calling deleteVariant.');
171
- }
172
- const localVarPath = `/product-variants/{variantId}`
173
- .replace(`{${"variantId"}}`, encodeURIComponent(String(variantId)));
174
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
175
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
176
- let baseOptions;
177
- if (configuration) {
178
- baseOptions = configuration.baseOptions;
179
- }
180
- const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options};
181
- const localVarHeaderParameter = {} as any;
182
- const localVarQueryParameter = {} as any;
183
-
184
- // authentication bearer required
185
- // http bearer authentication required
186
- if (configuration && configuration.accessToken) {
187
- const accessToken = typeof configuration.accessToken === 'function'
188
- ? await configuration.accessToken()
189
- : await configuration.accessToken;
190
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
191
- }
192
-
193
- // authentication x-store-key required
194
- if (configuration && configuration.apiKey) {
195
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
196
- ? await configuration.apiKey("x-store-key")
197
- : await configuration.apiKey;
198
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
199
- }
200
-
201
- const query = new URLSearchParams(localVarUrlObj.search);
202
- for (const key in localVarQueryParameter) {
203
- query.set(key, localVarQueryParameter[key]);
204
- }
205
- for (const key in options.params) {
206
- query.set(key, options.params[key]);
207
- }
208
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
209
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
210
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
211
-
212
- return {
213
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
214
- options: localVarRequestOptions,
215
- };
216
- },
217
- /**
218
- *
219
- * @summary Edit a variant
220
- * @param {UpdateProductVariantDto} body
221
- * @param {string} variantId
222
- * @param {*} [options] Override http request option.
223
- * @throws {RequiredError}
224
- */
225
- editVariant: async (body: UpdateProductVariantDto, variantId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
226
- // verify required parameter 'body' is not null or undefined
227
- if (body === null || body === undefined) {
228
- throw new RequiredError('body','Required parameter body was null or undefined when calling editVariant.');
229
- }
230
- // verify required parameter 'variantId' is not null or undefined
231
- if (variantId === null || variantId === undefined) {
232
- throw new RequiredError('variantId','Required parameter variantId was null or undefined when calling editVariant.');
233
- }
234
- const localVarPath = `/product-variants/{variantId}`
235
- .replace(`{${"variantId"}}`, encodeURIComponent(String(variantId)));
236
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
237
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
238
- let baseOptions;
239
- if (configuration) {
240
- baseOptions = configuration.baseOptions;
241
- }
242
- const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
243
- const localVarHeaderParameter = {} as any;
244
- const localVarQueryParameter = {} as any;
245
-
246
- // authentication bearer required
247
- // http bearer authentication required
248
- if (configuration && configuration.accessToken) {
249
- const accessToken = typeof configuration.accessToken === 'function'
250
- ? await configuration.accessToken()
251
- : await configuration.accessToken;
252
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
253
- }
254
-
255
- // authentication x-store-key required
256
- if (configuration && configuration.apiKey) {
257
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
258
- ? await configuration.apiKey("x-store-key")
259
- : await configuration.apiKey;
260
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
261
- }
262
-
263
- localVarHeaderParameter['Content-Type'] = 'application/json';
264
-
265
- const query = new URLSearchParams(localVarUrlObj.search);
266
- for (const key in localVarQueryParameter) {
267
- query.set(key, localVarQueryParameter[key]);
268
- }
269
- for (const key in options.params) {
270
- query.set(key, options.params[key]);
271
- }
272
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
273
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
274
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
275
- const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
276
- localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
277
-
278
- return {
279
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
280
- options: localVarRequestOptions,
281
- };
282
- },
283
- /**
284
- *
285
- * @summary Get all variants of a product
286
- * @param {string} productId Product ID
287
- * @param {*} [options] Override http request option.
288
- * @throws {RequiredError}
289
- */
290
- getAllVariants: async (productId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
291
- // verify required parameter 'productId' is not null or undefined
292
- if (productId === null || productId === undefined) {
293
- throw new RequiredError('productId','Required parameter productId was null or undefined when calling getAllVariants.');
294
- }
295
- const localVarPath = `/product-variants/allVariants/{productId}`
296
- .replace(`{${"productId"}}`, encodeURIComponent(String(productId)));
297
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
298
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
299
- let baseOptions;
300
- if (configuration) {
301
- baseOptions = configuration.baseOptions;
302
- }
303
- const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
304
- const localVarHeaderParameter = {} as any;
305
- const localVarQueryParameter = {} as any;
306
-
307
- // authentication bearer required
308
- // http bearer authentication required
309
- if (configuration && configuration.accessToken) {
310
- const accessToken = typeof configuration.accessToken === 'function'
311
- ? await configuration.accessToken()
312
- : await configuration.accessToken;
313
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
314
- }
315
-
316
- // authentication x-store-key required
317
- if (configuration && configuration.apiKey) {
318
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
319
- ? await configuration.apiKey("x-store-key")
320
- : await configuration.apiKey;
321
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
322
- }
323
-
324
- const query = new URLSearchParams(localVarUrlObj.search);
325
- for (const key in localVarQueryParameter) {
326
- query.set(key, localVarQueryParameter[key]);
327
- }
328
- for (const key in options.params) {
329
- query.set(key, options.params[key]);
330
- }
331
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
332
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
333
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
334
-
335
- return {
336
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
337
- options: localVarRequestOptions,
338
- };
339
- },
340
- }
341
- };
342
-
343
- /**
344
- * ProductVariantsApi - functional programming interface
345
- * @export
346
- */
347
- export const ProductVariantsApiFp = function(configuration?: Configuration) {
348
- return {
349
- /**
350
- *
351
- * @summary Create bulk variants for a product
352
- * @param {Array<CreateVariantDto>} body
353
- * @param {string} productId Product ID
354
- * @param {*} [options] Override http request option.
355
- * @throws {RequiredError}
356
- */
357
- async createBulkVariants(body: Array<CreateVariantDto>, productId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<ProductVariant>>>> {
358
- const localVarAxiosArgs = await ProductVariantsApiAxiosParamCreator(configuration).createBulkVariants(body, productId, options);
359
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
360
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
361
- return axios.request(axiosRequestArgs);
362
- };
363
- },
364
- /**
365
- *
366
- * @summary Create a variant for a product
367
- * @param {CreateVariantDto} body
368
- * @param {string} productId Product ID
369
- * @param {*} [options] Override http request option.
370
- * @throws {RequiredError}
371
- */
372
- async createVariant(body: CreateVariantDto, productId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ProductVariant>>> {
373
- const localVarAxiosArgs = await ProductVariantsApiAxiosParamCreator(configuration).createVariant(body, productId, options);
374
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
375
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
376
- return axios.request(axiosRequestArgs);
377
- };
378
- },
379
- /**
380
- *
381
- * @summary Delete a variant
382
- * @param {string} variantId
383
- * @param {*} [options] Override http request option.
384
- * @throws {RequiredError}
385
- */
386
- async deleteVariant(variantId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
387
- const localVarAxiosArgs = await ProductVariantsApiAxiosParamCreator(configuration).deleteVariant(variantId, options);
388
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
389
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
390
- return axios.request(axiosRequestArgs);
391
- };
392
- },
393
- /**
394
- *
395
- * @summary Edit a variant
396
- * @param {UpdateProductVariantDto} body
397
- * @param {string} variantId
398
- * @param {*} [options] Override http request option.
399
- * @throws {RequiredError}
400
- */
401
- async editVariant(body: UpdateProductVariantDto, variantId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ProductVariant>>> {
402
- const localVarAxiosArgs = await ProductVariantsApiAxiosParamCreator(configuration).editVariant(body, variantId, options);
403
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
404
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
405
- return axios.request(axiosRequestArgs);
406
- };
407
- },
408
- /**
409
- *
410
- * @summary Get all variants of a product
411
- * @param {string} productId Product ID
412
- * @param {*} [options] Override http request option.
413
- * @throws {RequiredError}
414
- */
415
- async getAllVariants(productId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<ProductVariant>>>> {
416
- const localVarAxiosArgs = await ProductVariantsApiAxiosParamCreator(configuration).getAllVariants(productId, options);
417
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
418
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
419
- return axios.request(axiosRequestArgs);
420
- };
421
- },
422
- }
423
- };
424
-
425
- /**
426
- * ProductVariantsApi - factory interface
427
- * @export
428
- */
429
- export const ProductVariantsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
430
- return {
431
- /**
432
- *
433
- * @summary Create bulk variants for a product
434
- * @param {Array<CreateVariantDto>} body
435
- * @param {string} productId Product ID
436
- * @param {*} [options] Override http request option.
437
- * @throws {RequiredError}
438
- */
439
- async createBulkVariants(body: Array<CreateVariantDto>, productId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<ProductVariant>>> {
440
- return ProductVariantsApiFp(configuration).createBulkVariants(body, productId, options).then((request) => request(axios, basePath));
441
- },
442
- /**
443
- *
444
- * @summary Create a variant for a product
445
- * @param {CreateVariantDto} body
446
- * @param {string} productId Product ID
447
- * @param {*} [options] Override http request option.
448
- * @throws {RequiredError}
449
- */
450
- async createVariant(body: CreateVariantDto, productId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ProductVariant>> {
451
- return ProductVariantsApiFp(configuration).createVariant(body, productId, options).then((request) => request(axios, basePath));
452
- },
453
- /**
454
- *
455
- * @summary Delete a variant
456
- * @param {string} variantId
457
- * @param {*} [options] Override http request option.
458
- * @throws {RequiredError}
459
- */
460
- async deleteVariant(variantId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
461
- return ProductVariantsApiFp(configuration).deleteVariant(variantId, options).then((request) => request(axios, basePath));
462
- },
463
- /**
464
- *
465
- * @summary Edit a variant
466
- * @param {UpdateProductVariantDto} body
467
- * @param {string} variantId
468
- * @param {*} [options] Override http request option.
469
- * @throws {RequiredError}
470
- */
471
- async editVariant(body: UpdateProductVariantDto, variantId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ProductVariant>> {
472
- return ProductVariantsApiFp(configuration).editVariant(body, variantId, options).then((request) => request(axios, basePath));
473
- },
474
- /**
475
- *
476
- * @summary Get all variants of a product
477
- * @param {string} productId Product ID
478
- * @param {*} [options] Override http request option.
479
- * @throws {RequiredError}
480
- */
481
- async getAllVariants(productId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<ProductVariant>>> {
482
- return ProductVariantsApiFp(configuration).getAllVariants(productId, options).then((request) => request(axios, basePath));
483
- },
484
- };
485
- };
486
-
487
- /**
488
- * ProductVariantsApi - object-oriented interface
489
- * @export
490
- * @class ProductVariantsApi
491
- * @extends {BaseAPI}
492
- */
493
- export class ProductVariantsApi extends BaseAPI {
494
- /**
495
- *
496
- * @summary Create bulk variants for a product
497
- * @param {Array<CreateVariantDto>} body
498
- * @param {string} productId Product ID
499
- * @param {*} [options] Override http request option.
500
- * @throws {RequiredError}
501
- * @memberof ProductVariantsApi
502
- */
503
- public async createBulkVariants(body: Array<CreateVariantDto>, productId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<ProductVariant>>> {
504
- return ProductVariantsApiFp(this.configuration).createBulkVariants(body, productId, options).then((request) => request(this.axios, this.basePath));
505
- }
506
- /**
507
- *
508
- * @summary Create a variant for a product
509
- * @param {CreateVariantDto} body
510
- * @param {string} productId Product ID
511
- * @param {*} [options] Override http request option.
512
- * @throws {RequiredError}
513
- * @memberof ProductVariantsApi
514
- */
515
- public async createVariant(body: CreateVariantDto, productId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ProductVariant>> {
516
- return ProductVariantsApiFp(this.configuration).createVariant(body, productId, options).then((request) => request(this.axios, this.basePath));
517
- }
518
- /**
519
- *
520
- * @summary Delete a variant
521
- * @param {string} variantId
522
- * @param {*} [options] Override http request option.
523
- * @throws {RequiredError}
524
- * @memberof ProductVariantsApi
525
- */
526
- public async deleteVariant(variantId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
527
- return ProductVariantsApiFp(this.configuration).deleteVariant(variantId, options).then((request) => request(this.axios, this.basePath));
528
- }
529
- /**
530
- *
531
- * @summary Edit a variant
532
- * @param {UpdateProductVariantDto} body
533
- * @param {string} variantId
534
- * @param {*} [options] Override http request option.
535
- * @throws {RequiredError}
536
- * @memberof ProductVariantsApi
537
- */
538
- public async editVariant(body: UpdateProductVariantDto, variantId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ProductVariant>> {
539
- return ProductVariantsApiFp(this.configuration).editVariant(body, variantId, options).then((request) => request(this.axios, this.basePath));
540
- }
541
- /**
542
- *
543
- * @summary Get all variants of a product
544
- * @param {string} productId Product ID
545
- * @param {*} [options] Override http request option.
546
- * @throws {RequiredError}
547
- * @memberof ProductVariantsApi
548
- */
549
- public async getAllVariants(productId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<ProductVariant>>> {
550
- return ProductVariantsApiFp(this.configuration).getAllVariants(productId, options).then((request) => request(this.axios, this.basePath));
551
- }
552
- }