hey-pharmacist-ecommerce 1.1.29 → 1.1.31

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 (104) hide show
  1. package/dist/index.d.mts +10957 -1331
  2. package/dist/index.d.ts +10957 -1331
  3. package/dist/index.js +12364 -5144
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +9353 -2205
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +4 -3
  8. package/src/components/AccountReviewsTab.tsx +97 -0
  9. package/src/components/CouponCodeInput.tsx +190 -0
  10. package/src/components/Header.tsx +5 -1
  11. package/src/components/Notification.tsx +1 -1
  12. package/src/components/NotificationBell.tsx +33 -0
  13. package/src/components/NotificationCard.tsx +211 -0
  14. package/src/components/NotificationDrawer.tsx +195 -0
  15. package/src/components/OrderCard.tsx +164 -99
  16. package/src/components/ProductReviewsSection.tsx +30 -0
  17. package/src/components/RatingDistribution.tsx +86 -0
  18. package/src/components/ReviewCard.tsx +59 -0
  19. package/src/components/ReviewForm.tsx +207 -0
  20. package/src/components/ReviewPromptBanner.tsx +98 -0
  21. package/src/components/ReviewsList.tsx +151 -0
  22. package/src/components/StarRating.tsx +98 -0
  23. package/src/hooks/useDiscounts.ts +7 -0
  24. package/src/hooks/useOrders.ts +15 -0
  25. package/src/hooks/useReviews.ts +230 -0
  26. package/src/hooks/useStoreCapabilities.ts +87 -0
  27. package/src/index.ts +29 -0
  28. package/src/lib/Apis/apis/auth-api.ts +19 -7
  29. package/src/lib/Apis/apis/categories-api.ts +97 -0
  30. package/src/lib/Apis/apis/discounts-api.ts +23 -72
  31. package/src/lib/Apis/apis/notifications-api.ts +196 -231
  32. package/src/lib/Apis/apis/products-api.ts +181 -0
  33. package/src/lib/Apis/apis/review-api.ts +283 -4
  34. package/src/lib/Apis/apis/shipping-api.ts +105 -0
  35. package/src/lib/Apis/apis/stores-api.ts +536 -0
  36. package/src/lib/Apis/apis/sub-categories-api.ts +97 -0
  37. package/src/lib/Apis/apis/users-api.ts +8 -8
  38. package/src/lib/Apis/models/address-created-request.ts +0 -12
  39. package/src/lib/Apis/models/address.ts +0 -12
  40. package/src/lib/Apis/models/api-key-info-dto.ts +49 -0
  41. package/src/lib/Apis/models/bulk-channel-toggle-dto.ts +52 -0
  42. package/src/lib/Apis/models/cart-body-populated.ts +3 -3
  43. package/src/lib/Apis/models/channel-settings-dto.ts +39 -0
  44. package/src/lib/Apis/models/{discount-paginated-response.ts → completed-order-dto.ts} +21 -16
  45. package/src/lib/Apis/models/create-address-dto.ts +0 -12
  46. package/src/lib/Apis/models/create-discount-dto.ts +31 -100
  47. package/src/lib/Apis/models/create-review-dto.ts +4 -4
  48. package/src/lib/Apis/models/create-shippo-account-dto.ts +45 -0
  49. package/src/lib/Apis/models/create-store-address-dto.ts +0 -12
  50. package/src/lib/Apis/models/create-store-dto-settings.ts +51 -0
  51. package/src/lib/Apis/models/create-store-dto.ts +13 -0
  52. package/src/lib/Apis/models/create-variant-dto.ts +0 -6
  53. package/src/lib/Apis/models/discount.ts +37 -106
  54. package/src/lib/Apis/models/discounts-insights-dto.ts +12 -0
  55. package/src/lib/Apis/models/index.ts +24 -7
  56. package/src/lib/Apis/models/{manual-discount.ts → manual-discount-dto.ts} +10 -10
  57. package/src/lib/Apis/models/manual-order-dto.ts +3 -3
  58. package/src/lib/Apis/models/populated-discount.ts +41 -109
  59. package/src/lib/Apis/models/preference-update-item.ts +59 -0
  60. package/src/lib/Apis/models/product-light-dto.ts +40 -0
  61. package/src/lib/Apis/models/product-variant.ts +0 -6
  62. package/src/lib/Apis/models/reorder-categories-dto.ts +27 -0
  63. package/src/lib/Apis/models/reorder-products-dto.ts +49 -0
  64. package/src/lib/Apis/models/{check-notifications-response-dto.ts → reorder-products-success-response-dto.ts} +7 -7
  65. package/src/lib/Apis/models/reorder-subcategories-dto.ts +33 -0
  66. package/src/lib/Apis/models/reorder-success-response-dto.ts +33 -0
  67. package/src/lib/Apis/models/review-status-dto.ts +34 -0
  68. package/src/lib/Apis/models/review.ts +9 -3
  69. package/src/lib/Apis/models/reviewable-order-dto.ts +58 -0
  70. package/src/lib/Apis/models/reviewable-product-dto.ts +81 -0
  71. package/src/lib/Apis/models/shipment-with-order.ts +18 -0
  72. package/src/lib/Apis/models/shipment.ts +18 -0
  73. package/src/lib/Apis/models/shippo-account-response-dto.ts +51 -0
  74. package/src/lib/Apis/models/store-api-keys-response-dto.ts +34 -0
  75. package/src/lib/Apis/models/store-capabilities-dto.ts +63 -0
  76. package/src/lib/Apis/models/store-entity.ts +13 -0
  77. package/src/lib/Apis/models/store.ts +13 -0
  78. package/src/lib/Apis/models/update-address-dto.ts +0 -12
  79. package/src/lib/Apis/models/update-api-keys-dto.ts +39 -0
  80. package/src/lib/Apis/models/update-discount-dto.ts +31 -100
  81. package/src/lib/Apis/models/update-manual-shipment-status-dto.ts +47 -0
  82. package/src/lib/Apis/models/update-notification-settings-dto.ts +28 -0
  83. package/src/lib/Apis/models/update-review-dto.ts +4 -4
  84. package/src/lib/Apis/models/update-store-dto.ts +13 -0
  85. package/src/lib/Apis/models/update-variant-dto.ts +0 -6
  86. package/src/lib/Apis/models/{pick-type-class.ts → variant-light-dto.ts} +20 -14
  87. package/src/lib/utils/discount.ts +155 -0
  88. package/src/lib/validations/discount.ts +11 -0
  89. package/src/providers/CartProvider.tsx +2 -2
  90. package/src/providers/DiscountProvider.tsx +97 -0
  91. package/src/providers/EcommerceProvider.tsx +13 -5
  92. package/src/providers/NotificationCenterProvider.tsx +436 -0
  93. package/src/screens/CartScreen.tsx +1 -1
  94. package/src/screens/CheckoutScreen.tsx +402 -290
  95. package/src/screens/NotificationSettingsScreen.tsx +413 -0
  96. package/src/screens/OrderDetailScreen.tsx +283 -0
  97. package/src/screens/OrderReviewsScreen.tsx +308 -0
  98. package/src/screens/OrdersScreen.tsx +31 -7
  99. package/src/screens/ProductDetailScreen.tsx +24 -11
  100. package/src/screens/ProfileScreen.tsx +5 -0
  101. package/src/screens/ResetPasswordScreen.tsx +10 -4
  102. package/src/lib/Apis/models/create-notification-dto.ts +0 -75
  103. package/src/lib/Apis/models/notification.ts +0 -93
  104. package/src/lib/Apis/models/single-notification-dto.ts +0 -99
@@ -16,14 +16,19 @@ import { Configuration } from '../configuration';
16
16
  // Some imports not used depending on template conditions
17
17
  // @ts-ignore
18
18
  import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
19
+ import { CreateShippoAccountDto } from '../models';
19
20
  import { CreateStoreDto } from '../models';
20
21
  import { NewClientEmailDto } from '../models';
21
22
  import { RefillRequest } from '../models';
22
23
  import { RefillRequestDto } from '../models';
23
24
  import { ScheduleTourEmailDto } from '../models';
25
+ import { ShippoAccountResponseDto } from '../models';
26
+ import { StoreApiKeysResponseDto } from '../models';
27
+ import { StoreCapabilitiesDto } from '../models';
24
28
  import { StoreEntity } from '../models';
25
29
  import { TransferePatientRequest } from '../models';
26
30
  import { TransferePatientsRequestDto } from '../models';
31
+ import { UpdateApiKeysDto } from '../models';
27
32
  import { UpdateRefillRequestDto } from '../models';
28
33
  import { UpdateStoreDto } from '../models';
29
34
  import { UpdateTransferePatientsRequestDto } from '../models';
@@ -33,6 +38,63 @@ import { UpdateTransferePatientsRequestDto } from '../models';
33
38
  */
34
39
  export const StoresApiAxiosParamCreator = function (configuration?: Configuration) {
35
40
  return {
41
+ /**
42
+ *
43
+ * @summary Create a Shippo managed account for the store
44
+ * @param {CreateShippoAccountDto} body
45
+ * @param {string} storeId
46
+ * @param {*} [options] Override http request option.
47
+ * @throws {RequiredError}
48
+ */
49
+ createShippoAccount: async (body: CreateShippoAccountDto, storeId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
50
+ // verify required parameter 'body' is not null or undefined
51
+ if (body === null || body === undefined) {
52
+ throw new RequiredError('body','Required parameter body was null or undefined when calling createShippoAccount.');
53
+ }
54
+ // verify required parameter 'storeId' is not null or undefined
55
+ if (storeId === null || storeId === undefined) {
56
+ throw new RequiredError('storeId','Required parameter storeId was null or undefined when calling createShippoAccount.');
57
+ }
58
+ const localVarPath = `/stores/{storeId}/shippo-account`
59
+ .replace(`{${"storeId"}}`, encodeURIComponent(String(storeId)));
60
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
61
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
62
+ let baseOptions;
63
+ if (configuration) {
64
+ baseOptions = configuration.baseOptions;
65
+ }
66
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
67
+ const localVarHeaderParameter = {} as any;
68
+ const localVarQueryParameter = {} as any;
69
+
70
+ // authentication x-store-key required
71
+ if (configuration && configuration.apiKey) {
72
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
73
+ ? await configuration.apiKey("x-store-key")
74
+ : await configuration.apiKey;
75
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
76
+ }
77
+
78
+ localVarHeaderParameter['Content-Type'] = 'application/json';
79
+
80
+ const query = new URLSearchParams(localVarUrlObj.search);
81
+ for (const key in localVarQueryParameter) {
82
+ query.set(key, localVarQueryParameter[key]);
83
+ }
84
+ for (const key in options.params) {
85
+ query.set(key, options.params[key]);
86
+ }
87
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
88
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
89
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
90
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
91
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
92
+
93
+ return {
94
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
95
+ options: localVarRequestOptions,
96
+ };
97
+ },
36
98
  /**
37
99
  *
38
100
  * @summary Create a new store
@@ -270,6 +332,54 @@ export const StoresApiAxiosParamCreator = function (configuration?: Configuratio
270
332
  options: localVarRequestOptions,
271
333
  };
272
334
  },
335
+ /**
336
+ *
337
+ * @summary Get store API keys with masked values
338
+ * @param {string} storeId
339
+ * @param {*} [options] Override http request option.
340
+ * @throws {RequiredError}
341
+ */
342
+ getApiKeys: async (storeId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
343
+ // verify required parameter 'storeId' is not null or undefined
344
+ if (storeId === null || storeId === undefined) {
345
+ throw new RequiredError('storeId','Required parameter storeId was null or undefined when calling getApiKeys.');
346
+ }
347
+ const localVarPath = `/stores/{storeId}/api-keys`
348
+ .replace(`{${"storeId"}}`, encodeURIComponent(String(storeId)));
349
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
350
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
351
+ let baseOptions;
352
+ if (configuration) {
353
+ baseOptions = configuration.baseOptions;
354
+ }
355
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
356
+ const localVarHeaderParameter = {} as any;
357
+ const localVarQueryParameter = {} as any;
358
+
359
+ // authentication x-store-key required
360
+ if (configuration && configuration.apiKey) {
361
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
362
+ ? await configuration.apiKey("x-store-key")
363
+ : await configuration.apiKey;
364
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
365
+ }
366
+
367
+ const query = new URLSearchParams(localVarUrlObj.search);
368
+ for (const key in localVarQueryParameter) {
369
+ query.set(key, localVarQueryParameter[key]);
370
+ }
371
+ for (const key in options.params) {
372
+ query.set(key, options.params[key]);
373
+ }
374
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
375
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
376
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
377
+
378
+ return {
379
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
380
+ options: localVarRequestOptions,
381
+ };
382
+ },
273
383
  /**
274
384
  *
275
385
  * @summary Get refill requests by store id
@@ -318,6 +428,54 @@ export const StoresApiAxiosParamCreator = function (configuration?: Configuratio
318
428
  options: localVarRequestOptions,
319
429
  };
320
430
  },
431
+ /**
432
+ *
433
+ * @summary Check if store has a Shippo platform account
434
+ * @param {string} storeId
435
+ * @param {*} [options] Override http request option.
436
+ * @throws {RequiredError}
437
+ */
438
+ getShippoAccount: async (storeId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
439
+ // verify required parameter 'storeId' is not null or undefined
440
+ if (storeId === null || storeId === undefined) {
441
+ throw new RequiredError('storeId','Required parameter storeId was null or undefined when calling getShippoAccount.');
442
+ }
443
+ const localVarPath = `/stores/{storeId}/shippo-account`
444
+ .replace(`{${"storeId"}}`, encodeURIComponent(String(storeId)));
445
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
446
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
447
+ let baseOptions;
448
+ if (configuration) {
449
+ baseOptions = configuration.baseOptions;
450
+ }
451
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
452
+ const localVarHeaderParameter = {} as any;
453
+ const localVarQueryParameter = {} as any;
454
+
455
+ // authentication x-store-key required
456
+ if (configuration && configuration.apiKey) {
457
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
458
+ ? await configuration.apiKey("x-store-key")
459
+ : await configuration.apiKey;
460
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
461
+ }
462
+
463
+ const query = new URLSearchParams(localVarUrlObj.search);
464
+ for (const key in localVarQueryParameter) {
465
+ query.set(key, localVarQueryParameter[key]);
466
+ }
467
+ for (const key in options.params) {
468
+ query.set(key, options.params[key]);
469
+ }
470
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
471
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
472
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
473
+
474
+ return {
475
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
476
+ options: localVarRequestOptions,
477
+ };
478
+ },
321
479
  /**
322
480
  *
323
481
  * @summary Get store by id
@@ -366,6 +524,54 @@ export const StoresApiAxiosParamCreator = function (configuration?: Configuratio
366
524
  options: localVarRequestOptions,
367
525
  };
368
526
  },
527
+ /**
528
+ *
529
+ * @summary Get store capabilities (payment/delivery options available)
530
+ * @param {string} storeId
531
+ * @param {*} [options] Override http request option.
532
+ * @throws {RequiredError}
533
+ */
534
+ getStoreCapabilities: async (storeId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
535
+ // verify required parameter 'storeId' is not null or undefined
536
+ if (storeId === null || storeId === undefined) {
537
+ throw new RequiredError('storeId','Required parameter storeId was null or undefined when calling getStoreCapabilities.');
538
+ }
539
+ const localVarPath = `/stores/{storeId}/capabilities`
540
+ .replace(`{${"storeId"}}`, encodeURIComponent(String(storeId)));
541
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
542
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
543
+ let baseOptions;
544
+ if (configuration) {
545
+ baseOptions = configuration.baseOptions;
546
+ }
547
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
548
+ const localVarHeaderParameter = {} as any;
549
+ const localVarQueryParameter = {} as any;
550
+
551
+ // authentication x-store-key required
552
+ if (configuration && configuration.apiKey) {
553
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
554
+ ? await configuration.apiKey("x-store-key")
555
+ : await configuration.apiKey;
556
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
557
+ }
558
+
559
+ const query = new URLSearchParams(localVarUrlObj.search);
560
+ for (const key in localVarQueryParameter) {
561
+ query.set(key, localVarQueryParameter[key]);
562
+ }
563
+ for (const key in options.params) {
564
+ query.set(key, options.params[key]);
565
+ }
566
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
567
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
568
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
569
+
570
+ return {
571
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
572
+ options: localVarRequestOptions,
573
+ };
574
+ },
369
575
  /**
370
576
  *
371
577
  * @summary Get transfere patients requests by store id
@@ -414,6 +620,60 @@ export const StoresApiAxiosParamCreator = function (configuration?: Configuratio
414
620
  options: localVarRequestOptions,
415
621
  };
416
622
  },
623
+ /**
624
+ *
625
+ * @summary Revoke/delete a specific API key
626
+ * @param {string} storeId
627
+ * @param {string} keyType Type of key to revoke
628
+ * @param {*} [options] Override http request option.
629
+ * @throws {RequiredError}
630
+ */
631
+ revokeApiKey: async (storeId: string, keyType: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
632
+ // verify required parameter 'storeId' is not null or undefined
633
+ if (storeId === null || storeId === undefined) {
634
+ throw new RequiredError('storeId','Required parameter storeId was null or undefined when calling revokeApiKey.');
635
+ }
636
+ // verify required parameter 'keyType' is not null or undefined
637
+ if (keyType === null || keyType === undefined) {
638
+ throw new RequiredError('keyType','Required parameter keyType was null or undefined when calling revokeApiKey.');
639
+ }
640
+ const localVarPath = `/stores/{storeId}/api-keys/{keyType}`
641
+ .replace(`{${"storeId"}}`, encodeURIComponent(String(storeId)))
642
+ .replace(`{${"keyType"}}`, encodeURIComponent(String(keyType)));
643
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
644
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
645
+ let baseOptions;
646
+ if (configuration) {
647
+ baseOptions = configuration.baseOptions;
648
+ }
649
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options};
650
+ const localVarHeaderParameter = {} as any;
651
+ const localVarQueryParameter = {} as any;
652
+
653
+ // authentication x-store-key required
654
+ if (configuration && configuration.apiKey) {
655
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
656
+ ? await configuration.apiKey("x-store-key")
657
+ : await configuration.apiKey;
658
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
659
+ }
660
+
661
+ const query = new URLSearchParams(localVarUrlObj.search);
662
+ for (const key in localVarQueryParameter) {
663
+ query.set(key, localVarQueryParameter[key]);
664
+ }
665
+ for (const key in options.params) {
666
+ query.set(key, options.params[key]);
667
+ }
668
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
669
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
670
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
671
+
672
+ return {
673
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
674
+ options: localVarRequestOptions,
675
+ };
676
+ },
417
677
  /**
418
678
  *
419
679
  * @param {*} [options] Override http request option.
@@ -903,6 +1163,63 @@ export const StoresApiAxiosParamCreator = function (configuration?: Configuratio
903
1163
  options: localVarRequestOptions,
904
1164
  };
905
1165
  },
1166
+ /**
1167
+ *
1168
+ * @summary Update store API keys (Stripe/Shippo)
1169
+ * @param {UpdateApiKeysDto} body
1170
+ * @param {string} storeId
1171
+ * @param {*} [options] Override http request option.
1172
+ * @throws {RequiredError}
1173
+ */
1174
+ updateApiKeys: async (body: UpdateApiKeysDto, storeId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
1175
+ // verify required parameter 'body' is not null or undefined
1176
+ if (body === null || body === undefined) {
1177
+ throw new RequiredError('body','Required parameter body was null or undefined when calling updateApiKeys.');
1178
+ }
1179
+ // verify required parameter 'storeId' is not null or undefined
1180
+ if (storeId === null || storeId === undefined) {
1181
+ throw new RequiredError('storeId','Required parameter storeId was null or undefined when calling updateApiKeys.');
1182
+ }
1183
+ const localVarPath = `/stores/{storeId}/api-keys`
1184
+ .replace(`{${"storeId"}}`, encodeURIComponent(String(storeId)));
1185
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1186
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
1187
+ let baseOptions;
1188
+ if (configuration) {
1189
+ baseOptions = configuration.baseOptions;
1190
+ }
1191
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
1192
+ const localVarHeaderParameter = {} as any;
1193
+ const localVarQueryParameter = {} as any;
1194
+
1195
+ // authentication x-store-key required
1196
+ if (configuration && configuration.apiKey) {
1197
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
1198
+ ? await configuration.apiKey("x-store-key")
1199
+ : await configuration.apiKey;
1200
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
1201
+ }
1202
+
1203
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1204
+
1205
+ const query = new URLSearchParams(localVarUrlObj.search);
1206
+ for (const key in localVarQueryParameter) {
1207
+ query.set(key, localVarQueryParameter[key]);
1208
+ }
1209
+ for (const key in options.params) {
1210
+ query.set(key, options.params[key]);
1211
+ }
1212
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
1213
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1214
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1215
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
1216
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
1217
+
1218
+ return {
1219
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
1220
+ options: localVarRequestOptions,
1221
+ };
1222
+ },
906
1223
  /**
907
1224
  *
908
1225
  * @summary Update refill request by id
@@ -1083,6 +1400,21 @@ export const StoresApiAxiosParamCreator = function (configuration?: Configuratio
1083
1400
  */
1084
1401
  export const StoresApiFp = function(configuration?: Configuration) {
1085
1402
  return {
1403
+ /**
1404
+ *
1405
+ * @summary Create a Shippo managed account for the store
1406
+ * @param {CreateShippoAccountDto} body
1407
+ * @param {string} storeId
1408
+ * @param {*} [options] Override http request option.
1409
+ * @throws {RequiredError}
1410
+ */
1411
+ async createShippoAccount(body: CreateShippoAccountDto, storeId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ShippoAccountResponseDto>>> {
1412
+ const localVarAxiosArgs = await StoresApiAxiosParamCreator(configuration).createShippoAccount(body, storeId, options);
1413
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1414
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1415
+ return axios.request(axiosRequestArgs);
1416
+ };
1417
+ },
1086
1418
  /**
1087
1419
  *
1088
1420
  * @summary Create a new store
@@ -1152,6 +1484,20 @@ export const StoresApiFp = function(configuration?: Configuration) {
1152
1484
  return axios.request(axiosRequestArgs);
1153
1485
  };
1154
1486
  },
1487
+ /**
1488
+ *
1489
+ * @summary Get store API keys with masked values
1490
+ * @param {string} storeId
1491
+ * @param {*} [options] Override http request option.
1492
+ * @throws {RequiredError}
1493
+ */
1494
+ async getApiKeys(storeId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<StoreApiKeysResponseDto>>> {
1495
+ const localVarAxiosArgs = await StoresApiAxiosParamCreator(configuration).getApiKeys(storeId, options);
1496
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1497
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1498
+ return axios.request(axiosRequestArgs);
1499
+ };
1500
+ },
1155
1501
  /**
1156
1502
  *
1157
1503
  * @summary Get refill requests by store id
@@ -1166,6 +1512,20 @@ export const StoresApiFp = function(configuration?: Configuration) {
1166
1512
  return axios.request(axiosRequestArgs);
1167
1513
  };
1168
1514
  },
1515
+ /**
1516
+ *
1517
+ * @summary Check if store has a Shippo platform account
1518
+ * @param {string} storeId
1519
+ * @param {*} [options] Override http request option.
1520
+ * @throws {RequiredError}
1521
+ */
1522
+ async getShippoAccount(storeId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
1523
+ const localVarAxiosArgs = await StoresApiAxiosParamCreator(configuration).getShippoAccount(storeId, options);
1524
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1525
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1526
+ return axios.request(axiosRequestArgs);
1527
+ };
1528
+ },
1169
1529
  /**
1170
1530
  *
1171
1531
  * @summary Get store by id
@@ -1180,6 +1540,20 @@ export const StoresApiFp = function(configuration?: Configuration) {
1180
1540
  return axios.request(axiosRequestArgs);
1181
1541
  };
1182
1542
  },
1543
+ /**
1544
+ *
1545
+ * @summary Get store capabilities (payment/delivery options available)
1546
+ * @param {string} storeId
1547
+ * @param {*} [options] Override http request option.
1548
+ * @throws {RequiredError}
1549
+ */
1550
+ async getStoreCapabilities(storeId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<StoreCapabilitiesDto>>> {
1551
+ const localVarAxiosArgs = await StoresApiAxiosParamCreator(configuration).getStoreCapabilities(storeId, options);
1552
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1553
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1554
+ return axios.request(axiosRequestArgs);
1555
+ };
1556
+ },
1183
1557
  /**
1184
1558
  *
1185
1559
  * @summary Get transfere patients requests by store id
@@ -1194,6 +1568,21 @@ export const StoresApiFp = function(configuration?: Configuration) {
1194
1568
  return axios.request(axiosRequestArgs);
1195
1569
  };
1196
1570
  },
1571
+ /**
1572
+ *
1573
+ * @summary Revoke/delete a specific API key
1574
+ * @param {string} storeId
1575
+ * @param {string} keyType Type of key to revoke
1576
+ * @param {*} [options] Override http request option.
1577
+ * @throws {RequiredError}
1578
+ */
1579
+ async revokeApiKey(storeId: string, keyType: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
1580
+ const localVarAxiosArgs = await StoresApiAxiosParamCreator(configuration).revokeApiKey(storeId, keyType, options);
1581
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1582
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1583
+ return axios.request(axiosRequestArgs);
1584
+ };
1585
+ },
1197
1586
  /**
1198
1587
  *
1199
1588
  * @param {*} [options] Override http request option.
@@ -1332,6 +1721,21 @@ export const StoresApiFp = function(configuration?: Configuration) {
1332
1721
  return axios.request(axiosRequestArgs);
1333
1722
  };
1334
1723
  },
1724
+ /**
1725
+ *
1726
+ * @summary Update store API keys (Stripe/Shippo)
1727
+ * @param {UpdateApiKeysDto} body
1728
+ * @param {string} storeId
1729
+ * @param {*} [options] Override http request option.
1730
+ * @throws {RequiredError}
1731
+ */
1732
+ async updateApiKeys(body: UpdateApiKeysDto, storeId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<StoreApiKeysResponseDto>>> {
1733
+ const localVarAxiosArgs = await StoresApiAxiosParamCreator(configuration).updateApiKeys(body, storeId, options);
1734
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1735
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1736
+ return axios.request(axiosRequestArgs);
1737
+ };
1738
+ },
1335
1739
  /**
1336
1740
  *
1337
1741
  * @summary Update refill request by id
@@ -1386,6 +1790,17 @@ export const StoresApiFp = function(configuration?: Configuration) {
1386
1790
  */
1387
1791
  export const StoresApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
1388
1792
  return {
1793
+ /**
1794
+ *
1795
+ * @summary Create a Shippo managed account for the store
1796
+ * @param {CreateShippoAccountDto} body
1797
+ * @param {string} storeId
1798
+ * @param {*} [options] Override http request option.
1799
+ * @throws {RequiredError}
1800
+ */
1801
+ async createShippoAccount(body: CreateShippoAccountDto, storeId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ShippoAccountResponseDto>> {
1802
+ return StoresApiFp(configuration).createShippoAccount(body, storeId, options).then((request) => request(axios, basePath));
1803
+ },
1389
1804
  /**
1390
1805
  *
1391
1806
  * @summary Create a new store
@@ -1435,6 +1850,16 @@ export const StoresApiFactory = function (configuration?: Configuration, basePat
1435
1850
  async getAllStores(options?: AxiosRequestConfig): Promise<AxiosResponse<Array<StoreEntity>>> {
1436
1851
  return StoresApiFp(configuration).getAllStores(options).then((request) => request(axios, basePath));
1437
1852
  },
1853
+ /**
1854
+ *
1855
+ * @summary Get store API keys with masked values
1856
+ * @param {string} storeId
1857
+ * @param {*} [options] Override http request option.
1858
+ * @throws {RequiredError}
1859
+ */
1860
+ async getApiKeys(storeId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<StoreApiKeysResponseDto>> {
1861
+ return StoresApiFp(configuration).getApiKeys(storeId, options).then((request) => request(axios, basePath));
1862
+ },
1438
1863
  /**
1439
1864
  *
1440
1865
  * @summary Get refill requests by store id
@@ -1445,6 +1870,16 @@ export const StoresApiFactory = function (configuration?: Configuration, basePat
1445
1870
  async getRefillRequests(storeId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<RefillRequest>>> {
1446
1871
  return StoresApiFp(configuration).getRefillRequests(storeId, options).then((request) => request(axios, basePath));
1447
1872
  },
1873
+ /**
1874
+ *
1875
+ * @summary Check if store has a Shippo platform account
1876
+ * @param {string} storeId
1877
+ * @param {*} [options] Override http request option.
1878
+ * @throws {RequiredError}
1879
+ */
1880
+ async getShippoAccount(storeId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
1881
+ return StoresApiFp(configuration).getShippoAccount(storeId, options).then((request) => request(axios, basePath));
1882
+ },
1448
1883
  /**
1449
1884
  *
1450
1885
  * @summary Get store by id
@@ -1455,6 +1890,16 @@ export const StoresApiFactory = function (configuration?: Configuration, basePat
1455
1890
  async getStoreById(storeId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<StoreEntity>> {
1456
1891
  return StoresApiFp(configuration).getStoreById(storeId, options).then((request) => request(axios, basePath));
1457
1892
  },
1893
+ /**
1894
+ *
1895
+ * @summary Get store capabilities (payment/delivery options available)
1896
+ * @param {string} storeId
1897
+ * @param {*} [options] Override http request option.
1898
+ * @throws {RequiredError}
1899
+ */
1900
+ async getStoreCapabilities(storeId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<StoreCapabilitiesDto>> {
1901
+ return StoresApiFp(configuration).getStoreCapabilities(storeId, options).then((request) => request(axios, basePath));
1902
+ },
1458
1903
  /**
1459
1904
  *
1460
1905
  * @summary Get transfere patients requests by store id
@@ -1465,6 +1910,17 @@ export const StoresApiFactory = function (configuration?: Configuration, basePat
1465
1910
  async getTransferePatientsRequests(storeId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<TransferePatientRequest>>> {
1466
1911
  return StoresApiFp(configuration).getTransferePatientsRequests(storeId, options).then((request) => request(axios, basePath));
1467
1912
  },
1913
+ /**
1914
+ *
1915
+ * @summary Revoke/delete a specific API key
1916
+ * @param {string} storeId
1917
+ * @param {string} keyType Type of key to revoke
1918
+ * @param {*} [options] Override http request option.
1919
+ * @throws {RequiredError}
1920
+ */
1921
+ async revokeApiKey(storeId: string, keyType: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
1922
+ return StoresApiFp(configuration).revokeApiKey(storeId, keyType, options).then((request) => request(axios, basePath));
1923
+ },
1468
1924
  /**
1469
1925
  *
1470
1926
  * @param {*} [options] Override http request option.
@@ -1559,6 +2015,17 @@ export const StoresApiFactory = function (configuration?: Configuration, basePat
1559
2015
  async sendScheduleTourEmail(body: ScheduleTourEmailDto, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
1560
2016
  return StoresApiFp(configuration).sendScheduleTourEmail(body, options).then((request) => request(axios, basePath));
1561
2017
  },
2018
+ /**
2019
+ *
2020
+ * @summary Update store API keys (Stripe/Shippo)
2021
+ * @param {UpdateApiKeysDto} body
2022
+ * @param {string} storeId
2023
+ * @param {*} [options] Override http request option.
2024
+ * @throws {RequiredError}
2025
+ */
2026
+ async updateApiKeys(body: UpdateApiKeysDto, storeId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<StoreApiKeysResponseDto>> {
2027
+ return StoresApiFp(configuration).updateApiKeys(body, storeId, options).then((request) => request(axios, basePath));
2028
+ },
1562
2029
  /**
1563
2030
  *
1564
2031
  * @summary Update refill request by id
@@ -1602,6 +2069,18 @@ export const StoresApiFactory = function (configuration?: Configuration, basePat
1602
2069
  * @extends {BaseAPI}
1603
2070
  */
1604
2071
  export class StoresApi extends BaseAPI {
2072
+ /**
2073
+ *
2074
+ * @summary Create a Shippo managed account for the store
2075
+ * @param {CreateShippoAccountDto} body
2076
+ * @param {string} storeId
2077
+ * @param {*} [options] Override http request option.
2078
+ * @throws {RequiredError}
2079
+ * @memberof StoresApi
2080
+ */
2081
+ public async createShippoAccount(body: CreateShippoAccountDto, storeId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ShippoAccountResponseDto>> {
2082
+ return StoresApiFp(this.configuration).createShippoAccount(body, storeId, options).then((request) => request(this.axios, this.basePath));
2083
+ }
1605
2084
  /**
1606
2085
  *
1607
2086
  * @summary Create a new store
@@ -1656,6 +2135,17 @@ export class StoresApi extends BaseAPI {
1656
2135
  public async getAllStores(options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<StoreEntity>>> {
1657
2136
  return StoresApiFp(this.configuration).getAllStores(options).then((request) => request(this.axios, this.basePath));
1658
2137
  }
2138
+ /**
2139
+ *
2140
+ * @summary Get store API keys with masked values
2141
+ * @param {string} storeId
2142
+ * @param {*} [options] Override http request option.
2143
+ * @throws {RequiredError}
2144
+ * @memberof StoresApi
2145
+ */
2146
+ public async getApiKeys(storeId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<StoreApiKeysResponseDto>> {
2147
+ return StoresApiFp(this.configuration).getApiKeys(storeId, options).then((request) => request(this.axios, this.basePath));
2148
+ }
1659
2149
  /**
1660
2150
  *
1661
2151
  * @summary Get refill requests by store id
@@ -1667,6 +2157,17 @@ export class StoresApi extends BaseAPI {
1667
2157
  public async getRefillRequests(storeId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<RefillRequest>>> {
1668
2158
  return StoresApiFp(this.configuration).getRefillRequests(storeId, options).then((request) => request(this.axios, this.basePath));
1669
2159
  }
2160
+ /**
2161
+ *
2162
+ * @summary Check if store has a Shippo platform account
2163
+ * @param {string} storeId
2164
+ * @param {*} [options] Override http request option.
2165
+ * @throws {RequiredError}
2166
+ * @memberof StoresApi
2167
+ */
2168
+ public async getShippoAccount(storeId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
2169
+ return StoresApiFp(this.configuration).getShippoAccount(storeId, options).then((request) => request(this.axios, this.basePath));
2170
+ }
1670
2171
  /**
1671
2172
  *
1672
2173
  * @summary Get store by id
@@ -1678,6 +2179,17 @@ export class StoresApi extends BaseAPI {
1678
2179
  public async getStoreById(storeId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<StoreEntity>> {
1679
2180
  return StoresApiFp(this.configuration).getStoreById(storeId, options).then((request) => request(this.axios, this.basePath));
1680
2181
  }
2182
+ /**
2183
+ *
2184
+ * @summary Get store capabilities (payment/delivery options available)
2185
+ * @param {string} storeId
2186
+ * @param {*} [options] Override http request option.
2187
+ * @throws {RequiredError}
2188
+ * @memberof StoresApi
2189
+ */
2190
+ public async getStoreCapabilities(storeId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<StoreCapabilitiesDto>> {
2191
+ return StoresApiFp(this.configuration).getStoreCapabilities(storeId, options).then((request) => request(this.axios, this.basePath));
2192
+ }
1681
2193
  /**
1682
2194
  *
1683
2195
  * @summary Get transfere patients requests by store id
@@ -1689,6 +2201,18 @@ export class StoresApi extends BaseAPI {
1689
2201
  public async getTransferePatientsRequests(storeId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<TransferePatientRequest>>> {
1690
2202
  return StoresApiFp(this.configuration).getTransferePatientsRequests(storeId, options).then((request) => request(this.axios, this.basePath));
1691
2203
  }
2204
+ /**
2205
+ *
2206
+ * @summary Revoke/delete a specific API key
2207
+ * @param {string} storeId
2208
+ * @param {string} keyType Type of key to revoke
2209
+ * @param {*} [options] Override http request option.
2210
+ * @throws {RequiredError}
2211
+ * @memberof StoresApi
2212
+ */
2213
+ public async revokeApiKey(storeId: string, keyType: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
2214
+ return StoresApiFp(this.configuration).revokeApiKey(storeId, keyType, options).then((request) => request(this.axios, this.basePath));
2215
+ }
1692
2216
  /**
1693
2217
  *
1694
2218
  * @param {*} [options] Override http request option.
@@ -1794,6 +2318,18 @@ export class StoresApi extends BaseAPI {
1794
2318
  public async sendScheduleTourEmail(body: ScheduleTourEmailDto, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
1795
2319
  return StoresApiFp(this.configuration).sendScheduleTourEmail(body, options).then((request) => request(this.axios, this.basePath));
1796
2320
  }
2321
+ /**
2322
+ *
2323
+ * @summary Update store API keys (Stripe/Shippo)
2324
+ * @param {UpdateApiKeysDto} body
2325
+ * @param {string} storeId
2326
+ * @param {*} [options] Override http request option.
2327
+ * @throws {RequiredError}
2328
+ * @memberof StoresApi
2329
+ */
2330
+ public async updateApiKeys(body: UpdateApiKeysDto, storeId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<StoreApiKeysResponseDto>> {
2331
+ return StoresApiFp(this.configuration).updateApiKeys(body, storeId, options).then((request) => request(this.axios, this.basePath));
2332
+ }
1797
2333
  /**
1798
2334
  *
1799
2335
  * @summary Update refill request by id