@timardex/cluemart-shared 1.2.7 → 1.2.9

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 (46) hide show
  1. package/dist/{auth-Dcif6SZD.d.mts → ad-BdkvVgTG.d.mts} +2 -51
  2. package/dist/{auth-BS0Z8xN3.d.ts → ad-CaHFwLDq.d.ts} +2 -51
  3. package/dist/auth-Bdbu0AYI.d.ts +45 -0
  4. package/dist/auth-DEMvXVbh.d.mts +45 -0
  5. package/dist/{chunk-JUZHLSQK.mjs → chunk-NLDCBJIQ.mjs} +2 -2
  6. package/dist/{chunk-4RWXISXJ.mjs → chunk-U6WFPNBJ.mjs} +8 -8
  7. package/dist/{chunk-4RWXISXJ.mjs.map → chunk-U6WFPNBJ.mjs.map} +1 -1
  8. package/dist/enums/index.cjs +7 -7
  9. package/dist/enums/index.cjs.map +1 -1
  10. package/dist/enums/index.d.mts +7 -7
  11. package/dist/enums/index.d.ts +7 -7
  12. package/dist/enums/index.mjs +1 -1
  13. package/dist/formFields/index.cjs.map +1 -1
  14. package/dist/formFields/index.d.mts +1 -1
  15. package/dist/formFields/index.d.ts +1 -1
  16. package/dist/formFields/index.mjs +2 -2
  17. package/dist/{global-CNiNcYkF.d.mts → global-BT5qyeKd.d.mts} +27 -11
  18. package/dist/{global-Clh5l5eo.d.ts → global-BvXtqVsE.d.ts} +27 -11
  19. package/dist/graphql/index.cjs +65 -24
  20. package/dist/graphql/index.cjs.map +1 -1
  21. package/dist/graphql/index.d.mts +2 -2
  22. package/dist/graphql/index.d.ts +2 -2
  23. package/dist/graphql/index.mjs +66 -25
  24. package/dist/graphql/index.mjs.map +1 -1
  25. package/dist/hooks/index.cjs +47 -72
  26. package/dist/hooks/index.cjs.map +1 -1
  27. package/dist/hooks/index.d.mts +3 -3
  28. package/dist/hooks/index.d.ts +3 -3
  29. package/dist/hooks/index.mjs +42 -67
  30. package/dist/hooks/index.mjs.map +1 -1
  31. package/dist/index.cjs +112 -96
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.mts +32 -32
  34. package/dist/index.d.ts +32 -32
  35. package/dist/index.mjs +112 -96
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/types/index.d.mts +3 -3
  38. package/dist/types/index.d.ts +3 -3
  39. package/dist/utils/index.cjs.map +1 -1
  40. package/dist/utils/index.d.mts +1 -1
  41. package/dist/utils/index.d.ts +1 -1
  42. package/dist/utils/index.mjs +2 -2
  43. package/package.json +1 -1
  44. package/dist/contactUs-BTRh2D7-.d.mts +0 -11
  45. package/dist/contactUs-OR-5Mkkg.d.ts +0 -11
  46. /package/dist/{chunk-JUZHLSQK.mjs.map → chunk-NLDCBJIQ.mjs.map} +0 -0
@@ -8,7 +8,7 @@ import {
8
8
  dateFormat,
9
9
  normalizeUrl,
10
10
  timeFormat
11
- } from "../chunk-JUZHLSQK.mjs";
11
+ } from "../chunk-NLDCBJIQ.mjs";
12
12
  import {
13
13
  EnumEventType,
14
14
  EnumFoodFlavor,
@@ -19,7 +19,7 @@ import {
19
19
  EnumUserLicence,
20
20
  EnumUserRole,
21
21
  EnumVendorType
22
- } from "../chunk-4RWXISXJ.mjs";
22
+ } from "../chunk-U6WFPNBJ.mjs";
23
23
 
24
24
  // src/hooks/useLocationSearch.ts
25
25
  var handleApiError = (error, message) => {
@@ -124,6 +124,33 @@ var noLeadingZeros = (fieldName, options = {}) => {
124
124
  };
125
125
  dayjs.extend(isSameOrAfter);
126
126
  dayjs.extend(customParseFormat);
127
+ var emailRequiredSchema = yup.string().email("Invalid email address").required("Email is required").label("Email").transform(
128
+ (value) => typeof value === "string" ? value.trim().toLowerCase() : value
129
+ );
130
+ var emailOptionalSchema = yup.string().nullable().notRequired().transform(
131
+ (value) => typeof value === "string" ? value.trim().toLowerCase() : value
132
+ ).test(
133
+ "is-valid-email",
134
+ "Invalid email address",
135
+ (value) => !value || yup.string().email().isValidSync(value)
136
+ ).label("Email");
137
+ var mobileRegex = /^02\d{7,9}$/;
138
+ var landlineRegex = /^(0(3|4|6|7|9)[0-9]{7})$/;
139
+ var contactDetailsSchema = yup.object({
140
+ email: emailOptionalSchema,
141
+ mobilePhone: yup.string().label("Mobile Phone").nullable().notRequired().test(
142
+ "mobile-phone",
143
+ "Mobile must start with 02 and be 9\u201311 digits",
144
+ (value) => !value || mobileRegex.test(value)
145
+ // skip empty values
146
+ ),
147
+ landlinePhone: yup.string().label("Landline Phone").nullable().notRequired().test(
148
+ "landline-phone",
149
+ "Landline must start with 03, 04, 06, 07, or 09 (not 090) and have 7 digits after area code",
150
+ (value) => !value || landlineRegex.test(value)
151
+ // skip empty values
152
+ )
153
+ }).nullable().optional().label("Contact Details");
127
154
  var endDateNotInPastTest = yup.string().test("not-in-past", "End date cannot be in the past", (value) => {
128
155
  const now = dayjs();
129
156
  return value ? dayjs(value, dateFormat, true).isSameOrAfter(now, "day") : false;
@@ -219,16 +246,6 @@ var locationSchema = yup.object().shape({
219
246
  region: yup.string().label("Region").required("Region is required"),
220
247
  type: yup.string().oneOf(["Point"], "Type must be 'Point'").default("Point").required("Type is required")
221
248
  });
222
- var emailRequiredSchema = yup.string().email("Invalid email address").required("Email is required").label("Email").transform(
223
- (value) => typeof value === "string" ? value.trim().toLowerCase() : value
224
- );
225
- var emailOptionalSchema = yup.string().nullable().notRequired().transform(
226
- (value) => typeof value === "string" ? value.trim().toLowerCase() : value
227
- ).test(
228
- "is-valid-email",
229
- "Invalid email address",
230
- (value) => !value || yup.string().email().isValidSync(value)
231
- ).label("Email");
232
249
  var passwordSchema = yup.string().trim().label("Password").min(8, "Password must be at least 8 characters long").required("Password is required");
233
250
  var socialMediaSchema = yup.object({
234
251
  name: yup.mixed().oneOf(Object.values(EnumSocialMedia)).label("Social Media Name").optional(),
@@ -245,6 +262,7 @@ var globalResourceSchema = yup.object().shape({
245
262
  source: yup.string().label("Cover").required("Cover is required"),
246
263
  title: yup.string().label("Cover Title").required("Cover is required")
247
264
  }),
265
+ contactDetails: contactDetailsSchema,
248
266
  description: yup.string().label("Description").trim().min(3).required("Description is required"),
249
267
  name: yup.string().label("Name").trim().min(3).max(40).required("Name is required"),
250
268
  region: yup.string().label("Region").required("Region is required"),
@@ -276,23 +294,6 @@ var categorySchema = yup.array().of(
276
294
  ).min(1, "At least one subcategory is required").required("Subcategories are required")
277
295
  })
278
296
  );
279
- var mobileRegex = /^02\d{7,9}$/;
280
- var landlineRegex = /^(0(3|4|6|7|9)[0-9]{7})$/;
281
- var contactDetailsSchema = yup.object({
282
- email: emailOptionalSchema,
283
- mobilePhone: yup.string().label("Mobile Phone").nullable().notRequired().test(
284
- "mobile-phone",
285
- "Mobile must start with 02 and be 9\u201311 digits",
286
- (value) => !value || mobileRegex.test(value)
287
- // skip empty values
288
- ),
289
- landlinePhone: yup.string().label("Landline Phone").nullable().notRequired().test(
290
- "landline-phone",
291
- "Landline must start with 03, 04, 06, 07, or 09 (not 090) and have 7 digits after area code",
292
- (value) => !value || landlineRegex.test(value)
293
- // skip empty values
294
- )
295
- }).nullable().optional().label("Contact Details");
296
297
 
297
298
  // src/yupSchema/event.ts
298
299
  import * as yup2 from "yup";
@@ -343,7 +344,6 @@ var paymentInfoSchema = yup2.object({
343
344
  })
344
345
  });
345
346
  var eventInfoSchema = yup2.object().shape({
346
- contactDetails: contactDetailsSchema,
347
347
  applicationDeadlineHours: yup2.number().label("Application Deadline Hours").nullable().transform((value, originalValue) => originalValue === "" ? null : value).typeError("Application deadline hours must be a number").min(1, "Application deadline hours must be at least 1").required("Application deadline hours is required").test("no-leading-zeros", "", noLeadingZeros("Application deadline hours")),
348
348
  dateTime: yup2.array().of(dateTimeWithPriceSchema).required("DateTime is required"),
349
349
  eventId: yup2.string().trim().required("Event ID is required"),
@@ -374,7 +374,6 @@ var vendorSchema = globalResourceSchema.shape({
374
374
  vendorType: yup3.mixed().oneOf(Object.values(EnumVendorType)).required("Please select a Vendor type")
375
375
  });
376
376
  var vendorInfoSchema = yup3.object().shape({
377
- contactDetails: contactDetailsSchema,
378
377
  product: yup3.object().shape({
379
378
  foodFlavors: yup3.array().of(
380
379
  yup3.mixed().oneOf(Object.values(EnumFoodFlavor), "Invalid flavor selected").required("Flavor is required")
@@ -531,6 +530,11 @@ var adSchema = yup7.object().shape({
531
530
  // src/hooks/utils.ts
532
531
  var globalDefaultValues = {
533
532
  active: false,
533
+ contactDetails: {
534
+ email: null,
535
+ landlinePhone: null,
536
+ mobilePhone: null
537
+ },
534
538
  cover: {
535
539
  source: "",
536
540
  title: ""
@@ -552,15 +556,8 @@ var globalDefaultValues = {
552
556
  };
553
557
  var defaultEventFormValues = {
554
558
  ...globalDefaultValues,
555
- dateTime: [
556
- {
557
- endDate: "",
558
- endTime: "",
559
- startDate: "",
560
- startTime: ""
561
- }
562
- ],
563
- eventType: "market" /* MARKET */,
559
+ dateTime: [],
560
+ eventType: "Market" /* MARKET */,
564
561
  location: {
565
562
  city: "",
566
563
  coordinates: [0, 0],
@@ -580,20 +577,7 @@ var defaultEventFormValues = {
580
577
  };
581
578
  var defaultEventInfoFormValues = {
582
579
  applicationDeadlineHours: 24,
583
- contactDetails: {
584
- email: null,
585
- landlinePhone: null,
586
- mobilePhone: null
587
- },
588
- dateTime: [
589
- {
590
- endDate: "",
591
- endTime: "",
592
- stallTypes: [],
593
- startDate: "",
594
- startTime: ""
595
- }
596
- ],
580
+ dateTime: [],
597
581
  eventId: "",
598
582
  packInTime: 2,
599
583
  // e.g., 2 hours before event opens
@@ -612,15 +596,10 @@ var defaultVendorFormValues = {
612
596
  locations: null,
613
597
  multiLocation: false,
614
598
  products: null,
615
- vendorType: "stallholder" /* STALLHOLDER */
599
+ vendorType: "Stallholder" /* STALLHOLDER */
616
600
  };
617
601
  var defaultVendorInfoFormValues = {
618
602
  compliance: { foodBeverageLicense: false, liabilityInsurance: false },
619
- contactDetails: {
620
- email: null,
621
- landlinePhone: null,
622
- mobilePhone: null
623
- },
624
603
  documents: null,
625
604
  documentsUpload: null,
626
605
  product: {
@@ -643,6 +622,7 @@ function mapBaseResourceTypeToFormData(data) {
643
622
  return {
644
623
  _id: data._id,
645
624
  active: data.active,
625
+ contactDetails: data.contactDetails,
646
626
  cover: data.cover,
647
627
  coverUpload: data.coverUpload,
648
628
  description: data.description,
@@ -655,7 +635,8 @@ function mapBaseResourceTypeToFormData(data) {
655
635
  partners: data.partners,
656
636
  promoCodes: data.promoCodes,
657
637
  region: data.region,
658
- socialMedia: data.socialMedia
638
+ socialMedia: data.socialMedia,
639
+ termsAgreement: data.termsAgreement
659
640
  };
660
641
  }
661
642
 
@@ -766,7 +747,6 @@ function useVendorInfoForm(data) {
766
747
  reset({
767
748
  _id: data._id,
768
749
  compliance: data.compliance,
769
- contactDetails: data.contactDetails,
770
750
  documents: data.documents,
771
751
  documentsUpload: data.documentsUpload,
772
752
  product: data.product,
@@ -781,7 +761,6 @@ function useVendorInfoForm(data) {
781
761
  const {
782
762
  _id,
783
763
  compliance,
784
- contactDetails,
785
764
  documents,
786
765
  documentsUpload,
787
766
  product,
@@ -794,7 +773,6 @@ function useVendorInfoForm(data) {
794
773
  fields: {
795
774
  _id,
796
775
  compliance,
797
- contactDetails,
798
776
  documents,
799
777
  documentsUpload,
800
778
  product,
@@ -923,7 +901,6 @@ function useEventInfoForm(data) {
923
901
  reset({
924
902
  _id: data._id,
925
903
  applicationDeadlineHours: data.applicationDeadlineHours,
926
- contactDetails: data.contactDetails,
927
904
  dateTime: data.dateTime,
928
905
  eventId: data.eventId,
929
906
  packInTime: data.packInTime,
@@ -938,7 +915,6 @@ function useEventInfoForm(data) {
938
915
  const {
939
916
  _id,
940
917
  applicationDeadlineHours,
941
- contactDetails,
942
918
  dateTime,
943
919
  eventId,
944
920
  packInTime,
@@ -951,7 +927,6 @@ function useEventInfoForm(data) {
951
927
  fields: {
952
928
  _id,
953
929
  applicationDeadlineHours,
954
- contactDetails,
955
930
  dateTime,
956
931
  eventId,
957
932
  packInTime,