hey-pharmacist-ecommerce 1.1.19 → 1.1.22
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 +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +722 -487
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +724 -489
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/CartItem.tsx +29 -17
- package/src/lib/Apis/api.ts +0 -1
- package/src/lib/Apis/apis/products-api.ts +187 -0
- package/src/lib/Apis/apis/stores-api.ts +244 -0
- package/src/lib/Apis/models/create-product-dto.ts +6 -0
- package/src/lib/Apis/models/create-single-variant-product-dto.ts +6 -0
- package/src/lib/Apis/models/extended-product-dto.ts +6 -0
- package/src/lib/Apis/models/index.ts +2 -0
- package/src/lib/Apis/models/new-client-email-dto.ts +159 -0
- package/src/lib/Apis/models/product.ts +6 -0
- package/src/lib/Apis/models/schedule-tour-email-dto.ts +45 -0
- package/src/lib/Apis/models/update-product-dto.ts +6 -0
- package/src/lib/Apis/sharedConfig.ts +9 -0
- package/src/lib/Apis/wrapper.ts +11 -16
- package/src/lib/api-adapter/config.ts +12 -6
- package/src/providers/CartProvider.tsx +152 -82
- package/src/screens/CartScreen.tsx +1 -1
- package/src/screens/CheckoutScreen.tsx +21 -6
- package/src/screens/ProductDetailScreen.tsx +140 -132
- package/src/styles/globals.css +18 -5
- package/src/lib/Apis/apis/inventory-api.ts +0 -267
|
@@ -1,267 +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
|
-
/**
|
|
20
|
-
* InventoryApi - axios parameter creator
|
|
21
|
-
* @export
|
|
22
|
-
*/
|
|
23
|
-
export const InventoryApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
24
|
-
return {
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @summary Create Product inventory
|
|
28
|
-
* @param {string} variantId
|
|
29
|
-
* @param {number} count
|
|
30
|
-
* @param {*} [options] Override http request option.
|
|
31
|
-
* @throws {RequiredError}
|
|
32
|
-
*/
|
|
33
|
-
createInventory: async (variantId: string, count: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
34
|
-
// verify required parameter 'variantId' is not null or undefined
|
|
35
|
-
if (variantId === null || variantId === undefined) {
|
|
36
|
-
throw new RequiredError('variantId','Required parameter variantId was null or undefined when calling createInventory.');
|
|
37
|
-
}
|
|
38
|
-
// verify required parameter 'count' is not null or undefined
|
|
39
|
-
if (count === null || count === undefined) {
|
|
40
|
-
throw new RequiredError('count','Required parameter count was null or undefined when calling createInventory.');
|
|
41
|
-
}
|
|
42
|
-
const localVarPath = `/inventory/create`;
|
|
43
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
44
|
-
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
45
|
-
let baseOptions;
|
|
46
|
-
if (configuration) {
|
|
47
|
-
baseOptions = configuration.baseOptions;
|
|
48
|
-
}
|
|
49
|
-
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
|
50
|
-
const localVarHeaderParameter = {} as any;
|
|
51
|
-
const localVarQueryParameter = {} as any;
|
|
52
|
-
|
|
53
|
-
// authentication bearer required
|
|
54
|
-
// http bearer authentication required
|
|
55
|
-
if (configuration && configuration.accessToken) {
|
|
56
|
-
const accessToken = typeof configuration.accessToken === 'function'
|
|
57
|
-
? await configuration.accessToken()
|
|
58
|
-
: await configuration.accessToken;
|
|
59
|
-
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// authentication x-store-key required
|
|
63
|
-
if (configuration && configuration.apiKey) {
|
|
64
|
-
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
65
|
-
? await configuration.apiKey("x-store-key")
|
|
66
|
-
: await configuration.apiKey;
|
|
67
|
-
localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (variantId !== undefined) {
|
|
71
|
-
localVarQueryParameter['variantId'] = variantId;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (count !== undefined) {
|
|
75
|
-
localVarQueryParameter['count'] = count;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const query = new URLSearchParams(localVarUrlObj.search);
|
|
79
|
-
for (const key in localVarQueryParameter) {
|
|
80
|
-
query.set(key, localVarQueryParameter[key]);
|
|
81
|
-
}
|
|
82
|
-
for (const key in options.params) {
|
|
83
|
-
query.set(key, options.params[key]);
|
|
84
|
-
}
|
|
85
|
-
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
86
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
87
|
-
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
88
|
-
|
|
89
|
-
return {
|
|
90
|
-
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
91
|
-
options: localVarRequestOptions,
|
|
92
|
-
};
|
|
93
|
-
},
|
|
94
|
-
/**
|
|
95
|
-
*
|
|
96
|
-
* @summary Update Product inventory
|
|
97
|
-
* @param {string} inventoryId
|
|
98
|
-
* @param {number} count
|
|
99
|
-
* @param {*} [options] Override http request option.
|
|
100
|
-
* @throws {RequiredError}
|
|
101
|
-
*/
|
|
102
|
-
updateInventory: async (inventoryId: string, count: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
103
|
-
// verify required parameter 'inventoryId' is not null or undefined
|
|
104
|
-
if (inventoryId === null || inventoryId === undefined) {
|
|
105
|
-
throw new RequiredError('inventoryId','Required parameter inventoryId was null or undefined when calling updateInventory.');
|
|
106
|
-
}
|
|
107
|
-
// verify required parameter 'count' is not null or undefined
|
|
108
|
-
if (count === null || count === undefined) {
|
|
109
|
-
throw new RequiredError('count','Required parameter count was null or undefined when calling updateInventory.');
|
|
110
|
-
}
|
|
111
|
-
const localVarPath = `/inventory/update`;
|
|
112
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
113
|
-
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
114
|
-
let baseOptions;
|
|
115
|
-
if (configuration) {
|
|
116
|
-
baseOptions = configuration.baseOptions;
|
|
117
|
-
}
|
|
118
|
-
const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
|
|
119
|
-
const localVarHeaderParameter = {} as any;
|
|
120
|
-
const localVarQueryParameter = {} as any;
|
|
121
|
-
|
|
122
|
-
// authentication bearer required
|
|
123
|
-
// http bearer authentication required
|
|
124
|
-
if (configuration && configuration.accessToken) {
|
|
125
|
-
const accessToken = typeof configuration.accessToken === 'function'
|
|
126
|
-
? await configuration.accessToken()
|
|
127
|
-
: await configuration.accessToken;
|
|
128
|
-
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// authentication x-store-key required
|
|
132
|
-
if (configuration && configuration.apiKey) {
|
|
133
|
-
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
134
|
-
? await configuration.apiKey("x-store-key")
|
|
135
|
-
: await configuration.apiKey;
|
|
136
|
-
localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (inventoryId !== undefined) {
|
|
140
|
-
localVarQueryParameter['inventoryId'] = inventoryId;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (count !== undefined) {
|
|
144
|
-
localVarQueryParameter['count'] = count;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const query = new URLSearchParams(localVarUrlObj.search);
|
|
148
|
-
for (const key in localVarQueryParameter) {
|
|
149
|
-
query.set(key, localVarQueryParameter[key]);
|
|
150
|
-
}
|
|
151
|
-
for (const key in options.params) {
|
|
152
|
-
query.set(key, options.params[key]);
|
|
153
|
-
}
|
|
154
|
-
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
155
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
156
|
-
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
157
|
-
|
|
158
|
-
return {
|
|
159
|
-
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
160
|
-
options: localVarRequestOptions,
|
|
161
|
-
};
|
|
162
|
-
},
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* InventoryApi - functional programming interface
|
|
168
|
-
* @export
|
|
169
|
-
*/
|
|
170
|
-
export const InventoryApiFp = function(configuration?: Configuration) {
|
|
171
|
-
return {
|
|
172
|
-
/**
|
|
173
|
-
*
|
|
174
|
-
* @summary Create Product inventory
|
|
175
|
-
* @param {string} variantId
|
|
176
|
-
* @param {number} count
|
|
177
|
-
* @param {*} [options] Override http request option.
|
|
178
|
-
* @throws {RequiredError}
|
|
179
|
-
*/
|
|
180
|
-
async createInventory(variantId: string, count: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
181
|
-
const localVarAxiosArgs = await InventoryApiAxiosParamCreator(configuration).createInventory(variantId, count, options);
|
|
182
|
-
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
183
|
-
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
184
|
-
return axios.request(axiosRequestArgs);
|
|
185
|
-
};
|
|
186
|
-
},
|
|
187
|
-
/**
|
|
188
|
-
*
|
|
189
|
-
* @summary Update Product inventory
|
|
190
|
-
* @param {string} inventoryId
|
|
191
|
-
* @param {number} count
|
|
192
|
-
* @param {*} [options] Override http request option.
|
|
193
|
-
* @throws {RequiredError}
|
|
194
|
-
*/
|
|
195
|
-
async updateInventory(inventoryId: string, count: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
196
|
-
const localVarAxiosArgs = await InventoryApiAxiosParamCreator(configuration).updateInventory(inventoryId, count, options);
|
|
197
|
-
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
198
|
-
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
199
|
-
return axios.request(axiosRequestArgs);
|
|
200
|
-
};
|
|
201
|
-
},
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* InventoryApi - factory interface
|
|
207
|
-
* @export
|
|
208
|
-
*/
|
|
209
|
-
export const InventoryApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
210
|
-
return {
|
|
211
|
-
/**
|
|
212
|
-
*
|
|
213
|
-
* @summary Create Product inventory
|
|
214
|
-
* @param {string} variantId
|
|
215
|
-
* @param {number} count
|
|
216
|
-
* @param {*} [options] Override http request option.
|
|
217
|
-
* @throws {RequiredError}
|
|
218
|
-
*/
|
|
219
|
-
async createInventory(variantId: string, count: number, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
220
|
-
return InventoryApiFp(configuration).createInventory(variantId, count, options).then((request) => request(axios, basePath));
|
|
221
|
-
},
|
|
222
|
-
/**
|
|
223
|
-
*
|
|
224
|
-
* @summary Update Product inventory
|
|
225
|
-
* @param {string} inventoryId
|
|
226
|
-
* @param {number} count
|
|
227
|
-
* @param {*} [options] Override http request option.
|
|
228
|
-
* @throws {RequiredError}
|
|
229
|
-
*/
|
|
230
|
-
async updateInventory(inventoryId: string, count: number, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
231
|
-
return InventoryApiFp(configuration).updateInventory(inventoryId, count, options).then((request) => request(axios, basePath));
|
|
232
|
-
},
|
|
233
|
-
};
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* InventoryApi - object-oriented interface
|
|
238
|
-
* @export
|
|
239
|
-
* @class InventoryApi
|
|
240
|
-
* @extends {BaseAPI}
|
|
241
|
-
*/
|
|
242
|
-
export class InventoryApi extends BaseAPI {
|
|
243
|
-
/**
|
|
244
|
-
*
|
|
245
|
-
* @summary Create Product inventory
|
|
246
|
-
* @param {string} variantId
|
|
247
|
-
* @param {number} count
|
|
248
|
-
* @param {*} [options] Override http request option.
|
|
249
|
-
* @throws {RequiredError}
|
|
250
|
-
* @memberof InventoryApi
|
|
251
|
-
*/
|
|
252
|
-
public async createInventory(variantId: string, count: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
253
|
-
return InventoryApiFp(this.configuration).createInventory(variantId, count, options).then((request) => request(this.axios, this.basePath));
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
*
|
|
257
|
-
* @summary Update Product inventory
|
|
258
|
-
* @param {string} inventoryId
|
|
259
|
-
* @param {number} count
|
|
260
|
-
* @param {*} [options] Override http request option.
|
|
261
|
-
* @throws {RequiredError}
|
|
262
|
-
* @memberof InventoryApi
|
|
263
|
-
*/
|
|
264
|
-
public async updateInventory(inventoryId: string, count: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
265
|
-
return InventoryApiFp(this.configuration).updateInventory(inventoryId, count, options).then((request) => request(this.axios, this.basePath));
|
|
266
|
-
}
|
|
267
|
-
}
|