@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.
- package/dist/{auth-Dcif6SZD.d.mts → ad-BdkvVgTG.d.mts} +2 -51
- package/dist/{auth-BS0Z8xN3.d.ts → ad-CaHFwLDq.d.ts} +2 -51
- package/dist/auth-Bdbu0AYI.d.ts +45 -0
- package/dist/auth-DEMvXVbh.d.mts +45 -0
- package/dist/{chunk-JUZHLSQK.mjs → chunk-NLDCBJIQ.mjs} +2 -2
- package/dist/{chunk-4RWXISXJ.mjs → chunk-U6WFPNBJ.mjs} +8 -8
- package/dist/{chunk-4RWXISXJ.mjs.map → chunk-U6WFPNBJ.mjs.map} +1 -1
- package/dist/enums/index.cjs +7 -7
- package/dist/enums/index.cjs.map +1 -1
- package/dist/enums/index.d.mts +7 -7
- package/dist/enums/index.d.ts +7 -7
- package/dist/enums/index.mjs +1 -1
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +1 -1
- package/dist/formFields/index.d.ts +1 -1
- package/dist/formFields/index.mjs +2 -2
- package/dist/{global-CNiNcYkF.d.mts → global-BT5qyeKd.d.mts} +27 -11
- package/dist/{global-Clh5l5eo.d.ts → global-BvXtqVsE.d.ts} +27 -11
- package/dist/graphql/index.cjs +65 -24
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +2 -2
- package/dist/graphql/index.d.ts +2 -2
- package/dist/graphql/index.mjs +66 -25
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +47 -72
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +3 -3
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.mjs +42 -67
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +112 -96
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +32 -32
- package/dist/index.d.ts +32 -32
- package/dist/index.mjs +112 -96
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.mts +3 -3
- package/dist/types/index.d.ts +3 -3
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/contactUs-BTRh2D7-.d.mts +0 -11
- package/dist/contactUs-OR-5Mkkg.d.ts +0 -11
- /package/dist/{chunk-JUZHLSQK.mjs.map → chunk-NLDCBJIQ.mjs.map} +0 -0
package/dist/hooks/index.cjs
CHANGED
|
@@ -172,16 +172,16 @@ var EnumResourceType = /* @__PURE__ */ ((EnumResourceType2) => {
|
|
|
172
172
|
return EnumResourceType2;
|
|
173
173
|
})(EnumResourceType || {});
|
|
174
174
|
var EnumEventType = /* @__PURE__ */ ((EnumEventType2) => {
|
|
175
|
-
EnumEventType2["EXPO"] = "
|
|
176
|
-
EnumEventType2["FAIR"] = "
|
|
177
|
-
EnumEventType2["FESTIVAL"] = "
|
|
178
|
-
EnumEventType2["MARKET"] = "
|
|
175
|
+
EnumEventType2["EXPO"] = "Expo";
|
|
176
|
+
EnumEventType2["FAIR"] = "Fair";
|
|
177
|
+
EnumEventType2["FESTIVAL"] = "Festival";
|
|
178
|
+
EnumEventType2["MARKET"] = "Market";
|
|
179
179
|
return EnumEventType2;
|
|
180
180
|
})(EnumEventType || {});
|
|
181
181
|
var EnumVendorType = /* @__PURE__ */ ((EnumVendorType2) => {
|
|
182
|
-
EnumVendorType2["STALLHOLDER"] = "
|
|
183
|
-
EnumVendorType2["SHOP"] = "
|
|
184
|
-
EnumVendorType2["CHARITY"] = "
|
|
182
|
+
EnumVendorType2["STALLHOLDER"] = "Stallholder";
|
|
183
|
+
EnumVendorType2["SHOP"] = "Shop";
|
|
184
|
+
EnumVendorType2["CHARITY"] = "Charity";
|
|
185
185
|
return EnumVendorType2;
|
|
186
186
|
})(EnumVendorType || {});
|
|
187
187
|
var EnumOSPlatform = /* @__PURE__ */ ((EnumOSPlatform2) => {
|
|
@@ -284,6 +284,33 @@ var noLeadingZeros = (fieldName, options = {}) => {
|
|
|
284
284
|
};
|
|
285
285
|
import_dayjs2.default.extend(import_isSameOrAfter2.default);
|
|
286
286
|
import_dayjs2.default.extend(import_customParseFormat2.default);
|
|
287
|
+
var emailRequiredSchema = yup.string().email("Invalid email address").required("Email is required").label("Email").transform(
|
|
288
|
+
(value) => typeof value === "string" ? value.trim().toLowerCase() : value
|
|
289
|
+
);
|
|
290
|
+
var emailOptionalSchema = yup.string().nullable().notRequired().transform(
|
|
291
|
+
(value) => typeof value === "string" ? value.trim().toLowerCase() : value
|
|
292
|
+
).test(
|
|
293
|
+
"is-valid-email",
|
|
294
|
+
"Invalid email address",
|
|
295
|
+
(value) => !value || yup.string().email().isValidSync(value)
|
|
296
|
+
).label("Email");
|
|
297
|
+
var mobileRegex = /^02\d{7,9}$/;
|
|
298
|
+
var landlineRegex = /^(0(3|4|6|7|9)[0-9]{7})$/;
|
|
299
|
+
var contactDetailsSchema = yup.object({
|
|
300
|
+
email: emailOptionalSchema,
|
|
301
|
+
mobilePhone: yup.string().label("Mobile Phone").nullable().notRequired().test(
|
|
302
|
+
"mobile-phone",
|
|
303
|
+
"Mobile must start with 02 and be 9\u201311 digits",
|
|
304
|
+
(value) => !value || mobileRegex.test(value)
|
|
305
|
+
// skip empty values
|
|
306
|
+
),
|
|
307
|
+
landlinePhone: yup.string().label("Landline Phone").nullable().notRequired().test(
|
|
308
|
+
"landline-phone",
|
|
309
|
+
"Landline must start with 03, 04, 06, 07, or 09 (not 090) and have 7 digits after area code",
|
|
310
|
+
(value) => !value || landlineRegex.test(value)
|
|
311
|
+
// skip empty values
|
|
312
|
+
)
|
|
313
|
+
}).nullable().optional().label("Contact Details");
|
|
287
314
|
var endDateNotInPastTest = yup.string().test("not-in-past", "End date cannot be in the past", (value) => {
|
|
288
315
|
const now = (0, import_dayjs2.default)();
|
|
289
316
|
return value ? (0, import_dayjs2.default)(value, dateFormat, true).isSameOrAfter(now, "day") : false;
|
|
@@ -379,16 +406,6 @@ var locationSchema = yup.object().shape({
|
|
|
379
406
|
region: yup.string().label("Region").required("Region is required"),
|
|
380
407
|
type: yup.string().oneOf(["Point"], "Type must be 'Point'").default("Point").required("Type is required")
|
|
381
408
|
});
|
|
382
|
-
var emailRequiredSchema = yup.string().email("Invalid email address").required("Email is required").label("Email").transform(
|
|
383
|
-
(value) => typeof value === "string" ? value.trim().toLowerCase() : value
|
|
384
|
-
);
|
|
385
|
-
var emailOptionalSchema = yup.string().nullable().notRequired().transform(
|
|
386
|
-
(value) => typeof value === "string" ? value.trim().toLowerCase() : value
|
|
387
|
-
).test(
|
|
388
|
-
"is-valid-email",
|
|
389
|
-
"Invalid email address",
|
|
390
|
-
(value) => !value || yup.string().email().isValidSync(value)
|
|
391
|
-
).label("Email");
|
|
392
409
|
var passwordSchema = yup.string().trim().label("Password").min(8, "Password must be at least 8 characters long").required("Password is required");
|
|
393
410
|
var socialMediaSchema = yup.object({
|
|
394
411
|
name: yup.mixed().oneOf(Object.values(EnumSocialMedia)).label("Social Media Name").optional(),
|
|
@@ -405,6 +422,7 @@ var globalResourceSchema = yup.object().shape({
|
|
|
405
422
|
source: yup.string().label("Cover").required("Cover is required"),
|
|
406
423
|
title: yup.string().label("Cover Title").required("Cover is required")
|
|
407
424
|
}),
|
|
425
|
+
contactDetails: contactDetailsSchema,
|
|
408
426
|
description: yup.string().label("Description").trim().min(3).required("Description is required"),
|
|
409
427
|
name: yup.string().label("Name").trim().min(3).max(40).required("Name is required"),
|
|
410
428
|
region: yup.string().label("Region").required("Region is required"),
|
|
@@ -436,23 +454,6 @@ var categorySchema = yup.array().of(
|
|
|
436
454
|
).min(1, "At least one subcategory is required").required("Subcategories are required")
|
|
437
455
|
})
|
|
438
456
|
);
|
|
439
|
-
var mobileRegex = /^02\d{7,9}$/;
|
|
440
|
-
var landlineRegex = /^(0(3|4|6|7|9)[0-9]{7})$/;
|
|
441
|
-
var contactDetailsSchema = yup.object({
|
|
442
|
-
email: emailOptionalSchema,
|
|
443
|
-
mobilePhone: yup.string().label("Mobile Phone").nullable().notRequired().test(
|
|
444
|
-
"mobile-phone",
|
|
445
|
-
"Mobile must start with 02 and be 9\u201311 digits",
|
|
446
|
-
(value) => !value || mobileRegex.test(value)
|
|
447
|
-
// skip empty values
|
|
448
|
-
),
|
|
449
|
-
landlinePhone: yup.string().label("Landline Phone").nullable().notRequired().test(
|
|
450
|
-
"landline-phone",
|
|
451
|
-
"Landline must start with 03, 04, 06, 07, or 09 (not 090) and have 7 digits after area code",
|
|
452
|
-
(value) => !value || landlineRegex.test(value)
|
|
453
|
-
// skip empty values
|
|
454
|
-
)
|
|
455
|
-
}).nullable().optional().label("Contact Details");
|
|
456
457
|
|
|
457
458
|
// src/yupSchema/event.ts
|
|
458
459
|
var yup2 = __toESM(require("yup"));
|
|
@@ -503,7 +504,6 @@ var paymentInfoSchema = yup2.object({
|
|
|
503
504
|
})
|
|
504
505
|
});
|
|
505
506
|
var eventInfoSchema = yup2.object().shape({
|
|
506
|
-
contactDetails: contactDetailsSchema,
|
|
507
507
|
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")),
|
|
508
508
|
dateTime: yup2.array().of(dateTimeWithPriceSchema).required("DateTime is required"),
|
|
509
509
|
eventId: yup2.string().trim().required("Event ID is required"),
|
|
@@ -534,7 +534,6 @@ var vendorSchema = globalResourceSchema.shape({
|
|
|
534
534
|
vendorType: yup3.mixed().oneOf(Object.values(EnumVendorType)).required("Please select a Vendor type")
|
|
535
535
|
});
|
|
536
536
|
var vendorInfoSchema = yup3.object().shape({
|
|
537
|
-
contactDetails: contactDetailsSchema,
|
|
538
537
|
product: yup3.object().shape({
|
|
539
538
|
foodFlavors: yup3.array().of(
|
|
540
539
|
yup3.mixed().oneOf(Object.values(EnumFoodFlavor), "Invalid flavor selected").required("Flavor is required")
|
|
@@ -717,6 +716,11 @@ var adSchema = yup7.object().shape({
|
|
|
717
716
|
// src/hooks/utils.ts
|
|
718
717
|
var globalDefaultValues = {
|
|
719
718
|
active: false,
|
|
719
|
+
contactDetails: {
|
|
720
|
+
email: null,
|
|
721
|
+
landlinePhone: null,
|
|
722
|
+
mobilePhone: null
|
|
723
|
+
},
|
|
720
724
|
cover: {
|
|
721
725
|
source: "",
|
|
722
726
|
title: ""
|
|
@@ -738,15 +742,8 @@ var globalDefaultValues = {
|
|
|
738
742
|
};
|
|
739
743
|
var defaultEventFormValues = {
|
|
740
744
|
...globalDefaultValues,
|
|
741
|
-
dateTime: [
|
|
742
|
-
|
|
743
|
-
endDate: "",
|
|
744
|
-
endTime: "",
|
|
745
|
-
startDate: "",
|
|
746
|
-
startTime: ""
|
|
747
|
-
}
|
|
748
|
-
],
|
|
749
|
-
eventType: "market" /* MARKET */,
|
|
745
|
+
dateTime: [],
|
|
746
|
+
eventType: "Market" /* MARKET */,
|
|
750
747
|
location: {
|
|
751
748
|
city: "",
|
|
752
749
|
coordinates: [0, 0],
|
|
@@ -766,20 +763,7 @@ var defaultEventFormValues = {
|
|
|
766
763
|
};
|
|
767
764
|
var defaultEventInfoFormValues = {
|
|
768
765
|
applicationDeadlineHours: 24,
|
|
769
|
-
|
|
770
|
-
email: null,
|
|
771
|
-
landlinePhone: null,
|
|
772
|
-
mobilePhone: null
|
|
773
|
-
},
|
|
774
|
-
dateTime: [
|
|
775
|
-
{
|
|
776
|
-
endDate: "",
|
|
777
|
-
endTime: "",
|
|
778
|
-
stallTypes: [],
|
|
779
|
-
startDate: "",
|
|
780
|
-
startTime: ""
|
|
781
|
-
}
|
|
782
|
-
],
|
|
766
|
+
dateTime: [],
|
|
783
767
|
eventId: "",
|
|
784
768
|
packInTime: 2,
|
|
785
769
|
// e.g., 2 hours before event opens
|
|
@@ -798,15 +782,10 @@ var defaultVendorFormValues = {
|
|
|
798
782
|
locations: null,
|
|
799
783
|
multiLocation: false,
|
|
800
784
|
products: null,
|
|
801
|
-
vendorType: "
|
|
785
|
+
vendorType: "Stallholder" /* STALLHOLDER */
|
|
802
786
|
};
|
|
803
787
|
var defaultVendorInfoFormValues = {
|
|
804
788
|
compliance: { foodBeverageLicense: false, liabilityInsurance: false },
|
|
805
|
-
contactDetails: {
|
|
806
|
-
email: null,
|
|
807
|
-
landlinePhone: null,
|
|
808
|
-
mobilePhone: null
|
|
809
|
-
},
|
|
810
789
|
documents: null,
|
|
811
790
|
documentsUpload: null,
|
|
812
791
|
product: {
|
|
@@ -829,6 +808,7 @@ function mapBaseResourceTypeToFormData(data) {
|
|
|
829
808
|
return {
|
|
830
809
|
_id: data._id,
|
|
831
810
|
active: data.active,
|
|
811
|
+
contactDetails: data.contactDetails,
|
|
832
812
|
cover: data.cover,
|
|
833
813
|
coverUpload: data.coverUpload,
|
|
834
814
|
description: data.description,
|
|
@@ -841,7 +821,8 @@ function mapBaseResourceTypeToFormData(data) {
|
|
|
841
821
|
partners: data.partners,
|
|
842
822
|
promoCodes: data.promoCodes,
|
|
843
823
|
region: data.region,
|
|
844
|
-
socialMedia: data.socialMedia
|
|
824
|
+
socialMedia: data.socialMedia,
|
|
825
|
+
termsAgreement: data.termsAgreement
|
|
845
826
|
};
|
|
846
827
|
}
|
|
847
828
|
|
|
@@ -952,7 +933,6 @@ function useVendorInfoForm(data) {
|
|
|
952
933
|
reset({
|
|
953
934
|
_id: data._id,
|
|
954
935
|
compliance: data.compliance,
|
|
955
|
-
contactDetails: data.contactDetails,
|
|
956
936
|
documents: data.documents,
|
|
957
937
|
documentsUpload: data.documentsUpload,
|
|
958
938
|
product: data.product,
|
|
@@ -967,7 +947,6 @@ function useVendorInfoForm(data) {
|
|
|
967
947
|
const {
|
|
968
948
|
_id,
|
|
969
949
|
compliance,
|
|
970
|
-
contactDetails,
|
|
971
950
|
documents,
|
|
972
951
|
documentsUpload,
|
|
973
952
|
product,
|
|
@@ -980,7 +959,6 @@ function useVendorInfoForm(data) {
|
|
|
980
959
|
fields: {
|
|
981
960
|
_id,
|
|
982
961
|
compliance,
|
|
983
|
-
contactDetails,
|
|
984
962
|
documents,
|
|
985
963
|
documentsUpload,
|
|
986
964
|
product,
|
|
@@ -1109,7 +1087,6 @@ function useEventInfoForm(data) {
|
|
|
1109
1087
|
reset({
|
|
1110
1088
|
_id: data._id,
|
|
1111
1089
|
applicationDeadlineHours: data.applicationDeadlineHours,
|
|
1112
|
-
contactDetails: data.contactDetails,
|
|
1113
1090
|
dateTime: data.dateTime,
|
|
1114
1091
|
eventId: data.eventId,
|
|
1115
1092
|
packInTime: data.packInTime,
|
|
@@ -1124,7 +1101,6 @@ function useEventInfoForm(data) {
|
|
|
1124
1101
|
const {
|
|
1125
1102
|
_id,
|
|
1126
1103
|
applicationDeadlineHours,
|
|
1127
|
-
contactDetails,
|
|
1128
1104
|
dateTime,
|
|
1129
1105
|
eventId,
|
|
1130
1106
|
packInTime,
|
|
@@ -1137,7 +1113,6 @@ function useEventInfoForm(data) {
|
|
|
1137
1113
|
fields: {
|
|
1138
1114
|
_id,
|
|
1139
1115
|
applicationDeadlineHours,
|
|
1140
|
-
contactDetails,
|
|
1141
1116
|
dateTime,
|
|
1142
1117
|
eventId,
|
|
1143
1118
|
packInTime,
|