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
@@ -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
  }