hey-pharmacist-ecommerce 1.1.28 → 1.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +10552 -1370
- package/dist/index.d.ts +10552 -1370
- package/dist/index.js +4696 -1281
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4640 -1283
- 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/useStoreCapabilities.ts +87 -0
- package/src/hooks/useWishlistProducts.ts +4 -5
- package/src/index.ts +6 -0
- package/src/lib/Apis/api.ts +0 -1
- package/src/lib/Apis/apis/auth-api.ts +37 -36
- package/src/lib/Apis/apis/categories-api.ts +97 -0
- package/src/lib/Apis/apis/products-api.ts +942 -405
- package/src/lib/Apis/apis/shipping-api.ts +105 -0
- package/src/lib/Apis/apis/stores-api.ts +356 -0
- package/src/lib/Apis/apis/sub-categories-api.ts +97 -0
- package/src/lib/Apis/apis/users-api.ts +8 -8
- package/src/lib/Apis/models/address-created-request.ts +0 -12
- package/src/lib/Apis/models/address.ts +0 -12
- package/src/lib/Apis/models/api-key-info-dto.ts +49 -0
- 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-address-dto.ts +0 -12
- package/src/lib/Apis/models/create-discount-dto.ts +0 -8
- package/src/lib/Apis/models/create-product-dto.ts +30 -23
- package/src/lib/Apis/models/create-store-address-dto.ts +0 -12
- package/src/lib/Apis/models/create-store-dto-settings.ts +51 -0
- package/src/lib/Apis/models/create-store-dto.ts +7 -0
- package/src/lib/Apis/models/create-sub-category-dto.ts +6 -0
- package/src/lib/Apis/models/create-variant-dto.ts +26 -32
- package/src/lib/Apis/models/discount.ts +0 -8
- package/src/lib/Apis/models/index.ts +16 -7
- package/src/lib/Apis/models/paginated-products-dto.ts +6 -6
- package/src/lib/Apis/models/populated-discount.ts +0 -8
- package/src/lib/Apis/models/product-summary.ts +69 -0
- package/src/lib/Apis/models/product-variant.ts +31 -68
- 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/reorder-categories-dto.ts +27 -0
- package/src/lib/Apis/models/reorder-products-dto.ts +49 -0
- package/src/lib/Apis/models/{table-dto.ts → reorder-products-success-response-dto.ts} +8 -9
- package/src/lib/Apis/models/reorder-subcategories-dto.ts +33 -0
- package/src/lib/Apis/models/{shallow-parent-category-dto.ts → reorder-success-response-dto.ts} +7 -7
- package/src/lib/Apis/models/shipment-with-order.ts +18 -0
- package/src/lib/Apis/models/shipment.ts +18 -0
- package/src/lib/Apis/models/single-product-media.ts +0 -12
- package/src/lib/Apis/models/store-api-keys-response-dto.ts +34 -0
- package/src/lib/Apis/models/store-capabilities-dto.ts +63 -0
- package/src/lib/Apis/models/store-entity.ts +7 -0
- package/src/lib/Apis/models/store.ts +7 -0
- package/src/lib/Apis/models/sub-category.ts +6 -12
- package/src/lib/Apis/models/update-address-dto.ts +0 -12
- package/src/lib/Apis/models/update-api-keys-dto.ts +39 -0
- package/src/lib/Apis/models/update-discount-dto.ts +0 -8
- package/src/lib/Apis/models/update-manual-shipment-status-dto.ts +47 -0
- package/src/lib/Apis/models/update-product-dto.ts +30 -19
- package/src/lib/Apis/models/update-store-dto.ts +7 -0
- 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} +46 -46
- package/src/lib/Apis/models/variant-id-inventory-body.ts +27 -0
- 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 +402 -288
- 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 +208 -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
|
@@ -19,6 +19,7 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr
|
|
|
19
19
|
import { CartBodyDTO } from '../models';
|
|
20
20
|
import { Shipment } from '../models';
|
|
21
21
|
import { ShipmentWithOrder } from '../models';
|
|
22
|
+
import { UpdateManualShipmentStatusDto } from '../models';
|
|
22
23
|
/**
|
|
23
24
|
* ShippingApi - axios parameter creator
|
|
24
25
|
* @export
|
|
@@ -296,6 +297,72 @@ export const ShippingApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
296
297
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
297
298
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
298
299
|
|
|
300
|
+
return {
|
|
301
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
302
|
+
options: localVarRequestOptions,
|
|
303
|
+
};
|
|
304
|
+
},
|
|
305
|
+
/**
|
|
306
|
+
*
|
|
307
|
+
* @summary Update manual shipment status (for non-Shippo deliveries only)
|
|
308
|
+
* @param {UpdateManualShipmentStatusDto} body
|
|
309
|
+
* @param {string} shipmentId
|
|
310
|
+
* @param {*} [options] Override http request option.
|
|
311
|
+
* @throws {RequiredError}
|
|
312
|
+
*/
|
|
313
|
+
updateManualShipmentStatus: async (body: UpdateManualShipmentStatusDto, shipmentId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
314
|
+
// verify required parameter 'body' is not null or undefined
|
|
315
|
+
if (body === null || body === undefined) {
|
|
316
|
+
throw new RequiredError('body','Required parameter body was null or undefined when calling updateManualShipmentStatus.');
|
|
317
|
+
}
|
|
318
|
+
// verify required parameter 'shipmentId' is not null or undefined
|
|
319
|
+
if (shipmentId === null || shipmentId === undefined) {
|
|
320
|
+
throw new RequiredError('shipmentId','Required parameter shipmentId was null or undefined when calling updateManualShipmentStatus.');
|
|
321
|
+
}
|
|
322
|
+
const localVarPath = `/shipping/shipments/{shipmentId}/status`
|
|
323
|
+
.replace(`{${"shipmentId"}}`, encodeURIComponent(String(shipmentId)));
|
|
324
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
325
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
326
|
+
let baseOptions;
|
|
327
|
+
if (configuration) {
|
|
328
|
+
baseOptions = configuration.baseOptions;
|
|
329
|
+
}
|
|
330
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
|
|
331
|
+
const localVarHeaderParameter = {} as any;
|
|
332
|
+
const localVarQueryParameter = {} as any;
|
|
333
|
+
|
|
334
|
+
// authentication bearer required
|
|
335
|
+
// http bearer authentication required
|
|
336
|
+
if (configuration && configuration.accessToken) {
|
|
337
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
338
|
+
? await configuration.accessToken()
|
|
339
|
+
: await configuration.accessToken;
|
|
340
|
+
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// authentication x-store-key required
|
|
344
|
+
if (configuration && configuration.apiKey) {
|
|
345
|
+
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
346
|
+
? await configuration.apiKey("x-store-key")
|
|
347
|
+
: await configuration.apiKey;
|
|
348
|
+
localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
352
|
+
|
|
353
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
354
|
+
for (const key in localVarQueryParameter) {
|
|
355
|
+
query.set(key, localVarQueryParameter[key]);
|
|
356
|
+
}
|
|
357
|
+
for (const key in options.params) {
|
|
358
|
+
query.set(key, options.params[key]);
|
|
359
|
+
}
|
|
360
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
361
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
362
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
363
|
+
const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
|
|
364
|
+
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
365
|
+
|
|
299
366
|
return {
|
|
300
367
|
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
301
368
|
options: localVarRequestOptions,
|
|
@@ -378,6 +445,21 @@ export const ShippingApiFp = function(configuration?: Configuration) {
|
|
|
378
445
|
return axios.request(axiosRequestArgs);
|
|
379
446
|
};
|
|
380
447
|
},
|
|
448
|
+
/**
|
|
449
|
+
*
|
|
450
|
+
* @summary Update manual shipment status (for non-Shippo deliveries only)
|
|
451
|
+
* @param {UpdateManualShipmentStatusDto} body
|
|
452
|
+
* @param {string} shipmentId
|
|
453
|
+
* @param {*} [options] Override http request option.
|
|
454
|
+
* @throws {RequiredError}
|
|
455
|
+
*/
|
|
456
|
+
async updateManualShipmentStatus(body: UpdateManualShipmentStatusDto, shipmentId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Shipment>>> {
|
|
457
|
+
const localVarAxiosArgs = await ShippingApiAxiosParamCreator(configuration).updateManualShipmentStatus(body, shipmentId, options);
|
|
458
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
459
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
460
|
+
return axios.request(axiosRequestArgs);
|
|
461
|
+
};
|
|
462
|
+
},
|
|
381
463
|
}
|
|
382
464
|
};
|
|
383
465
|
|
|
@@ -435,6 +517,17 @@ export const ShippingApiFactory = function (configuration?: Configuration, baseP
|
|
|
435
517
|
async getStoreAddress(options?: AxiosRequestConfig): Promise<AxiosResponse<any>> {
|
|
436
518
|
return ShippingApiFp(configuration).getStoreAddress(options).then((request) => request(axios, basePath));
|
|
437
519
|
},
|
|
520
|
+
/**
|
|
521
|
+
*
|
|
522
|
+
* @summary Update manual shipment status (for non-Shippo deliveries only)
|
|
523
|
+
* @param {UpdateManualShipmentStatusDto} body
|
|
524
|
+
* @param {string} shipmentId
|
|
525
|
+
* @param {*} [options] Override http request option.
|
|
526
|
+
* @throws {RequiredError}
|
|
527
|
+
*/
|
|
528
|
+
async updateManualShipmentStatus(body: UpdateManualShipmentStatusDto, shipmentId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Shipment>> {
|
|
529
|
+
return ShippingApiFp(configuration).updateManualShipmentStatus(body, shipmentId, options).then((request) => request(axios, basePath));
|
|
530
|
+
},
|
|
438
531
|
};
|
|
439
532
|
};
|
|
440
533
|
|
|
@@ -498,4 +591,16 @@ export class ShippingApi extends BaseAPI {
|
|
|
498
591
|
public async getStoreAddress(options?: AxiosRequestConfig) : Promise<AxiosResponse<any>> {
|
|
499
592
|
return ShippingApiFp(this.configuration).getStoreAddress(options).then((request) => request(this.axios, this.basePath));
|
|
500
593
|
}
|
|
594
|
+
/**
|
|
595
|
+
*
|
|
596
|
+
* @summary Update manual shipment status (for non-Shippo deliveries only)
|
|
597
|
+
* @param {UpdateManualShipmentStatusDto} body
|
|
598
|
+
* @param {string} shipmentId
|
|
599
|
+
* @param {*} [options] Override http request option.
|
|
600
|
+
* @throws {RequiredError}
|
|
601
|
+
* @memberof ShippingApi
|
|
602
|
+
*/
|
|
603
|
+
public async updateManualShipmentStatus(body: UpdateManualShipmentStatusDto, shipmentId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Shipment>> {
|
|
604
|
+
return ShippingApiFp(this.configuration).updateManualShipmentStatus(body, shipmentId, options).then((request) => request(this.axios, this.basePath));
|
|
605
|
+
}
|
|
501
606
|
}
|
|
@@ -21,9 +21,12 @@ import { NewClientEmailDto } from '../models';
|
|
|
21
21
|
import { RefillRequest } from '../models';
|
|
22
22
|
import { RefillRequestDto } from '../models';
|
|
23
23
|
import { ScheduleTourEmailDto } from '../models';
|
|
24
|
+
import { StoreApiKeysResponseDto } from '../models';
|
|
25
|
+
import { StoreCapabilitiesDto } from '../models';
|
|
24
26
|
import { StoreEntity } from '../models';
|
|
25
27
|
import { TransferePatientRequest } from '../models';
|
|
26
28
|
import { TransferePatientsRequestDto } from '../models';
|
|
29
|
+
import { UpdateApiKeysDto } from '../models';
|
|
27
30
|
import { UpdateRefillRequestDto } from '../models';
|
|
28
31
|
import { UpdateStoreDto } from '../models';
|
|
29
32
|
import { UpdateTransferePatientsRequestDto } from '../models';
|
|
@@ -270,6 +273,54 @@ export const StoresApiAxiosParamCreator = function (configuration?: Configuratio
|
|
|
270
273
|
options: localVarRequestOptions,
|
|
271
274
|
};
|
|
272
275
|
},
|
|
276
|
+
/**
|
|
277
|
+
*
|
|
278
|
+
* @summary Get store API keys with masked values
|
|
279
|
+
* @param {string} storeId
|
|
280
|
+
* @param {*} [options] Override http request option.
|
|
281
|
+
* @throws {RequiredError}
|
|
282
|
+
*/
|
|
283
|
+
getApiKeys: async (storeId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
284
|
+
// verify required parameter 'storeId' is not null or undefined
|
|
285
|
+
if (storeId === null || storeId === undefined) {
|
|
286
|
+
throw new RequiredError('storeId','Required parameter storeId was null or undefined when calling getApiKeys.');
|
|
287
|
+
}
|
|
288
|
+
const localVarPath = `/stores/{storeId}/api-keys`
|
|
289
|
+
.replace(`{${"storeId"}}`, encodeURIComponent(String(storeId)));
|
|
290
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
291
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
292
|
+
let baseOptions;
|
|
293
|
+
if (configuration) {
|
|
294
|
+
baseOptions = configuration.baseOptions;
|
|
295
|
+
}
|
|
296
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
|
297
|
+
const localVarHeaderParameter = {} as any;
|
|
298
|
+
const localVarQueryParameter = {} as any;
|
|
299
|
+
|
|
300
|
+
// authentication x-store-key required
|
|
301
|
+
if (configuration && configuration.apiKey) {
|
|
302
|
+
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
303
|
+
? await configuration.apiKey("x-store-key")
|
|
304
|
+
: await configuration.apiKey;
|
|
305
|
+
localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
309
|
+
for (const key in localVarQueryParameter) {
|
|
310
|
+
query.set(key, localVarQueryParameter[key]);
|
|
311
|
+
}
|
|
312
|
+
for (const key in options.params) {
|
|
313
|
+
query.set(key, options.params[key]);
|
|
314
|
+
}
|
|
315
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
316
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
317
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
318
|
+
|
|
319
|
+
return {
|
|
320
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
321
|
+
options: localVarRequestOptions,
|
|
322
|
+
};
|
|
323
|
+
},
|
|
273
324
|
/**
|
|
274
325
|
*
|
|
275
326
|
* @summary Get refill requests by store id
|
|
@@ -366,6 +417,54 @@ export const StoresApiAxiosParamCreator = function (configuration?: Configuratio
|
|
|
366
417
|
options: localVarRequestOptions,
|
|
367
418
|
};
|
|
368
419
|
},
|
|
420
|
+
/**
|
|
421
|
+
*
|
|
422
|
+
* @summary Get store capabilities (payment/delivery options available)
|
|
423
|
+
* @param {string} storeId
|
|
424
|
+
* @param {*} [options] Override http request option.
|
|
425
|
+
* @throws {RequiredError}
|
|
426
|
+
*/
|
|
427
|
+
getStoreCapabilities: async (storeId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
428
|
+
// verify required parameter 'storeId' is not null or undefined
|
|
429
|
+
if (storeId === null || storeId === undefined) {
|
|
430
|
+
throw new RequiredError('storeId','Required parameter storeId was null or undefined when calling getStoreCapabilities.');
|
|
431
|
+
}
|
|
432
|
+
const localVarPath = `/stores/{storeId}/capabilities`
|
|
433
|
+
.replace(`{${"storeId"}}`, encodeURIComponent(String(storeId)));
|
|
434
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
435
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
436
|
+
let baseOptions;
|
|
437
|
+
if (configuration) {
|
|
438
|
+
baseOptions = configuration.baseOptions;
|
|
439
|
+
}
|
|
440
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
|
441
|
+
const localVarHeaderParameter = {} as any;
|
|
442
|
+
const localVarQueryParameter = {} as any;
|
|
443
|
+
|
|
444
|
+
// authentication x-store-key required
|
|
445
|
+
if (configuration && configuration.apiKey) {
|
|
446
|
+
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
447
|
+
? await configuration.apiKey("x-store-key")
|
|
448
|
+
: await configuration.apiKey;
|
|
449
|
+
localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
453
|
+
for (const key in localVarQueryParameter) {
|
|
454
|
+
query.set(key, localVarQueryParameter[key]);
|
|
455
|
+
}
|
|
456
|
+
for (const key in options.params) {
|
|
457
|
+
query.set(key, options.params[key]);
|
|
458
|
+
}
|
|
459
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
460
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
461
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
462
|
+
|
|
463
|
+
return {
|
|
464
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
465
|
+
options: localVarRequestOptions,
|
|
466
|
+
};
|
|
467
|
+
},
|
|
369
468
|
/**
|
|
370
469
|
*
|
|
371
470
|
* @summary Get transfere patients requests by store id
|
|
@@ -414,6 +513,60 @@ export const StoresApiAxiosParamCreator = function (configuration?: Configuratio
|
|
|
414
513
|
options: localVarRequestOptions,
|
|
415
514
|
};
|
|
416
515
|
},
|
|
516
|
+
/**
|
|
517
|
+
*
|
|
518
|
+
* @summary Revoke/delete a specific API key
|
|
519
|
+
* @param {string} storeId
|
|
520
|
+
* @param {string} keyType Type of key to revoke
|
|
521
|
+
* @param {*} [options] Override http request option.
|
|
522
|
+
* @throws {RequiredError}
|
|
523
|
+
*/
|
|
524
|
+
revokeApiKey: async (storeId: string, keyType: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
525
|
+
// verify required parameter 'storeId' is not null or undefined
|
|
526
|
+
if (storeId === null || storeId === undefined) {
|
|
527
|
+
throw new RequiredError('storeId','Required parameter storeId was null or undefined when calling revokeApiKey.');
|
|
528
|
+
}
|
|
529
|
+
// verify required parameter 'keyType' is not null or undefined
|
|
530
|
+
if (keyType === null || keyType === undefined) {
|
|
531
|
+
throw new RequiredError('keyType','Required parameter keyType was null or undefined when calling revokeApiKey.');
|
|
532
|
+
}
|
|
533
|
+
const localVarPath = `/stores/{storeId}/api-keys/{keyType}`
|
|
534
|
+
.replace(`{${"storeId"}}`, encodeURIComponent(String(storeId)))
|
|
535
|
+
.replace(`{${"keyType"}}`, encodeURIComponent(String(keyType)));
|
|
536
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
537
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
538
|
+
let baseOptions;
|
|
539
|
+
if (configuration) {
|
|
540
|
+
baseOptions = configuration.baseOptions;
|
|
541
|
+
}
|
|
542
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options};
|
|
543
|
+
const localVarHeaderParameter = {} as any;
|
|
544
|
+
const localVarQueryParameter = {} as any;
|
|
545
|
+
|
|
546
|
+
// authentication x-store-key required
|
|
547
|
+
if (configuration && configuration.apiKey) {
|
|
548
|
+
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
549
|
+
? await configuration.apiKey("x-store-key")
|
|
550
|
+
: await configuration.apiKey;
|
|
551
|
+
localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
555
|
+
for (const key in localVarQueryParameter) {
|
|
556
|
+
query.set(key, localVarQueryParameter[key]);
|
|
557
|
+
}
|
|
558
|
+
for (const key in options.params) {
|
|
559
|
+
query.set(key, options.params[key]);
|
|
560
|
+
}
|
|
561
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
562
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
563
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
564
|
+
|
|
565
|
+
return {
|
|
566
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
567
|
+
options: localVarRequestOptions,
|
|
568
|
+
};
|
|
569
|
+
},
|
|
417
570
|
/**
|
|
418
571
|
*
|
|
419
572
|
* @param {*} [options] Override http request option.
|
|
@@ -903,6 +1056,63 @@ export const StoresApiAxiosParamCreator = function (configuration?: Configuratio
|
|
|
903
1056
|
options: localVarRequestOptions,
|
|
904
1057
|
};
|
|
905
1058
|
},
|
|
1059
|
+
/**
|
|
1060
|
+
*
|
|
1061
|
+
* @summary Update store API keys (Stripe/Shippo)
|
|
1062
|
+
* @param {UpdateApiKeysDto} body
|
|
1063
|
+
* @param {string} storeId
|
|
1064
|
+
* @param {*} [options] Override http request option.
|
|
1065
|
+
* @throws {RequiredError}
|
|
1066
|
+
*/
|
|
1067
|
+
updateApiKeys: async (body: UpdateApiKeysDto, storeId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
1068
|
+
// verify required parameter 'body' is not null or undefined
|
|
1069
|
+
if (body === null || body === undefined) {
|
|
1070
|
+
throw new RequiredError('body','Required parameter body was null or undefined when calling updateApiKeys.');
|
|
1071
|
+
}
|
|
1072
|
+
// verify required parameter 'storeId' is not null or undefined
|
|
1073
|
+
if (storeId === null || storeId === undefined) {
|
|
1074
|
+
throw new RequiredError('storeId','Required parameter storeId was null or undefined when calling updateApiKeys.');
|
|
1075
|
+
}
|
|
1076
|
+
const localVarPath = `/stores/{storeId}/api-keys`
|
|
1077
|
+
.replace(`{${"storeId"}}`, encodeURIComponent(String(storeId)));
|
|
1078
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1079
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
1080
|
+
let baseOptions;
|
|
1081
|
+
if (configuration) {
|
|
1082
|
+
baseOptions = configuration.baseOptions;
|
|
1083
|
+
}
|
|
1084
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
|
|
1085
|
+
const localVarHeaderParameter = {} as any;
|
|
1086
|
+
const localVarQueryParameter = {} as any;
|
|
1087
|
+
|
|
1088
|
+
// authentication x-store-key required
|
|
1089
|
+
if (configuration && configuration.apiKey) {
|
|
1090
|
+
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
1091
|
+
? await configuration.apiKey("x-store-key")
|
|
1092
|
+
: await configuration.apiKey;
|
|
1093
|
+
localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1097
|
+
|
|
1098
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
1099
|
+
for (const key in localVarQueryParameter) {
|
|
1100
|
+
query.set(key, localVarQueryParameter[key]);
|
|
1101
|
+
}
|
|
1102
|
+
for (const key in options.params) {
|
|
1103
|
+
query.set(key, options.params[key]);
|
|
1104
|
+
}
|
|
1105
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
1106
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1107
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
1108
|
+
const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
|
|
1109
|
+
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
1110
|
+
|
|
1111
|
+
return {
|
|
1112
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
1113
|
+
options: localVarRequestOptions,
|
|
1114
|
+
};
|
|
1115
|
+
},
|
|
906
1116
|
/**
|
|
907
1117
|
*
|
|
908
1118
|
* @summary Update refill request by id
|
|
@@ -1152,6 +1362,20 @@ export const StoresApiFp = function(configuration?: Configuration) {
|
|
|
1152
1362
|
return axios.request(axiosRequestArgs);
|
|
1153
1363
|
};
|
|
1154
1364
|
},
|
|
1365
|
+
/**
|
|
1366
|
+
*
|
|
1367
|
+
* @summary Get store API keys with masked values
|
|
1368
|
+
* @param {string} storeId
|
|
1369
|
+
* @param {*} [options] Override http request option.
|
|
1370
|
+
* @throws {RequiredError}
|
|
1371
|
+
*/
|
|
1372
|
+
async getApiKeys(storeId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<StoreApiKeysResponseDto>>> {
|
|
1373
|
+
const localVarAxiosArgs = await StoresApiAxiosParamCreator(configuration).getApiKeys(storeId, options);
|
|
1374
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
1375
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
1376
|
+
return axios.request(axiosRequestArgs);
|
|
1377
|
+
};
|
|
1378
|
+
},
|
|
1155
1379
|
/**
|
|
1156
1380
|
*
|
|
1157
1381
|
* @summary Get refill requests by store id
|
|
@@ -1180,6 +1404,20 @@ export const StoresApiFp = function(configuration?: Configuration) {
|
|
|
1180
1404
|
return axios.request(axiosRequestArgs);
|
|
1181
1405
|
};
|
|
1182
1406
|
},
|
|
1407
|
+
/**
|
|
1408
|
+
*
|
|
1409
|
+
* @summary Get store capabilities (payment/delivery options available)
|
|
1410
|
+
* @param {string} storeId
|
|
1411
|
+
* @param {*} [options] Override http request option.
|
|
1412
|
+
* @throws {RequiredError}
|
|
1413
|
+
*/
|
|
1414
|
+
async getStoreCapabilities(storeId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<StoreCapabilitiesDto>>> {
|
|
1415
|
+
const localVarAxiosArgs = await StoresApiAxiosParamCreator(configuration).getStoreCapabilities(storeId, options);
|
|
1416
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
1417
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
1418
|
+
return axios.request(axiosRequestArgs);
|
|
1419
|
+
};
|
|
1420
|
+
},
|
|
1183
1421
|
/**
|
|
1184
1422
|
*
|
|
1185
1423
|
* @summary Get transfere patients requests by store id
|
|
@@ -1194,6 +1432,21 @@ export const StoresApiFp = function(configuration?: Configuration) {
|
|
|
1194
1432
|
return axios.request(axiosRequestArgs);
|
|
1195
1433
|
};
|
|
1196
1434
|
},
|
|
1435
|
+
/**
|
|
1436
|
+
*
|
|
1437
|
+
* @summary Revoke/delete a specific API key
|
|
1438
|
+
* @param {string} storeId
|
|
1439
|
+
* @param {string} keyType Type of key to revoke
|
|
1440
|
+
* @param {*} [options] Override http request option.
|
|
1441
|
+
* @throws {RequiredError}
|
|
1442
|
+
*/
|
|
1443
|
+
async revokeApiKey(storeId: string, keyType: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
1444
|
+
const localVarAxiosArgs = await StoresApiAxiosParamCreator(configuration).revokeApiKey(storeId, keyType, options);
|
|
1445
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
1446
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
1447
|
+
return axios.request(axiosRequestArgs);
|
|
1448
|
+
};
|
|
1449
|
+
},
|
|
1197
1450
|
/**
|
|
1198
1451
|
*
|
|
1199
1452
|
* @param {*} [options] Override http request option.
|
|
@@ -1332,6 +1585,21 @@ export const StoresApiFp = function(configuration?: Configuration) {
|
|
|
1332
1585
|
return axios.request(axiosRequestArgs);
|
|
1333
1586
|
};
|
|
1334
1587
|
},
|
|
1588
|
+
/**
|
|
1589
|
+
*
|
|
1590
|
+
* @summary Update store API keys (Stripe/Shippo)
|
|
1591
|
+
* @param {UpdateApiKeysDto} body
|
|
1592
|
+
* @param {string} storeId
|
|
1593
|
+
* @param {*} [options] Override http request option.
|
|
1594
|
+
* @throws {RequiredError}
|
|
1595
|
+
*/
|
|
1596
|
+
async updateApiKeys(body: UpdateApiKeysDto, storeId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<StoreApiKeysResponseDto>>> {
|
|
1597
|
+
const localVarAxiosArgs = await StoresApiAxiosParamCreator(configuration).updateApiKeys(body, storeId, options);
|
|
1598
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
1599
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
1600
|
+
return axios.request(axiosRequestArgs);
|
|
1601
|
+
};
|
|
1602
|
+
},
|
|
1335
1603
|
/**
|
|
1336
1604
|
*
|
|
1337
1605
|
* @summary Update refill request by id
|
|
@@ -1435,6 +1703,16 @@ export const StoresApiFactory = function (configuration?: Configuration, basePat
|
|
|
1435
1703
|
async getAllStores(options?: AxiosRequestConfig): Promise<AxiosResponse<Array<StoreEntity>>> {
|
|
1436
1704
|
return StoresApiFp(configuration).getAllStores(options).then((request) => request(axios, basePath));
|
|
1437
1705
|
},
|
|
1706
|
+
/**
|
|
1707
|
+
*
|
|
1708
|
+
* @summary Get store API keys with masked values
|
|
1709
|
+
* @param {string} storeId
|
|
1710
|
+
* @param {*} [options] Override http request option.
|
|
1711
|
+
* @throws {RequiredError}
|
|
1712
|
+
*/
|
|
1713
|
+
async getApiKeys(storeId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<StoreApiKeysResponseDto>> {
|
|
1714
|
+
return StoresApiFp(configuration).getApiKeys(storeId, options).then((request) => request(axios, basePath));
|
|
1715
|
+
},
|
|
1438
1716
|
/**
|
|
1439
1717
|
*
|
|
1440
1718
|
* @summary Get refill requests by store id
|
|
@@ -1455,6 +1733,16 @@ export const StoresApiFactory = function (configuration?: Configuration, basePat
|
|
|
1455
1733
|
async getStoreById(storeId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<StoreEntity>> {
|
|
1456
1734
|
return StoresApiFp(configuration).getStoreById(storeId, options).then((request) => request(axios, basePath));
|
|
1457
1735
|
},
|
|
1736
|
+
/**
|
|
1737
|
+
*
|
|
1738
|
+
* @summary Get store capabilities (payment/delivery options available)
|
|
1739
|
+
* @param {string} storeId
|
|
1740
|
+
* @param {*} [options] Override http request option.
|
|
1741
|
+
* @throws {RequiredError}
|
|
1742
|
+
*/
|
|
1743
|
+
async getStoreCapabilities(storeId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<StoreCapabilitiesDto>> {
|
|
1744
|
+
return StoresApiFp(configuration).getStoreCapabilities(storeId, options).then((request) => request(axios, basePath));
|
|
1745
|
+
},
|
|
1458
1746
|
/**
|
|
1459
1747
|
*
|
|
1460
1748
|
* @summary Get transfere patients requests by store id
|
|
@@ -1465,6 +1753,17 @@ export const StoresApiFactory = function (configuration?: Configuration, basePat
|
|
|
1465
1753
|
async getTransferePatientsRequests(storeId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<TransferePatientRequest>>> {
|
|
1466
1754
|
return StoresApiFp(configuration).getTransferePatientsRequests(storeId, options).then((request) => request(axios, basePath));
|
|
1467
1755
|
},
|
|
1756
|
+
/**
|
|
1757
|
+
*
|
|
1758
|
+
* @summary Revoke/delete a specific API key
|
|
1759
|
+
* @param {string} storeId
|
|
1760
|
+
* @param {string} keyType Type of key to revoke
|
|
1761
|
+
* @param {*} [options] Override http request option.
|
|
1762
|
+
* @throws {RequiredError}
|
|
1763
|
+
*/
|
|
1764
|
+
async revokeApiKey(storeId: string, keyType: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
1765
|
+
return StoresApiFp(configuration).revokeApiKey(storeId, keyType, options).then((request) => request(axios, basePath));
|
|
1766
|
+
},
|
|
1468
1767
|
/**
|
|
1469
1768
|
*
|
|
1470
1769
|
* @param {*} [options] Override http request option.
|
|
@@ -1559,6 +1858,17 @@ export const StoresApiFactory = function (configuration?: Configuration, basePat
|
|
|
1559
1858
|
async sendScheduleTourEmail(body: ScheduleTourEmailDto, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
1560
1859
|
return StoresApiFp(configuration).sendScheduleTourEmail(body, options).then((request) => request(axios, basePath));
|
|
1561
1860
|
},
|
|
1861
|
+
/**
|
|
1862
|
+
*
|
|
1863
|
+
* @summary Update store API keys (Stripe/Shippo)
|
|
1864
|
+
* @param {UpdateApiKeysDto} body
|
|
1865
|
+
* @param {string} storeId
|
|
1866
|
+
* @param {*} [options] Override http request option.
|
|
1867
|
+
* @throws {RequiredError}
|
|
1868
|
+
*/
|
|
1869
|
+
async updateApiKeys(body: UpdateApiKeysDto, storeId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<StoreApiKeysResponseDto>> {
|
|
1870
|
+
return StoresApiFp(configuration).updateApiKeys(body, storeId, options).then((request) => request(axios, basePath));
|
|
1871
|
+
},
|
|
1562
1872
|
/**
|
|
1563
1873
|
*
|
|
1564
1874
|
* @summary Update refill request by id
|
|
@@ -1656,6 +1966,17 @@ export class StoresApi extends BaseAPI {
|
|
|
1656
1966
|
public async getAllStores(options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<StoreEntity>>> {
|
|
1657
1967
|
return StoresApiFp(this.configuration).getAllStores(options).then((request) => request(this.axios, this.basePath));
|
|
1658
1968
|
}
|
|
1969
|
+
/**
|
|
1970
|
+
*
|
|
1971
|
+
* @summary Get store API keys with masked values
|
|
1972
|
+
* @param {string} storeId
|
|
1973
|
+
* @param {*} [options] Override http request option.
|
|
1974
|
+
* @throws {RequiredError}
|
|
1975
|
+
* @memberof StoresApi
|
|
1976
|
+
*/
|
|
1977
|
+
public async getApiKeys(storeId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<StoreApiKeysResponseDto>> {
|
|
1978
|
+
return StoresApiFp(this.configuration).getApiKeys(storeId, options).then((request) => request(this.axios, this.basePath));
|
|
1979
|
+
}
|
|
1659
1980
|
/**
|
|
1660
1981
|
*
|
|
1661
1982
|
* @summary Get refill requests by store id
|
|
@@ -1678,6 +1999,17 @@ export class StoresApi extends BaseAPI {
|
|
|
1678
1999
|
public async getStoreById(storeId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<StoreEntity>> {
|
|
1679
2000
|
return StoresApiFp(this.configuration).getStoreById(storeId, options).then((request) => request(this.axios, this.basePath));
|
|
1680
2001
|
}
|
|
2002
|
+
/**
|
|
2003
|
+
*
|
|
2004
|
+
* @summary Get store capabilities (payment/delivery options available)
|
|
2005
|
+
* @param {string} storeId
|
|
2006
|
+
* @param {*} [options] Override http request option.
|
|
2007
|
+
* @throws {RequiredError}
|
|
2008
|
+
* @memberof StoresApi
|
|
2009
|
+
*/
|
|
2010
|
+
public async getStoreCapabilities(storeId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<StoreCapabilitiesDto>> {
|
|
2011
|
+
return StoresApiFp(this.configuration).getStoreCapabilities(storeId, options).then((request) => request(this.axios, this.basePath));
|
|
2012
|
+
}
|
|
1681
2013
|
/**
|
|
1682
2014
|
*
|
|
1683
2015
|
* @summary Get transfere patients requests by store id
|
|
@@ -1689,6 +2021,18 @@ export class StoresApi extends BaseAPI {
|
|
|
1689
2021
|
public async getTransferePatientsRequests(storeId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<TransferePatientRequest>>> {
|
|
1690
2022
|
return StoresApiFp(this.configuration).getTransferePatientsRequests(storeId, options).then((request) => request(this.axios, this.basePath));
|
|
1691
2023
|
}
|
|
2024
|
+
/**
|
|
2025
|
+
*
|
|
2026
|
+
* @summary Revoke/delete a specific API key
|
|
2027
|
+
* @param {string} storeId
|
|
2028
|
+
* @param {string} keyType Type of key to revoke
|
|
2029
|
+
* @param {*} [options] Override http request option.
|
|
2030
|
+
* @throws {RequiredError}
|
|
2031
|
+
* @memberof StoresApi
|
|
2032
|
+
*/
|
|
2033
|
+
public async revokeApiKey(storeId: string, keyType: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
2034
|
+
return StoresApiFp(this.configuration).revokeApiKey(storeId, keyType, options).then((request) => request(this.axios, this.basePath));
|
|
2035
|
+
}
|
|
1692
2036
|
/**
|
|
1693
2037
|
*
|
|
1694
2038
|
* @param {*} [options] Override http request option.
|
|
@@ -1794,6 +2138,18 @@ export class StoresApi extends BaseAPI {
|
|
|
1794
2138
|
public async sendScheduleTourEmail(body: ScheduleTourEmailDto, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
1795
2139
|
return StoresApiFp(this.configuration).sendScheduleTourEmail(body, options).then((request) => request(this.axios, this.basePath));
|
|
1796
2140
|
}
|
|
2141
|
+
/**
|
|
2142
|
+
*
|
|
2143
|
+
* @summary Update store API keys (Stripe/Shippo)
|
|
2144
|
+
* @param {UpdateApiKeysDto} body
|
|
2145
|
+
* @param {string} storeId
|
|
2146
|
+
* @param {*} [options] Override http request option.
|
|
2147
|
+
* @throws {RequiredError}
|
|
2148
|
+
* @memberof StoresApi
|
|
2149
|
+
*/
|
|
2150
|
+
public async updateApiKeys(body: UpdateApiKeysDto, storeId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<StoreApiKeysResponseDto>> {
|
|
2151
|
+
return StoresApiFp(this.configuration).updateApiKeys(body, storeId, options).then((request) => request(this.axios, this.basePath));
|
|
2152
|
+
}
|
|
1797
2153
|
/**
|
|
1798
2154
|
*
|
|
1799
2155
|
* @summary Update refill request by id
|