hey-pharmacist-ecommerce 1.0.4 → 1.0.6
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/README.md +107 -1
- package/dist/index.d.mts +3636 -316
- package/dist/index.d.ts +3636 -316
- package/dist/index.js +6802 -3865
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6756 -3817
- package/dist/index.mjs.map +1 -1
- package/package.json +17 -14
- package/src/components/AddressFormModal.tsx +171 -0
- package/src/components/CartItem.tsx +17 -12
- package/src/components/FilterChips.tsx +195 -0
- package/src/components/Header.tsx +121 -71
- package/src/components/OrderCard.tsx +18 -25
- package/src/components/ProductCard.tsx +209 -72
- package/src/components/ui/Button.tsx +13 -5
- package/src/components/ui/Card.tsx +46 -0
- package/src/hooks/useAddresses.ts +83 -0
- package/src/hooks/useOrders.ts +37 -19
- package/src/hooks/useProducts.ts +55 -63
- package/src/hooks/useWishlistProducts.ts +75 -0
- package/src/index.ts +3 -19
- package/src/lib/Apis/api.ts +1 -0
- package/src/lib/Apis/apis/cart-api.ts +3 -3
- package/src/lib/Apis/apis/inventory-api.ts +0 -108
- package/src/lib/Apis/apis/stores-api.ts +70 -0
- package/src/lib/Apis/apis/wishlist-api.ts +447 -0
- package/src/lib/Apis/models/cart-item-populated.ts +0 -1
- package/src/lib/Apis/models/create-single-variant-product-dto.ts +3 -10
- package/src/lib/Apis/models/create-variant-dto.ts +26 -33
- package/src/lib/Apis/models/extended-product-dto.ts +20 -24
- package/src/lib/Apis/models/index.ts +2 -1
- package/src/lib/Apis/models/order-time-line-dto.ts +49 -0
- package/src/lib/Apis/models/order.ts +3 -8
- package/src/lib/Apis/models/populated-order.ts +3 -8
- package/src/lib/Apis/models/product-variant.ts +29 -0
- package/src/lib/Apis/models/update-product-variant-dto.ts +16 -23
- package/src/lib/Apis/models/wishlist.ts +51 -0
- package/src/lib/Apis/wrapper.ts +18 -7
- package/src/lib/api-adapter/index.ts +0 -12
- package/src/lib/types/index.ts +16 -61
- package/src/lib/utils/colors.ts +7 -4
- package/src/lib/utils/format.ts +1 -1
- package/src/lib/validations/address.ts +14 -0
- package/src/providers/AuthProvider.tsx +61 -31
- package/src/providers/CartProvider.tsx +18 -28
- package/src/providers/EcommerceProvider.tsx +7 -0
- package/src/providers/FavoritesProvider.tsx +86 -0
- package/src/providers/ThemeProvider.tsx +16 -1
- package/src/providers/WishlistProvider.tsx +174 -0
- package/src/screens/AddressesScreen.tsx +484 -0
- package/src/screens/CartScreen.tsx +120 -84
- package/src/screens/CategoriesScreen.tsx +120 -0
- package/src/screens/CheckoutScreen.tsx +919 -241
- package/src/screens/CurrentOrdersScreen.tsx +125 -61
- package/src/screens/HomeScreen.tsx +209 -0
- package/src/screens/LoginScreen.tsx +133 -88
- package/src/screens/NewAddressScreen.tsx +187 -0
- package/src/screens/OrdersScreen.tsx +162 -50
- package/src/screens/ProductDetailScreen.tsx +641 -190
- package/src/screens/ProfileScreen.tsx +192 -116
- package/src/screens/RegisterScreen.tsx +193 -144
- package/src/screens/SearchResultsScreen.tsx +165 -0
- package/src/screens/ShopScreen.tsx +1110 -146
- package/src/screens/WishlistScreen.tsx +428 -0
- package/src/lib/Apis/models/inventory-paginated-response.ts +0 -75
- package/src/lib/api/auth.ts +0 -81
- package/src/lib/api/cart.ts +0 -42
- package/src/lib/api/orders.ts +0 -53
- package/src/lib/api/products.ts +0 -51
- package/src/lib/api-adapter/auth-adapter.ts +0 -196
- package/src/lib/api-adapter/cart-adapter.ts +0 -193
- package/src/lib/api-adapter/mappers.ts +0 -147
- package/src/lib/api-adapter/orders-adapter.ts +0 -195
- package/src/lib/api-adapter/products-adapter.ts +0 -194
|
@@ -0,0 +1,447 @@
|
|
|
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 { Wishlist } from '../models';
|
|
20
|
+
/**
|
|
21
|
+
* WishlistApi - axios parameter creator
|
|
22
|
+
* @export
|
|
23
|
+
*/
|
|
24
|
+
export const WishlistApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
25
|
+
return {
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @summary Add product to wishlist
|
|
29
|
+
* @param {string} productId
|
|
30
|
+
* @param {*} [options] Override http request option.
|
|
31
|
+
* @throws {RequiredError}
|
|
32
|
+
*/
|
|
33
|
+
addToWishlist: async (productId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
34
|
+
// verify required parameter 'productId' is not null or undefined
|
|
35
|
+
if (productId === null || productId === undefined) {
|
|
36
|
+
throw new RequiredError('productId','Required parameter productId was null or undefined when calling addToWishlist.');
|
|
37
|
+
}
|
|
38
|
+
const localVarPath = `/wishlist/add/{productId}`
|
|
39
|
+
.replace(`{${"productId"}}`, encodeURIComponent(String(productId)));
|
|
40
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
41
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
42
|
+
let baseOptions;
|
|
43
|
+
if (configuration) {
|
|
44
|
+
baseOptions = configuration.baseOptions;
|
|
45
|
+
}
|
|
46
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
|
47
|
+
const localVarHeaderParameter = {} as any;
|
|
48
|
+
const localVarQueryParameter = {} as any;
|
|
49
|
+
|
|
50
|
+
// authentication bearer required
|
|
51
|
+
// http bearer authentication required
|
|
52
|
+
if (configuration && configuration.accessToken) {
|
|
53
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
54
|
+
? await configuration.accessToken()
|
|
55
|
+
: await configuration.accessToken;
|
|
56
|
+
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
60
|
+
for (const key in localVarQueryParameter) {
|
|
61
|
+
query.set(key, localVarQueryParameter[key]);
|
|
62
|
+
}
|
|
63
|
+
for (const key in options.params) {
|
|
64
|
+
query.set(key, options.params[key]);
|
|
65
|
+
}
|
|
66
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
67
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
68
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
72
|
+
options: localVarRequestOptions,
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
/**
|
|
76
|
+
*
|
|
77
|
+
* @summary Clear wishlist
|
|
78
|
+
* @param {*} [options] Override http request option.
|
|
79
|
+
* @throws {RequiredError}
|
|
80
|
+
*/
|
|
81
|
+
clearWishlist: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
82
|
+
const localVarPath = `/wishlist/clear`;
|
|
83
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
84
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
85
|
+
let baseOptions;
|
|
86
|
+
if (configuration) {
|
|
87
|
+
baseOptions = configuration.baseOptions;
|
|
88
|
+
}
|
|
89
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options};
|
|
90
|
+
const localVarHeaderParameter = {} as any;
|
|
91
|
+
const localVarQueryParameter = {} as any;
|
|
92
|
+
|
|
93
|
+
// authentication bearer required
|
|
94
|
+
// http bearer authentication required
|
|
95
|
+
if (configuration && configuration.accessToken) {
|
|
96
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
97
|
+
? await configuration.accessToken()
|
|
98
|
+
: await configuration.accessToken;
|
|
99
|
+
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
103
|
+
for (const key in localVarQueryParameter) {
|
|
104
|
+
query.set(key, localVarQueryParameter[key]);
|
|
105
|
+
}
|
|
106
|
+
for (const key in options.params) {
|
|
107
|
+
query.set(key, options.params[key]);
|
|
108
|
+
}
|
|
109
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
110
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
111
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
112
|
+
|
|
113
|
+
return {
|
|
114
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
115
|
+
options: localVarRequestOptions,
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
/**
|
|
119
|
+
*
|
|
120
|
+
* @summary Get user wishlist
|
|
121
|
+
* @param {*} [options] Override http request option.
|
|
122
|
+
* @throws {RequiredError}
|
|
123
|
+
*/
|
|
124
|
+
getWishlist: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
125
|
+
const localVarPath = `/wishlist`;
|
|
126
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
127
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
128
|
+
let baseOptions;
|
|
129
|
+
if (configuration) {
|
|
130
|
+
baseOptions = configuration.baseOptions;
|
|
131
|
+
}
|
|
132
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
|
133
|
+
const localVarHeaderParameter = {} as any;
|
|
134
|
+
const localVarQueryParameter = {} as any;
|
|
135
|
+
|
|
136
|
+
// authentication bearer required
|
|
137
|
+
// http bearer authentication required
|
|
138
|
+
if (configuration && configuration.accessToken) {
|
|
139
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
140
|
+
? await configuration.accessToken()
|
|
141
|
+
: await configuration.accessToken;
|
|
142
|
+
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
146
|
+
for (const key in localVarQueryParameter) {
|
|
147
|
+
query.set(key, localVarQueryParameter[key]);
|
|
148
|
+
}
|
|
149
|
+
for (const key in options.params) {
|
|
150
|
+
query.set(key, options.params[key]);
|
|
151
|
+
}
|
|
152
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
153
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
154
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
155
|
+
|
|
156
|
+
return {
|
|
157
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
158
|
+
options: localVarRequestOptions,
|
|
159
|
+
};
|
|
160
|
+
},
|
|
161
|
+
/**
|
|
162
|
+
*
|
|
163
|
+
* @summary Get wishlist item count
|
|
164
|
+
* @param {*} [options] Override http request option.
|
|
165
|
+
* @throws {RequiredError}
|
|
166
|
+
*/
|
|
167
|
+
getWishlistItemCount: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
168
|
+
const localVarPath = `/wishlist/count`;
|
|
169
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
170
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
171
|
+
let baseOptions;
|
|
172
|
+
if (configuration) {
|
|
173
|
+
baseOptions = configuration.baseOptions;
|
|
174
|
+
}
|
|
175
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
|
176
|
+
const localVarHeaderParameter = {} as any;
|
|
177
|
+
const localVarQueryParameter = {} as any;
|
|
178
|
+
|
|
179
|
+
// authentication bearer required
|
|
180
|
+
// http bearer authentication required
|
|
181
|
+
if (configuration && configuration.accessToken) {
|
|
182
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
183
|
+
? await configuration.accessToken()
|
|
184
|
+
: await configuration.accessToken;
|
|
185
|
+
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
189
|
+
for (const key in localVarQueryParameter) {
|
|
190
|
+
query.set(key, localVarQueryParameter[key]);
|
|
191
|
+
}
|
|
192
|
+
for (const key in options.params) {
|
|
193
|
+
query.set(key, options.params[key]);
|
|
194
|
+
}
|
|
195
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
196
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
197
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
198
|
+
|
|
199
|
+
return {
|
|
200
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
201
|
+
options: localVarRequestOptions,
|
|
202
|
+
};
|
|
203
|
+
},
|
|
204
|
+
/**
|
|
205
|
+
*
|
|
206
|
+
* @summary Remove product from wishlist
|
|
207
|
+
* @param {string} productId
|
|
208
|
+
* @param {*} [options] Override http request option.
|
|
209
|
+
* @throws {RequiredError}
|
|
210
|
+
*/
|
|
211
|
+
removeFromWishlist: async (productId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
212
|
+
// verify required parameter 'productId' is not null or undefined
|
|
213
|
+
if (productId === null || productId === undefined) {
|
|
214
|
+
throw new RequiredError('productId','Required parameter productId was null or undefined when calling removeFromWishlist.');
|
|
215
|
+
}
|
|
216
|
+
const localVarPath = `/wishlist/remove/{productId}`
|
|
217
|
+
.replace(`{${"productId"}}`, encodeURIComponent(String(productId)));
|
|
218
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
219
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
220
|
+
let baseOptions;
|
|
221
|
+
if (configuration) {
|
|
222
|
+
baseOptions = configuration.baseOptions;
|
|
223
|
+
}
|
|
224
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options};
|
|
225
|
+
const localVarHeaderParameter = {} as any;
|
|
226
|
+
const localVarQueryParameter = {} as any;
|
|
227
|
+
|
|
228
|
+
// authentication bearer required
|
|
229
|
+
// http bearer authentication required
|
|
230
|
+
if (configuration && configuration.accessToken) {
|
|
231
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
232
|
+
? await configuration.accessToken()
|
|
233
|
+
: await configuration.accessToken;
|
|
234
|
+
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
238
|
+
for (const key in localVarQueryParameter) {
|
|
239
|
+
query.set(key, localVarQueryParameter[key]);
|
|
240
|
+
}
|
|
241
|
+
for (const key in options.params) {
|
|
242
|
+
query.set(key, options.params[key]);
|
|
243
|
+
}
|
|
244
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
245
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
246
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
247
|
+
|
|
248
|
+
return {
|
|
249
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
250
|
+
options: localVarRequestOptions,
|
|
251
|
+
};
|
|
252
|
+
},
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* WishlistApi - functional programming interface
|
|
258
|
+
* @export
|
|
259
|
+
*/
|
|
260
|
+
export const WishlistApiFp = function(configuration?: Configuration) {
|
|
261
|
+
return {
|
|
262
|
+
/**
|
|
263
|
+
*
|
|
264
|
+
* @summary Add product to wishlist
|
|
265
|
+
* @param {string} productId
|
|
266
|
+
* @param {*} [options] Override http request option.
|
|
267
|
+
* @throws {RequiredError}
|
|
268
|
+
*/
|
|
269
|
+
async addToWishlist(productId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Wishlist>>> {
|
|
270
|
+
const localVarAxiosArgs = await WishlistApiAxiosParamCreator(configuration).addToWishlist(productId, options);
|
|
271
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
272
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
273
|
+
return axios.request(axiosRequestArgs);
|
|
274
|
+
};
|
|
275
|
+
},
|
|
276
|
+
/**
|
|
277
|
+
*
|
|
278
|
+
* @summary Clear wishlist
|
|
279
|
+
* @param {*} [options] Override http request option.
|
|
280
|
+
* @throws {RequiredError}
|
|
281
|
+
*/
|
|
282
|
+
async clearWishlist(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Wishlist>>> {
|
|
283
|
+
const localVarAxiosArgs = await WishlistApiAxiosParamCreator(configuration).clearWishlist(options);
|
|
284
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
285
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
286
|
+
return axios.request(axiosRequestArgs);
|
|
287
|
+
};
|
|
288
|
+
},
|
|
289
|
+
/**
|
|
290
|
+
*
|
|
291
|
+
* @summary Get user wishlist
|
|
292
|
+
* @param {*} [options] Override http request option.
|
|
293
|
+
* @throws {RequiredError}
|
|
294
|
+
*/
|
|
295
|
+
async getWishlist(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Wishlist>>> {
|
|
296
|
+
const localVarAxiosArgs = await WishlistApiAxiosParamCreator(configuration).getWishlist(options);
|
|
297
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
298
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
299
|
+
return axios.request(axiosRequestArgs);
|
|
300
|
+
};
|
|
301
|
+
},
|
|
302
|
+
/**
|
|
303
|
+
*
|
|
304
|
+
* @summary Get wishlist item count
|
|
305
|
+
* @param {*} [options] Override http request option.
|
|
306
|
+
* @throws {RequiredError}
|
|
307
|
+
*/
|
|
308
|
+
async getWishlistItemCount(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<number>>> {
|
|
309
|
+
const localVarAxiosArgs = await WishlistApiAxiosParamCreator(configuration).getWishlistItemCount(options);
|
|
310
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
311
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
312
|
+
return axios.request(axiosRequestArgs);
|
|
313
|
+
};
|
|
314
|
+
},
|
|
315
|
+
/**
|
|
316
|
+
*
|
|
317
|
+
* @summary Remove product from wishlist
|
|
318
|
+
* @param {string} productId
|
|
319
|
+
* @param {*} [options] Override http request option.
|
|
320
|
+
* @throws {RequiredError}
|
|
321
|
+
*/
|
|
322
|
+
async removeFromWishlist(productId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Wishlist>>> {
|
|
323
|
+
const localVarAxiosArgs = await WishlistApiAxiosParamCreator(configuration).removeFromWishlist(productId, options);
|
|
324
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
325
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
326
|
+
return axios.request(axiosRequestArgs);
|
|
327
|
+
};
|
|
328
|
+
},
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* WishlistApi - factory interface
|
|
334
|
+
* @export
|
|
335
|
+
*/
|
|
336
|
+
export const WishlistApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
337
|
+
return {
|
|
338
|
+
/**
|
|
339
|
+
*
|
|
340
|
+
* @summary Add product to wishlist
|
|
341
|
+
* @param {string} productId
|
|
342
|
+
* @param {*} [options] Override http request option.
|
|
343
|
+
* @throws {RequiredError}
|
|
344
|
+
*/
|
|
345
|
+
async addToWishlist(productId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Wishlist>> {
|
|
346
|
+
return WishlistApiFp(configuration).addToWishlist(productId, options).then((request) => request(axios, basePath));
|
|
347
|
+
},
|
|
348
|
+
/**
|
|
349
|
+
*
|
|
350
|
+
* @summary Clear wishlist
|
|
351
|
+
* @param {*} [options] Override http request option.
|
|
352
|
+
* @throws {RequiredError}
|
|
353
|
+
*/
|
|
354
|
+
async clearWishlist(options?: AxiosRequestConfig): Promise<AxiosResponse<Wishlist>> {
|
|
355
|
+
return WishlistApiFp(configuration).clearWishlist(options).then((request) => request(axios, basePath));
|
|
356
|
+
},
|
|
357
|
+
/**
|
|
358
|
+
*
|
|
359
|
+
* @summary Get user wishlist
|
|
360
|
+
* @param {*} [options] Override http request option.
|
|
361
|
+
* @throws {RequiredError}
|
|
362
|
+
*/
|
|
363
|
+
async getWishlist(options?: AxiosRequestConfig): Promise<AxiosResponse<Wishlist>> {
|
|
364
|
+
return WishlistApiFp(configuration).getWishlist(options).then((request) => request(axios, basePath));
|
|
365
|
+
},
|
|
366
|
+
/**
|
|
367
|
+
*
|
|
368
|
+
* @summary Get wishlist item count
|
|
369
|
+
* @param {*} [options] Override http request option.
|
|
370
|
+
* @throws {RequiredError}
|
|
371
|
+
*/
|
|
372
|
+
async getWishlistItemCount(options?: AxiosRequestConfig): Promise<AxiosResponse<number>> {
|
|
373
|
+
return WishlistApiFp(configuration).getWishlistItemCount(options).then((request) => request(axios, basePath));
|
|
374
|
+
},
|
|
375
|
+
/**
|
|
376
|
+
*
|
|
377
|
+
* @summary Remove product from wishlist
|
|
378
|
+
* @param {string} productId
|
|
379
|
+
* @param {*} [options] Override http request option.
|
|
380
|
+
* @throws {RequiredError}
|
|
381
|
+
*/
|
|
382
|
+
async removeFromWishlist(productId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Wishlist>> {
|
|
383
|
+
return WishlistApiFp(configuration).removeFromWishlist(productId, options).then((request) => request(axios, basePath));
|
|
384
|
+
},
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* WishlistApi - object-oriented interface
|
|
390
|
+
* @export
|
|
391
|
+
* @class WishlistApi
|
|
392
|
+
* @extends {BaseAPI}
|
|
393
|
+
*/
|
|
394
|
+
export class WishlistApi extends BaseAPI {
|
|
395
|
+
/**
|
|
396
|
+
*
|
|
397
|
+
* @summary Add product to wishlist
|
|
398
|
+
* @param {string} productId
|
|
399
|
+
* @param {*} [options] Override http request option.
|
|
400
|
+
* @throws {RequiredError}
|
|
401
|
+
* @memberof WishlistApi
|
|
402
|
+
*/
|
|
403
|
+
public async addToWishlist(productId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Wishlist>> {
|
|
404
|
+
return WishlistApiFp(this.configuration).addToWishlist(productId, options).then((request) => request(this.axios, this.basePath));
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
*
|
|
408
|
+
* @summary Clear wishlist
|
|
409
|
+
* @param {*} [options] Override http request option.
|
|
410
|
+
* @throws {RequiredError}
|
|
411
|
+
* @memberof WishlistApi
|
|
412
|
+
*/
|
|
413
|
+
public async clearWishlist(options?: AxiosRequestConfig) : Promise<AxiosResponse<Wishlist>> {
|
|
414
|
+
return WishlistApiFp(this.configuration).clearWishlist(options).then((request) => request(this.axios, this.basePath));
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
*
|
|
418
|
+
* @summary Get user wishlist
|
|
419
|
+
* @param {*} [options] Override http request option.
|
|
420
|
+
* @throws {RequiredError}
|
|
421
|
+
* @memberof WishlistApi
|
|
422
|
+
*/
|
|
423
|
+
public async getWishlist(options?: AxiosRequestConfig) : Promise<AxiosResponse<Wishlist>> {
|
|
424
|
+
return WishlistApiFp(this.configuration).getWishlist(options).then((request) => request(this.axios, this.basePath));
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
*
|
|
428
|
+
* @summary Get wishlist item count
|
|
429
|
+
* @param {*} [options] Override http request option.
|
|
430
|
+
* @throws {RequiredError}
|
|
431
|
+
* @memberof WishlistApi
|
|
432
|
+
*/
|
|
433
|
+
public async getWishlistItemCount(options?: AxiosRequestConfig) : Promise<AxiosResponse<number>> {
|
|
434
|
+
return WishlistApiFp(this.configuration).getWishlistItemCount(options).then((request) => request(this.axios, this.basePath));
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
*
|
|
438
|
+
* @summary Remove product from wishlist
|
|
439
|
+
* @param {string} productId
|
|
440
|
+
* @param {*} [options] Override http request option.
|
|
441
|
+
* @throws {RequiredError}
|
|
442
|
+
* @memberof WishlistApi
|
|
443
|
+
*/
|
|
444
|
+
public async removeFromWishlist(productId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Wishlist>> {
|
|
445
|
+
return WishlistApiFp(this.configuration).removeFromWishlist(productId, options).then((request) => request(this.axios, this.basePath));
|
|
446
|
+
}
|
|
447
|
+
}
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
import { SingleProductMedia } from './single-product-media';
|
|
15
|
-
import { TableDto } from './table-dto';
|
|
16
15
|
/**
|
|
17
16
|
*
|
|
18
17
|
* @export
|
|
@@ -94,10 +93,10 @@ export interface CreateSingleVariantProductDTO {
|
|
|
94
93
|
frequentlyBoughtProducts: Array<string>;
|
|
95
94
|
/**
|
|
96
95
|
*
|
|
97
|
-
* @type {
|
|
96
|
+
* @type {number}
|
|
98
97
|
* @memberof CreateSingleVariantProductDTO
|
|
99
98
|
*/
|
|
100
|
-
|
|
99
|
+
inventory?: number;
|
|
101
100
|
/**
|
|
102
101
|
* The width of the product variant in cm
|
|
103
102
|
* @type {number}
|
|
@@ -140,16 +139,10 @@ export interface CreateSingleVariantProductDTO {
|
|
|
140
139
|
* @memberof CreateSingleVariantProductDTO
|
|
141
140
|
*/
|
|
142
141
|
totalSold?: number;
|
|
143
|
-
/**
|
|
144
|
-
*
|
|
145
|
-
* @type {Array<TableDto>}
|
|
146
|
-
* @memberof CreateSingleVariantProductDTO
|
|
147
|
-
*/
|
|
148
|
-
tables?: Array<TableDto>;
|
|
149
142
|
/**
|
|
150
143
|
*
|
|
151
144
|
* @type {number}
|
|
152
145
|
* @memberof CreateSingleVariantProductDTO
|
|
153
146
|
*/
|
|
154
|
-
|
|
147
|
+
inventoryCount?: number;
|
|
155
148
|
}
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
import { SingleProductMedia } from './single-product-media';
|
|
15
|
-
import { TableDto } from './table-dto';
|
|
16
15
|
/**
|
|
17
16
|
*
|
|
18
17
|
* @export
|
|
@@ -25,95 +24,89 @@ export interface CreateVariantDto {
|
|
|
25
24
|
* @type {string}
|
|
26
25
|
* @memberof CreateVariantDto
|
|
27
26
|
*/
|
|
28
|
-
|
|
27
|
+
name: string;
|
|
29
28
|
/**
|
|
30
29
|
*
|
|
31
|
-
* @type {
|
|
30
|
+
* @type {Array<SingleProductMedia>}
|
|
32
31
|
* @memberof CreateVariantDto
|
|
33
32
|
*/
|
|
34
|
-
|
|
33
|
+
productMedia: Array<SingleProductMedia>;
|
|
35
34
|
/**
|
|
36
35
|
*
|
|
37
36
|
* @type {string}
|
|
38
37
|
* @memberof CreateVariantDto
|
|
39
38
|
*/
|
|
40
|
-
description
|
|
39
|
+
description: string;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {{ [key: string]: string; }}
|
|
43
|
+
* @memberof CreateVariantDto
|
|
44
|
+
*/
|
|
45
|
+
attribute: { [key: string]: string; };
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @memberof CreateVariantDto
|
|
50
|
+
*/
|
|
51
|
+
inventory: number;
|
|
41
52
|
/**
|
|
42
53
|
* The width of the product variant in cm
|
|
43
54
|
* @type {number}
|
|
44
55
|
* @memberof CreateVariantDto
|
|
45
56
|
*/
|
|
46
|
-
width
|
|
57
|
+
width: number;
|
|
47
58
|
/**
|
|
48
59
|
* The height of the product variant in cm
|
|
49
60
|
* @type {number}
|
|
50
61
|
* @memberof CreateVariantDto
|
|
51
62
|
*/
|
|
52
|
-
height
|
|
63
|
+
height: number;
|
|
53
64
|
/**
|
|
54
65
|
* The length of the product variant in cm
|
|
55
66
|
* @type {number}
|
|
56
67
|
* @memberof CreateVariantDto
|
|
57
68
|
*/
|
|
58
|
-
length
|
|
69
|
+
length: number;
|
|
59
70
|
/**
|
|
60
71
|
* The weight of the product variant in g
|
|
61
72
|
* @type {number}
|
|
62
73
|
* @memberof CreateVariantDto
|
|
63
74
|
*/
|
|
64
|
-
weight
|
|
75
|
+
weight: number;
|
|
65
76
|
/**
|
|
66
77
|
*
|
|
67
78
|
* @type {string}
|
|
68
79
|
* @memberof CreateVariantDto
|
|
69
80
|
*/
|
|
70
|
-
brand
|
|
81
|
+
brand: string;
|
|
71
82
|
/**
|
|
72
83
|
*
|
|
73
84
|
* @type {string}
|
|
74
85
|
* @memberof CreateVariantDto
|
|
75
86
|
*/
|
|
76
|
-
sku
|
|
77
|
-
/**
|
|
78
|
-
*
|
|
79
|
-
* @type {{ [key: string]: string; }}
|
|
80
|
-
* @memberof CreateVariantDto
|
|
81
|
-
*/
|
|
82
|
-
attribute?: { [key: string]: string; };
|
|
87
|
+
sku: string;
|
|
83
88
|
/**
|
|
84
89
|
*
|
|
85
90
|
* @type {number}
|
|
86
91
|
* @memberof CreateVariantDto
|
|
87
92
|
*/
|
|
88
|
-
retailPrice
|
|
93
|
+
retailPrice: number;
|
|
89
94
|
/**
|
|
90
95
|
*
|
|
91
96
|
* @type {number}
|
|
92
97
|
* @memberof CreateVariantDto
|
|
93
98
|
*/
|
|
94
|
-
costPrice
|
|
99
|
+
costPrice: number;
|
|
95
100
|
/**
|
|
96
101
|
*
|
|
97
102
|
* @type {number}
|
|
98
103
|
* @memberof CreateVariantDto
|
|
99
104
|
*/
|
|
100
|
-
totalSold
|
|
101
|
-
/**
|
|
102
|
-
*
|
|
103
|
-
* @type {Array<TableDto>}
|
|
104
|
-
* @memberof CreateVariantDto
|
|
105
|
-
*/
|
|
106
|
-
tables?: Array<TableDto>;
|
|
107
|
-
/**
|
|
108
|
-
*
|
|
109
|
-
* @type {Array<SingleProductMedia>}
|
|
110
|
-
* @memberof CreateVariantDto
|
|
111
|
-
*/
|
|
112
|
-
productMedia: Array<SingleProductMedia>;
|
|
105
|
+
totalSold: number;
|
|
113
106
|
/**
|
|
114
107
|
*
|
|
115
108
|
* @type {number}
|
|
116
109
|
* @memberof CreateVariantDto
|
|
117
110
|
*/
|
|
118
|
-
|
|
111
|
+
inventoryCount: number;
|
|
119
112
|
}
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
import { FrequentlyBoughtProductDto } from './frequently-bought-product-dto';
|
|
15
|
+
import { ProductVariant } from './product-variant';
|
|
15
16
|
import { Review } from './review';
|
|
17
|
+
import { ShallowParentCategoryDto } from './shallow-parent-category-dto';
|
|
16
18
|
import { SingleProductMedia } from './single-product-media';
|
|
17
19
|
/**
|
|
18
20
|
*
|
|
@@ -39,24 +41,6 @@ export interface ExtendedProductDTO {
|
|
|
39
41
|
* @memberof ExtendedProductDTO
|
|
40
42
|
*/
|
|
41
43
|
id: string;
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
* @type {Array<string>}
|
|
45
|
-
* @memberof ExtendedProductDTO
|
|
46
|
-
*/
|
|
47
|
-
parentSubCategories: Array<string>;
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* @type {Array<string>}
|
|
51
|
-
* @memberof ExtendedProductDTO
|
|
52
|
-
*/
|
|
53
|
-
parentCategories: Array<string>;
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
* @type {Array<string>}
|
|
57
|
-
* @memberof ExtendedProductDTO
|
|
58
|
-
*/
|
|
59
|
-
productVariants: Array<string>;
|
|
60
44
|
/**
|
|
61
45
|
*
|
|
62
46
|
* @type {string}
|
|
@@ -165,12 +149,6 @@ export interface ExtendedProductDTO {
|
|
|
165
149
|
* @memberof ExtendedProductDTO
|
|
166
150
|
*/
|
|
167
151
|
inventoryCount: number;
|
|
168
|
-
/**
|
|
169
|
-
*
|
|
170
|
-
* @type {Array<string>}
|
|
171
|
-
* @memberof ExtendedProductDTO
|
|
172
|
-
*/
|
|
173
|
-
allInventory: Array<string>;
|
|
174
152
|
/**
|
|
175
153
|
*
|
|
176
154
|
* @type {number}
|
|
@@ -201,4 +179,22 @@ export interface ExtendedProductDTO {
|
|
|
201
179
|
* @memberof ExtendedProductDTO
|
|
202
180
|
*/
|
|
203
181
|
rating?: number;
|
|
182
|
+
/**
|
|
183
|
+
*
|
|
184
|
+
* @type {Array<ShallowParentCategoryDto>}
|
|
185
|
+
* @memberof ExtendedProductDTO
|
|
186
|
+
*/
|
|
187
|
+
parentCategories: Array<ShallowParentCategoryDto>;
|
|
188
|
+
/**
|
|
189
|
+
*
|
|
190
|
+
* @type {Array<ShallowParentCategoryDto>}
|
|
191
|
+
* @memberof ExtendedProductDTO
|
|
192
|
+
*/
|
|
193
|
+
parentSubCategories: Array<ShallowParentCategoryDto>;
|
|
194
|
+
/**
|
|
195
|
+
*
|
|
196
|
+
* @type {Array<ProductVariant>}
|
|
197
|
+
* @memberof ExtendedProductDTO
|
|
198
|
+
*/
|
|
199
|
+
productVariants: Array<ProductVariant>;
|
|
204
200
|
}
|