@timardex/cluemart-shared 1.2.49 → 1.2.51

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 (53) hide show
  1. package/dist/{ad-DPP5n_ZS.d.mts → ad-C98yzFdy.d.mts} +19 -6
  2. package/dist/{ad-BBJMdfCl.d.ts → ad-CPL59gj7.d.ts} +19 -6
  3. package/dist/{auth-CQPRj4DB.d.mts → auth-D636FFnJ.d.mts} +1 -1
  4. package/dist/{auth-OLWCR6Zr.d.ts → auth-D6Rg-cEc.d.ts} +1 -1
  5. package/dist/{chunk-HFYQRL77.mjs → chunk-IRQ365TO.mjs} +2 -2
  6. package/dist/{chunk-XXZPSRMS.mjs → chunk-N625BZKR.mjs} +3 -2
  7. package/dist/chunk-N625BZKR.mjs.map +1 -0
  8. package/dist/{chunk-WNRV4DSZ.mjs → chunk-V3BTJQHJ.mjs} +11 -4
  9. package/dist/chunk-V3BTJQHJ.mjs.map +1 -0
  10. package/dist/enums/index.cjs +11 -3
  11. package/dist/enums/index.cjs.map +1 -1
  12. package/dist/enums/index.d.mts +11 -6
  13. package/dist/enums/index.d.ts +11 -6
  14. package/dist/enums/index.mjs +3 -1
  15. package/dist/formFields/index.cjs +94 -82
  16. package/dist/formFields/index.cjs.map +1 -1
  17. package/dist/formFields/index.d.mts +4 -3
  18. package/dist/formFields/index.d.ts +4 -3
  19. package/dist/formFields/index.mjs +24 -10
  20. package/dist/formFields/index.mjs.map +1 -1
  21. package/dist/{global-qg1lwtYo.d.mts → global-Czf4z7aN.d.mts} +3 -3
  22. package/dist/{global-Be5v6emI.d.ts → global-dQyePynY.d.ts} +3 -3
  23. package/dist/graphql/index.cjs +393 -189
  24. package/dist/graphql/index.cjs.map +1 -1
  25. package/dist/graphql/index.d.mts +44 -3
  26. package/dist/graphql/index.d.ts +44 -3
  27. package/dist/graphql/index.mjs +292 -95
  28. package/dist/graphql/index.mjs.map +1 -1
  29. package/dist/hooks/index.cjs +135 -28
  30. package/dist/hooks/index.cjs.map +1 -1
  31. package/dist/hooks/index.d.mts +13 -4
  32. package/dist/hooks/index.d.ts +13 -4
  33. package/dist/hooks/index.mjs +128 -29
  34. package/dist/hooks/index.mjs.map +1 -1
  35. package/dist/index.cjs +688 -361
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.d.mts +81 -12
  38. package/dist/index.d.ts +81 -12
  39. package/dist/index.mjs +562 -245
  40. package/dist/index.mjs.map +1 -1
  41. package/dist/types/index.cjs +2 -1
  42. package/dist/types/index.cjs.map +1 -1
  43. package/dist/types/index.d.mts +3 -3
  44. package/dist/types/index.d.ts +3 -3
  45. package/dist/types/index.mjs +1 -1
  46. package/dist/utils/index.cjs.map +1 -1
  47. package/dist/utils/index.d.mts +1 -1
  48. package/dist/utils/index.d.ts +1 -1
  49. package/dist/utils/index.mjs +2 -2
  50. package/package.json +1 -1
  51. package/dist/chunk-WNRV4DSZ.mjs.map +0 -1
  52. package/dist/chunk-XXZPSRMS.mjs.map +0 -1
  53. /package/dist/{chunk-HFYQRL77.mjs.map → chunk-IRQ365TO.mjs.map} +0 -0
@@ -32,6 +32,7 @@ var hooks_exports = {};
32
32
  __export(hooks_exports, {
33
33
  defaultEventFormValues: () => defaultEventFormValues,
34
34
  defaultEventInfoFormValues: () => defaultEventInfoFormValues,
35
+ defaultPartnerFormValues: () => defaultPartnerFormValues,
35
36
  defaultVendorFormValues: () => defaultVendorFormValues,
36
37
  defaultVendorInfoFormValues: () => defaultVendorInfoFormValues,
37
38
  globalDefaultValues: () => globalDefaultValues,
@@ -42,6 +43,7 @@ __export(hooks_exports, {
42
43
  useEventInfoForm: () => useEventInfoForm,
43
44
  useLocationSearch: () => useLocationSearch,
44
45
  useLoginForm: () => useLoginForm,
46
+ usePartnerForm: () => usePartnerForm,
45
47
  useRegisterForm: () => useRegisterForm,
46
48
  useRequestPasswordResetForm: () => useRequestPasswordResetForm,
47
49
  useResetPasswordForm: () => useResetPasswordForm,
@@ -169,6 +171,7 @@ var EnumFoodFlavor = /* @__PURE__ */ ((EnumFoodFlavor3) => {
169
171
  var EnumResourceType = /* @__PURE__ */ ((EnumResourceType2) => {
170
172
  EnumResourceType2["EVENT"] = "event";
171
173
  EnumResourceType2["VENDOR"] = "vendor";
174
+ EnumResourceType2["PARTNER"] = "partner";
172
175
  return EnumResourceType2;
173
176
  })(EnumResourceType || {});
174
177
  var EnumEventType = /* @__PURE__ */ ((EnumEventType2) => {
@@ -181,9 +184,14 @@ var EnumEventType = /* @__PURE__ */ ((EnumEventType2) => {
181
184
  var EnumVendorType = /* @__PURE__ */ ((EnumVendorType2) => {
182
185
  EnumVendorType2["STALLHOLDER"] = "Stallholder";
183
186
  EnumVendorType2["SHOP"] = "Shop";
184
- EnumVendorType2["CHARITY"] = "Charity";
185
187
  return EnumVendorType2;
186
188
  })(EnumVendorType || {});
189
+ var EnumPartnerType = /* @__PURE__ */ ((EnumPartnerType2) => {
190
+ EnumPartnerType2["CHARITY_PARTNER"] = "Charity_Partner";
191
+ EnumPartnerType2["MEDIA_PARTNER"] = "Media_Partner";
192
+ EnumPartnerType2["SUPPORTING_PARTNER"] = "Supporting_Partner";
193
+ return EnumPartnerType2;
194
+ })(EnumPartnerType || {});
187
195
  var EnumOSPlatform = /* @__PURE__ */ ((EnumOSPlatform2) => {
188
196
  EnumOSPlatform2["ANDROID"] = "android";
189
197
  EnumOSPlatform2["IOS"] = "ios";
@@ -282,6 +290,8 @@ function normalizeUrl(url) {
282
290
  }
283
291
 
284
292
  // src/yupSchema/global.ts
293
+ var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
294
+ var nzbnRegex = /^94\d{11}$/;
285
295
  var normalizedUrlTransform = () => yup.string().trim().transform(
286
296
  (value) => typeof value === "string" ? value.toLowerCase() : value
287
297
  ).transform(
@@ -445,7 +455,7 @@ var globalResourceSchema = yup.object().shape({
445
455
  name: yup.string().label("Name").trim().min(3).max(40).required("Name is required"),
446
456
  region: yup.string().label("Region").required("Region is required"),
447
457
  socialMedia: yup.array().of(socialMediaSchema).nullable().optional(),
448
- partners: yup.array().of(
458
+ associates: yup.array().of(
449
459
  yup.object().shape({
450
460
  email: emailRequiredSchema,
451
461
  resourceId: yup.string().required(),
@@ -475,8 +485,6 @@ var categorySchema = yup.array().of(
475
485
 
476
486
  // src/yupSchema/event.ts
477
487
  var yup2 = __toESM(require("yup"));
478
- var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
479
- var nzbnRegex = /^94\d{11}$/;
480
488
  var eventSchema = globalResourceSchema.shape({
481
489
  dateTime: yup2.array().of(dateTimeSchema).min(1, "At least one Event date required").max(50, "You can only add up to 50 Event dates").required("DateTime is required").test(
482
490
  "unique-start-date-time",
@@ -668,8 +676,9 @@ var yup7 = __toESM(require("yup"));
668
676
 
669
677
  // src/types/ad.ts
670
678
  var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
671
- EnumAdShowOn2["FRONT_PAGE"] = "Front_page";
672
679
  EnumAdShowOn2["EVENTS_PAGE"] = "Events_page";
680
+ EnumAdShowOn2["FRONT_PAGE"] = "Front_page";
681
+ EnumAdShowOn2["PARTNERS_PAGE"] = "Partners_page";
673
682
  EnumAdShowOn2["VENDORS_PAGE"] = "Vendors_page";
674
683
  return EnumAdShowOn2;
675
684
  })(EnumAdShowOn || {});
@@ -737,9 +746,30 @@ var adSchema = yup7.object().shape({
737
746
  targetRegion: yup7.string().nullable().notRequired()
738
747
  });
739
748
 
749
+ // src/yupSchema/partner.ts
750
+ var yup8 = __toESM(require("yup"));
751
+ var partnerSchema = globalResourceSchema.shape({
752
+ location: locationSchema,
753
+ nzbn: yup8.string().required("NZBN is required").matches(nzbnRegex, "NZBN must be 13 digits and start with 94"),
754
+ partnerType: yup8.mixed().oneOf(Object.values(EnumPartnerType)).required("Please select a Partner type")
755
+ });
756
+
740
757
  // src/hooks/utils.ts
758
+ var defaultLocation = {
759
+ city: "",
760
+ coordinates: [0, 0],
761
+ // [longitude, latitude]
762
+ country: "",
763
+ fullAddress: "",
764
+ latitude: 0,
765
+ longitude: 0,
766
+ region: "",
767
+ type: "Point"
768
+ // Default type for GeoJSON
769
+ };
741
770
  var globalDefaultValues = {
742
771
  active: false,
772
+ associates: null,
743
773
  contactDetails: {
744
774
  email: null,
745
775
  landlinePhone: null,
@@ -759,27 +789,21 @@ var globalDefaultValues = {
759
789
  logo: null,
760
790
  logoUpload: null,
761
791
  name: "",
762
- partners: null,
763
792
  promoCodes: [],
764
793
  region: "",
765
794
  socialMedia: []
766
795
  };
796
+ var defaultPartnerFormValues = {
797
+ ...globalDefaultValues,
798
+ location: defaultLocation,
799
+ nzbn: "",
800
+ partnerType: "Charity_Partner" /* CHARITY_PARTNER */
801
+ };
767
802
  var defaultEventFormValues = {
768
803
  ...globalDefaultValues,
769
804
  dateTime: [],
770
805
  eventType: "Market" /* MARKET */,
771
- location: {
772
- city: "",
773
- coordinates: [0, 0],
774
- // [longitude, latitude]
775
- country: "",
776
- fullAddress: "",
777
- latitude: 0,
778
- longitude: 0,
779
- region: "",
780
- type: "Point"
781
- // Default type for GeoJSON
782
- },
806
+ location: defaultLocation,
783
807
  nzbn: "",
784
808
  provider: null,
785
809
  rainOrShine: false,
@@ -832,6 +856,7 @@ function mapBaseResourceTypeToFormData(data) {
832
856
  return {
833
857
  _id: data._id,
834
858
  active: data.active,
859
+ associates: data.associates,
835
860
  contactDetails: data.contactDetails,
836
861
  cover: data.cover,
837
862
  coverUpload: data.coverUpload,
@@ -842,7 +867,6 @@ function mapBaseResourceTypeToFormData(data) {
842
867
  logoUpload: data.logoUpload,
843
868
  name: data.name,
844
869
  owner: data.owner,
845
- partners: data.partners,
846
870
  promoCodes: data.promoCodes,
847
871
  region: data.region,
848
872
  socialMedia: data.socialMedia,
@@ -882,6 +906,7 @@ function useVendorForm(data) {
882
906
  const {
883
907
  _id,
884
908
  active,
909
+ associates,
885
910
  availability,
886
911
  categories,
887
912
  cover,
@@ -895,7 +920,6 @@ function useVendorForm(data) {
895
920
  multiLocation,
896
921
  name,
897
922
  owner,
898
- partners,
899
923
  products,
900
924
  promoCodes,
901
925
  region,
@@ -908,6 +932,7 @@ function useVendorForm(data) {
908
932
  fields: {
909
933
  _id,
910
934
  active,
935
+ associates,
911
936
  availability,
912
937
  categories,
913
938
  cover,
@@ -921,7 +946,6 @@ function useVendorForm(data) {
921
946
  multiLocation,
922
947
  name,
923
948
  owner,
924
- partners,
925
949
  products,
926
950
  promoCodes,
927
951
  region,
@@ -1036,6 +1060,7 @@ function useEventForm(data) {
1036
1060
  const {
1037
1061
  _id,
1038
1062
  active,
1063
+ associates,
1039
1064
  cover,
1040
1065
  coverUpload,
1041
1066
  dateTime,
@@ -1049,7 +1074,6 @@ function useEventForm(data) {
1049
1074
  name,
1050
1075
  nzbn,
1051
1076
  owner,
1052
- partners,
1053
1077
  promoCodes,
1054
1078
  provider,
1055
1079
  rainOrShine,
@@ -1063,6 +1087,7 @@ function useEventForm(data) {
1063
1087
  fields: {
1064
1088
  _id,
1065
1089
  active,
1090
+ associates,
1066
1091
  cover,
1067
1092
  coverUpload,
1068
1093
  dateTime,
@@ -1076,7 +1101,6 @@ function useEventForm(data) {
1076
1101
  name,
1077
1102
  nzbn,
1078
1103
  owner,
1079
- partners,
1080
1104
  promoCodes,
1081
1105
  provider,
1082
1106
  rainOrShine,
@@ -1504,12 +1528,12 @@ var import_react2 = __toESM(require("react"));
1504
1528
  var import_react_hook_form12 = require("react-hook-form");
1505
1529
 
1506
1530
  // src/yupSchema/contactUs.ts
1507
- var yup8 = __toESM(require("yup"));
1508
- var contactUsSchema = yup8.object().shape({
1531
+ var yup9 = __toESM(require("yup"));
1532
+ var contactUsSchema = yup9.object().shape({
1509
1533
  email: emailRequiredSchema,
1510
- firstName: yup8.string().label("First Name").required("First name is required"),
1511
- lastName: yup8.string().label("Last Name").required("Last name is required"),
1512
- message: yup8.string().label("Message").required("Message is required")
1534
+ firstName: yup9.string().label("First Name").required("First name is required"),
1535
+ lastName: yup9.string().label("Last Name").required("Last name is required"),
1536
+ message: yup9.string().label("Message").required("Message is required")
1513
1537
  });
1514
1538
 
1515
1539
  // src/hooks/useContactUsForm.ts
@@ -1673,10 +1697,92 @@ function useAdForm(data) {
1673
1697
  watch
1674
1698
  };
1675
1699
  }
1700
+
1701
+ // src/hooks/partner/usePartnerForm.ts
1702
+ var import_yup14 = require("@hookform/resolvers/yup");
1703
+ var React9 = __toESM(require("react"));
1704
+ var import_react_hook_form14 = require("react-hook-form");
1705
+ function usePartnerForm(data) {
1706
+ const {
1707
+ control,
1708
+ formState: { errors },
1709
+ getValues,
1710
+ handleSubmit,
1711
+ reset,
1712
+ setValue,
1713
+ watch
1714
+ } = (0, import_react_hook_form14.useForm)({
1715
+ defaultValues: defaultPartnerFormValues,
1716
+ resolver: (0, import_yup14.yupResolver)(partnerSchema)
1717
+ });
1718
+ React9.useEffect(() => {
1719
+ if (data) {
1720
+ reset({
1721
+ ...mapBaseResourceTypeToFormData(data),
1722
+ location: data.location,
1723
+ nzbn: data.nzbn,
1724
+ partnerType: data.partnerType
1725
+ });
1726
+ } else {
1727
+ reset(defaultPartnerFormValues);
1728
+ }
1729
+ }, [data]);
1730
+ const {
1731
+ _id,
1732
+ active,
1733
+ associates,
1734
+ cover,
1735
+ coverUpload,
1736
+ description,
1737
+ images,
1738
+ imagesUpload,
1739
+ location,
1740
+ logo,
1741
+ logoUpload,
1742
+ name,
1743
+ nzbn,
1744
+ owner,
1745
+ partnerType,
1746
+ promoCodes,
1747
+ region,
1748
+ socialMedia,
1749
+ termsAgreement
1750
+ } = getValues();
1751
+ return {
1752
+ control,
1753
+ fields: {
1754
+ _id,
1755
+ active,
1756
+ associates,
1757
+ cover,
1758
+ coverUpload,
1759
+ description,
1760
+ images,
1761
+ imagesUpload,
1762
+ location,
1763
+ logo,
1764
+ logoUpload,
1765
+ name,
1766
+ nzbn,
1767
+ owner,
1768
+ partnerType,
1769
+ promoCodes,
1770
+ region,
1771
+ socialMedia,
1772
+ termsAgreement
1773
+ },
1774
+ formState: { errors },
1775
+ handleSubmit,
1776
+ reset,
1777
+ setValue,
1778
+ watch
1779
+ };
1780
+ }
1676
1781
  // Annotate the CommonJS export names for ESM import in node:
1677
1782
  0 && (module.exports = {
1678
1783
  defaultEventFormValues,
1679
1784
  defaultEventInfoFormValues,
1785
+ defaultPartnerFormValues,
1680
1786
  defaultVendorFormValues,
1681
1787
  defaultVendorInfoFormValues,
1682
1788
  globalDefaultValues,
@@ -1687,6 +1793,7 @@ function useAdForm(data) {
1687
1793
  useEventInfoForm,
1688
1794
  useLocationSearch,
1689
1795
  useLoginForm,
1796
+ usePartnerForm,
1690
1797
  useRegisterForm,
1691
1798
  useRequestPasswordResetForm,
1692
1799
  useResetPasswordForm,