@timardex/cluemart-shared 1.1.78 → 1.1.80

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 (55) hide show
  1. package/dist/{ad-BoyPTKzO.d.mts → ad-5mNvL58V.d.mts} +4 -4
  2. package/dist/{ad-ByaFgKCJ.d.ts → ad-DrHJhh2M.d.ts} +4 -4
  3. package/dist/{auth-CsMldwsP.d.mts → auth-C0eE66vz.d.mts} +1 -1
  4. package/dist/{auth-CatvNkT_.d.ts → auth-Csul8lXc.d.ts} +1 -1
  5. package/dist/{chunk-ERBPRUAF.mjs → chunk-AXCOUPK2.mjs} +20 -12
  6. package/dist/chunk-AXCOUPK2.mjs.map +1 -0
  7. package/dist/{chunk-JZMSWUO5.mjs → chunk-CCBDLLRT.mjs} +2 -2
  8. package/dist/{chunk-JFIG6CV2.mjs → chunk-YOGSPGDV.mjs} +2 -2
  9. package/dist/chunk-YOGSPGDV.mjs.map +1 -0
  10. package/dist/enums/index.cjs +20 -11
  11. package/dist/enums/index.cjs.map +1 -1
  12. package/dist/enums/index.d.mts +18 -12
  13. package/dist/enums/index.d.ts +18 -12
  14. package/dist/enums/index.mjs +3 -1
  15. package/dist/formFields/index.cjs +26 -26
  16. package/dist/formFields/index.cjs.map +1 -1
  17. package/dist/formFields/index.d.mts +7 -7
  18. package/dist/formFields/index.d.ts +7 -7
  19. package/dist/formFields/index.mjs +23 -23
  20. package/dist/formFields/index.mjs.map +1 -1
  21. package/dist/{global-Dt-vAIF9.d.mts → global-2SIDtEJn.d.ts} +17 -15
  22. package/dist/{global-BsANkXhj.d.ts → global-CNtWgZW4.d.mts} +17 -15
  23. package/dist/graphql/index.cjs +251 -248
  24. package/dist/graphql/index.cjs.map +1 -1
  25. package/dist/graphql/index.d.mts +33 -33
  26. package/dist/graphql/index.d.ts +33 -33
  27. package/dist/graphql/index.mjs +238 -235
  28. package/dist/graphql/index.mjs.map +1 -1
  29. package/dist/hooks/index.cjs +48 -36
  30. package/dist/hooks/index.cjs.map +1 -1
  31. package/dist/hooks/index.d.mts +15 -15
  32. package/dist/hooks/index.d.ts +15 -15
  33. package/dist/hooks/index.mjs +39 -33
  34. package/dist/hooks/index.mjs.map +1 -1
  35. package/dist/index.cjs +337 -320
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.d.mts +82 -74
  38. package/dist/index.d.ts +82 -74
  39. package/dist/index.mjs +313 -297
  40. package/dist/index.mjs.map +1 -1
  41. package/dist/{resourceViews-ja9Qif1X.d.mts → resourceViews-COYpf0aX.d.mts} +2 -2
  42. package/dist/{resourceViews-C2CYUMC0.d.ts → resourceViews-DEKze3fc.d.ts} +2 -2
  43. package/dist/types/index.cjs +1 -1
  44. package/dist/types/index.cjs.map +1 -1
  45. package/dist/types/index.d.mts +4 -4
  46. package/dist/types/index.d.ts +4 -4
  47. package/dist/types/index.mjs +1 -1
  48. package/dist/utils/index.cjs.map +1 -1
  49. package/dist/utils/index.d.mts +1 -1
  50. package/dist/utils/index.d.ts +1 -1
  51. package/dist/utils/index.mjs +2 -2
  52. package/package.json +1 -1
  53. package/dist/chunk-ERBPRUAF.mjs.map +0 -1
  54. package/dist/chunk-JFIG6CV2.mjs.map +0 -1
  55. /package/dist/{chunk-JZMSWUO5.mjs.map → chunk-CCBDLLRT.mjs.map} +0 -0
@@ -1,6 +1,6 @@
1
- import { L as LocationType, g as StallholderFormData, h as CreateStallholderFormData, i as StallholderInfoFormData, j as CreateStallholderInfoFormData, k as MarketFormData, l as CreateMarketFormData, m as MarketInfoFormData, n as CreateMarketInfoFormData, B as BaseResourceTypeFormData } from '../global-BsANkXhj.js';
2
- import { a as UserFormData, C as CreateUserFormData, b as TestersFormData, c as CreateTestersFormData, d as AdFormData, e as CreateAdFormData } from '../ad-ByaFgKCJ.js';
3
- import { C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, c as CreateValidateVerificationTokenFormData, d as CreateResetPasswordFormData, e as ContactUsFormData, f as CreateContactUsFormData } from '../auth-CatvNkT_.js';
1
+ import { L as LocationType, g as StallholderFormData, h as CreateStallholderFormData, i as StallholderInfoFormData, j as CreateStallholderInfoFormData, k as EventFormData, l as CreateEventFormData, m as EventInfoFormData, n as CreateEventInfoFormData, B as BaseResourceTypeFormData } from '../global-2SIDtEJn.js';
2
+ import { a as UserFormData, C as CreateUserFormData, b as TestersFormData, c as CreateTestersFormData, d as AdFormData, e as CreateAdFormData } from '../ad-DrHJhh2M.js';
3
+ import { C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, c as CreateValidateVerificationTokenFormData, d as CreateResetPasswordFormData, e as ContactUsFormData, f as CreateContactUsFormData } from '../auth-Csul8lXc.js';
4
4
  import 'react-hook-form';
5
5
  import '../enums/index.js';
6
6
 
@@ -36,20 +36,20 @@ declare function useStallholderForm(data?: StallholderFormData): CreateStallhold
36
36
  declare function useStallholderInfoForm(data?: StallholderInfoFormData): CreateStallholderInfoFormData;
37
37
 
38
38
  /**
39
- * Custom hook to manage the market form state and validation.
39
+ * Custom hook to manage the event form state and validation.
40
40
  *
41
- * @param {MarketFormData} data - The initial form data.
42
- * @returns {CreateMarketFormData} - The form methods and state.
41
+ * @param {EventFormData} data - The initial form data.
42
+ * @returns {CreateEventFormData} - The form methods and state.
43
43
  */
44
- declare function useMarketForm(data?: MarketFormData): CreateMarketFormData;
44
+ declare function useEventForm(data?: EventFormData): CreateEventFormData;
45
45
 
46
46
  /**
47
- * Custom hook to manage the market form state and validation.
47
+ * Custom hook to manage the event form state and validation.
48
48
  *
49
- * @param {MarketInfoFormData} data - The initial form data.
50
- * @returns {CreateMarketInfoFormData} - The form methods and state.
49
+ * @param {EventInfoFormData} data - The initial form data.
50
+ * @returns {CreateEventInfoFormData} - The form methods and state.
51
51
  */
52
- declare function useMarketInfoForm(data?: MarketInfoFormData): CreateMarketInfoFormData;
52
+ declare function useEventInfoForm(data?: EventInfoFormData): CreateEventInfoFormData;
53
53
 
54
54
  /**
55
55
  * Custom hook to manage the user form state and validation.
@@ -80,11 +80,11 @@ declare function useValidateVerificationTokenForm(): CreateValidateVerificationT
80
80
  declare function useResetPasswordForm(): CreateResetPasswordFormData;
81
81
 
82
82
  declare const globalDefaultValues: BaseResourceTypeFormData;
83
- declare const defaultMarketFormValues: MarketFormData;
84
- declare const defaultMarketInfoFormValues: MarketInfoFormData;
83
+ declare const defaultEventFormValues: EventFormData;
84
+ declare const defaultEventInfoFormValues: EventInfoFormData;
85
85
  declare const defaultStallholderFormValues: StallholderFormData;
86
86
  declare const defaultStallholderInfoFormValues: StallholderInfoFormData;
87
- declare function mapBaseResourceTypeToFormData(data: MarketFormData | StallholderFormData): BaseResourceTypeFormData;
87
+ declare function mapBaseResourceTypeToFormData(data: EventFormData | StallholderFormData): BaseResourceTypeFormData;
88
88
 
89
89
  declare function useTestersForm(data?: TestersFormData): CreateTestersFormData;
90
90
 
@@ -92,4 +92,4 @@ declare function useContactUsForm(data?: ContactUsFormData): CreateContactUsForm
92
92
 
93
93
  declare function useAdForm(data?: AdFormData): CreateAdFormData;
94
94
 
95
- export { type PlacePrediction, defaultMarketFormValues, defaultMarketInfoFormValues, defaultStallholderFormValues, defaultStallholderInfoFormValues, globalDefaultValues, mapBaseResourceTypeToFormData, useAdForm, useContactUsForm, useLocationSearch, useLoginForm, useMarketForm, useMarketInfoForm, useRegisterForm, useRequestPasswordResetForm, useResetPasswordForm, useStallholderForm, useStallholderInfoForm, useTestersForm, useUserForm, useValidateVerificationTokenForm };
95
+ export { type PlacePrediction, defaultEventFormValues, defaultEventInfoFormValues, defaultStallholderFormValues, defaultStallholderInfoFormValues, globalDefaultValues, mapBaseResourceTypeToFormData, useAdForm, useContactUsForm, useEventForm, useEventInfoForm, useLocationSearch, useLoginForm, useRegisterForm, useRequestPasswordResetForm, useResetPasswordForm, useStallholderForm, useStallholderInfoForm, useTestersForm, useUserForm, useValidateVerificationTokenForm };
@@ -3,19 +3,20 @@ import {
3
3
  EnumAdStatus,
4
4
  EnumAdStyle,
5
5
  EnumAdType
6
- } from "../chunk-JFIG6CV2.mjs";
6
+ } from "../chunk-YOGSPGDV.mjs";
7
7
  import {
8
8
  dateFormat,
9
9
  normalizeUrl,
10
10
  timeFormat
11
- } from "../chunk-JZMSWUO5.mjs";
11
+ } from "../chunk-CCBDLLRT.mjs";
12
12
  import {
13
+ EnumEventType,
13
14
  EnumOSPlatform,
14
15
  EnumPaymentMethod,
15
16
  EnumResourceType,
16
17
  EnumSocialMedia,
17
18
  EnumUserRole
18
- } from "../chunk-ERBPRUAF.mjs";
19
+ } from "../chunk-AXCOUPK2.mjs";
19
20
 
20
21
  // src/hooks/useLocationSearch.ts
21
22
  var handleApiError = (error, message) => {
@@ -281,11 +282,11 @@ var contactDetailsSchema = yup.object({
281
282
  )
282
283
  }).nullable().optional().label("Contact Details");
283
284
 
284
- // src/yupSchema/market.ts
285
+ // src/yupSchema/event.ts
285
286
  import * as yup2 from "yup";
286
287
  var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
287
- var marketSchema = globalResourceSchema.shape({
288
- dateTime: yup2.array().of(dateTimeSchema).min(1, "At least one Market date required").max(50, "You can only add up to 50 Market dates").required("DateTime is required").test(
288
+ var eventSchema = globalResourceSchema.shape({
289
+ 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(
289
290
  "unique-start-date-time",
290
291
  "Start Date and Time must be unique",
291
292
  function(value) {
@@ -302,8 +303,9 @@ var marketSchema = globalResourceSchema.shape({
302
303
  return true;
303
304
  }
304
305
  ),
306
+ eventType: yup2.mixed().oneOf(Object.values(EnumEventType)).required("Please select an Event type"),
305
307
  location: locationSchema,
306
- rainOrShine: yup2.boolean().label("Rain or Shine").required("Please specify if the market is rain or shine"),
308
+ rainOrShine: yup2.boolean().label("Rain or Shine").required("Please specify if the event is rain or shine"),
307
309
  tags: yup2.array().of(yup2.string().defined()).min(1, "Tags are required").required("Tags are required")
308
310
  });
309
311
  var paymentInfoSchema = yup2.object({
@@ -327,11 +329,11 @@ var paymentInfoSchema = yup2.object({
327
329
  otherwise: (schema) => schema.notRequired()
328
330
  })
329
331
  });
330
- var marketInfoSchema = yup2.object().shape({
332
+ var eventInfoSchema = yup2.object().shape({
331
333
  contactDetails: contactDetailsSchema,
332
334
  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")),
333
335
  dateTime: yup2.array().of(dateTimeWithPriceSchema).required("DateTime is required"),
334
- marketId: yup2.string().trim().required("Market ID is required"),
336
+ eventId: yup2.string().trim().required("Event ID is required"),
335
337
  packInTime: yup2.number().label("Pack In Time").typeError("Pack in time must be a number").min(1, "Pack in time must be at least 1").required("Pack in time is required").test("no-leading-zeros", "", noLeadingZeros("Pack in time")),
336
338
  paymentDueHours: yup2.number().label("Payment Due Hours").typeError("Payment due hours must be a number").min(1, "Payment due hours must be at least 1").required("Payment due hours is required").test("no-leading-zeros", "", noLeadingZeros("Payment due hours")),
337
339
  paymentInfo: yup2.array().of(paymentInfoSchema).min(1, "At least one payment info is required").required("Payment info is required")
@@ -441,7 +443,7 @@ var testersSchema = yup6.object().shape({
441
443
  osType: yup6.mixed().oneOf(Object.values(EnumOSPlatform), "Please select Android or iOS device").required("OS Type is required"),
442
444
  resourceType: yup6.mixed().oneOf(
443
445
  Object.values(EnumResourceType),
444
- "Please select Market or Stallholder"
446
+ "Please select Event or Stallholder"
445
447
  ).required("Resource Type is required")
446
448
  });
447
449
 
@@ -477,7 +479,7 @@ var adSchema = yup7.object().shape({
477
479
  resourceRegion: yup7.string().required("Resource region is required"),
478
480
  resourceType: yup7.mixed().oneOf(
479
481
  Object.values(EnumResourceType),
480
- "Please select Market or Stallholder"
482
+ "Please select Event or Stallholder"
481
483
  ).required("Resource Type is required"),
482
484
  showOn: yup7.mixed().oneOf(
483
485
  Object.values(EnumAdShowOn),
@@ -517,7 +519,7 @@ var globalDefaultValues = {
517
519
  region: "",
518
520
  socialMedia: []
519
521
  };
520
- var defaultMarketFormValues = {
522
+ var defaultEventFormValues = {
521
523
  ...globalDefaultValues,
522
524
  dateTime: [
523
525
  {
@@ -527,6 +529,7 @@ var defaultMarketFormValues = {
527
529
  startTime: ""
528
530
  }
529
531
  ],
532
+ eventType: "market" /* MARKET */,
530
533
  location: {
531
534
  city: "",
532
535
  coordinates: [0, 0],
@@ -543,7 +546,7 @@ var defaultMarketFormValues = {
543
546
  rainOrShine: false,
544
547
  tags: []
545
548
  };
546
- var defaultMarketInfoFormValues = {
549
+ var defaultEventInfoFormValues = {
547
550
  applicationDeadlineHours: 48,
548
551
  contactDetails: {
549
552
  email: null,
@@ -559,9 +562,9 @@ var defaultMarketInfoFormValues = {
559
562
  startTime: ""
560
563
  }
561
564
  ],
562
- marketId: "",
565
+ eventId: "",
563
566
  packInTime: 2,
564
- // e.g., 2 hours before market opens
567
+ // e.g., 2 hours before event opens
565
568
  paymentDueHours: 24,
566
569
  paymentInfo: [],
567
570
  requirements: []
@@ -762,11 +765,11 @@ function useStallholderInfoForm(data) {
762
765
  };
763
766
  }
764
767
 
765
- // src/hooks/market/useMarketForm.ts
768
+ // src/hooks/event/useEventForm.ts
766
769
  import { yupResolver as yupResolver3 } from "@hookform/resolvers/yup";
767
770
  import * as React3 from "react";
768
771
  import { useForm as useForm3 } from "react-hook-form";
769
- function useMarketForm(data) {
772
+ function useEventForm(data) {
770
773
  const {
771
774
  control,
772
775
  formState: { errors },
@@ -776,21 +779,22 @@ function useMarketForm(data) {
776
779
  setValue,
777
780
  watch
778
781
  } = useForm3({
779
- defaultValues: defaultMarketFormValues,
780
- resolver: yupResolver3(marketSchema)
782
+ defaultValues: defaultEventFormValues,
783
+ resolver: yupResolver3(eventSchema)
781
784
  });
782
785
  React3.useEffect(() => {
783
786
  if (data) {
784
787
  reset({
785
788
  ...mapBaseResourceTypeToFormData(data),
786
789
  dateTime: data.dateTime,
790
+ eventType: data.eventType,
787
791
  location: data.location,
788
792
  provider: data.provider,
789
793
  rainOrShine: data.rainOrShine,
790
794
  tags: data.tags
791
795
  });
792
796
  } else {
793
- reset(defaultMarketFormValues);
797
+ reset(defaultEventFormValues);
794
798
  }
795
799
  }, [data]);
796
800
  const {
@@ -800,6 +804,7 @@ function useMarketForm(data) {
800
804
  coverUpload,
801
805
  dateTime,
802
806
  description,
807
+ eventType,
803
808
  images,
804
809
  imagesUpload,
805
810
  location,
@@ -822,6 +827,7 @@ function useMarketForm(data) {
822
827
  coverUpload,
823
828
  dateTime,
824
829
  description,
830
+ eventType,
825
831
  images,
826
832
  imagesUpload,
827
833
  location,
@@ -843,11 +849,11 @@ function useMarketForm(data) {
843
849
  };
844
850
  }
845
851
 
846
- // src/hooks/market/useMarketInfoForm.ts
852
+ // src/hooks/event/useEventInfoForm.ts
847
853
  import { yupResolver as yupResolver4 } from "@hookform/resolvers/yup";
848
854
  import * as React4 from "react";
849
855
  import { useForm as useForm4 } from "react-hook-form";
850
- function useMarketInfoForm(data) {
856
+ function useEventInfoForm(data) {
851
857
  const {
852
858
  control,
853
859
  formState: { errors },
@@ -857,8 +863,8 @@ function useMarketInfoForm(data) {
857
863
  setValue,
858
864
  watch
859
865
  } = useForm4({
860
- defaultValues: defaultMarketInfoFormValues,
861
- resolver: yupResolver4(marketInfoSchema)
866
+ defaultValues: defaultEventInfoFormValues,
867
+ resolver: yupResolver4(eventInfoSchema)
862
868
  });
863
869
  React4.useEffect(() => {
864
870
  if (data) {
@@ -867,14 +873,14 @@ function useMarketInfoForm(data) {
867
873
  applicationDeadlineHours: data.applicationDeadlineHours,
868
874
  contactDetails: data.contactDetails,
869
875
  dateTime: data.dateTime,
870
- marketId: data.marketId,
876
+ eventId: data.eventId,
871
877
  packInTime: data.packInTime,
872
878
  paymentDueHours: data.paymentDueHours,
873
879
  paymentInfo: data.paymentInfo,
874
880
  requirements: data.requirements
875
881
  });
876
882
  } else {
877
- reset(defaultMarketInfoFormValues);
883
+ reset(defaultEventInfoFormValues);
878
884
  }
879
885
  }, [data]);
880
886
  const {
@@ -882,7 +888,7 @@ function useMarketInfoForm(data) {
882
888
  applicationDeadlineHours,
883
889
  contactDetails,
884
890
  dateTime,
885
- marketId,
891
+ eventId,
886
892
  packInTime,
887
893
  paymentDueHours,
888
894
  paymentInfo,
@@ -895,7 +901,7 @@ function useMarketInfoForm(data) {
895
901
  applicationDeadlineHours,
896
902
  contactDetails,
897
903
  dateTime,
898
- marketId,
904
+ eventId,
899
905
  packInTime,
900
906
  paymentDueHours,
901
907
  paymentInfo,
@@ -1325,7 +1331,7 @@ var defaultValues9 = {
1325
1331
  resourceName: "",
1326
1332
  resourceRegion: "",
1327
1333
  resourceType: "",
1328
- // default to market
1334
+ // default to event
1329
1335
  showOn: "Front_page" /* FRONT_PAGE */,
1330
1336
  // default to front page
1331
1337
  socialMedia: [],
@@ -1419,18 +1425,18 @@ function useAdForm(data) {
1419
1425
  };
1420
1426
  }
1421
1427
  export {
1422
- defaultMarketFormValues,
1423
- defaultMarketInfoFormValues,
1428
+ defaultEventFormValues,
1429
+ defaultEventInfoFormValues,
1424
1430
  defaultStallholderFormValues,
1425
1431
  defaultStallholderInfoFormValues,
1426
1432
  globalDefaultValues,
1427
1433
  mapBaseResourceTypeToFormData,
1428
1434
  useAdForm,
1429
1435
  useContactUsForm,
1436
+ useEventForm,
1437
+ useEventInfoForm,
1430
1438
  useLocationSearch,
1431
1439
  useLoginForm,
1432
- useMarketForm,
1433
- useMarketInfoForm,
1434
1440
  useRegisterForm,
1435
1441
  useRequestPasswordResetForm,
1436
1442
  useResetPasswordForm,