@timardex/cluemart-shared 1.1.65 → 1.1.67
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/{ad-YmCqcpsU.d.ts → ad-CIIexObo.d.ts} +1 -1
- package/dist/{ad-Dveoa7qY.d.mts → ad-CNg5-GwQ.d.mts} +1 -1
- package/dist/{auth-CUX9MjXz.d.ts → auth-D8C8i97l.d.ts} +1 -1
- package/dist/{auth-DjnAnJG2.d.mts → auth-Do4FsRPf.d.mts} +1 -1
- package/dist/formFields/index.cjs +22 -22
- 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 +22 -22
- package/dist/formFields/index.mjs.map +1 -1
- package/dist/{global-D0x3B0sV.d.ts → global-B9wwLKaM.d.ts} +8 -9
- package/dist/{global-Dv7IC_sT.d.mts → global-B_d5mdQP.d.mts} +8 -9
- package/dist/graphql/index.cjs +10 -10
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +3 -3
- package/dist/graphql/index.d.ts +3 -3
- package/dist/graphql/index.mjs +10 -10
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +41 -48
- 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 +41 -48
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +73 -80
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +8 -9
- package/dist/index.d.ts +8 -9
- package/dist/index.mjs +73 -80
- package/dist/index.mjs.map +1 -1
- package/dist/{notification-BIfcW0W3.d.mts → notification-BDyTB052.d.mts} +1 -1
- package/dist/{notification-B5edCCra.d.ts → notification-D7T-_hL5.d.ts} +1 -1
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.d.ts +4 -4
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/hooks/index.cjs
CHANGED
|
@@ -350,7 +350,7 @@ var locationSchema = yup.object().shape({
|
|
|
350
350
|
region: yup.string().label("Region").required("Region is required"),
|
|
351
351
|
type: yup.string().oneOf(["Point"], "Type must be 'Point'").default("Point").required("Type is required")
|
|
352
352
|
});
|
|
353
|
-
var
|
|
353
|
+
var emailRequiredSchema = yup.string().email("Invalid email address").required("Email is required").label("Email").transform(
|
|
354
354
|
(value) => typeof value === "string" ? value.toLowerCase() : value
|
|
355
355
|
);
|
|
356
356
|
var passwordSchema = yup.string().trim().label("Password").min(8, "Password must be at least 8 characters long").required("Password is required");
|
|
@@ -394,7 +394,14 @@ var categorySchema = yup.array().of(
|
|
|
394
394
|
);
|
|
395
395
|
var mobileRegex = /^02\d{7,9}$/;
|
|
396
396
|
var landlineRegex = /^(0(3|4|6|7|9)[0-9]{7})$/;
|
|
397
|
-
var
|
|
397
|
+
var contactDetailsSchema = yup.object({
|
|
398
|
+
email: yup.string().nullable().notRequired().transform(
|
|
399
|
+
(value) => typeof value === "string" ? value.trim().toLowerCase() : value
|
|
400
|
+
).test(
|
|
401
|
+
"is-valid-email",
|
|
402
|
+
"Invalid email address",
|
|
403
|
+
(value) => !value || yup.string().email().isValidSync(value)
|
|
404
|
+
).label("Email"),
|
|
398
405
|
mobilePhone: yup.string().nullable().notRequired().test(
|
|
399
406
|
"mobile-phone",
|
|
400
407
|
"Mobile must start with 02 and be 9\u201311 digits",
|
|
@@ -407,7 +414,7 @@ var phoneSchema = yup.object({
|
|
|
407
414
|
(value) => !value || landlineRegex.test(value)
|
|
408
415
|
// skip empty values
|
|
409
416
|
)
|
|
410
|
-
});
|
|
417
|
+
}).nullable().optional().label("Contact Details");
|
|
411
418
|
|
|
412
419
|
// src/yupSchema/market.ts
|
|
413
420
|
var yup2 = __toESM(require("yup"));
|
|
@@ -457,14 +464,13 @@ var paymentInfoSchema = yup2.object({
|
|
|
457
464
|
})
|
|
458
465
|
});
|
|
459
466
|
var marketInfoSchema = yup2.object().shape({
|
|
467
|
+
contactDetails: contactDetailsSchema,
|
|
460
468
|
applicationDeadlineHours: yup2.number().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")),
|
|
461
469
|
dateTime: yup2.array().of(dateTimeWithPriceSchema).required("DateTime is required"),
|
|
462
|
-
email: emailSchema,
|
|
463
470
|
marketId: yup2.string().trim().required("Market ID is required"),
|
|
464
471
|
packInTime: yup2.number().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")),
|
|
465
472
|
paymentDueHours: yup2.number().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")),
|
|
466
|
-
paymentInfo: yup2.array().of(paymentInfoSchema).min(1, "At least one payment info is required").required("Payment info is required")
|
|
467
|
-
phoneNumber: phoneSchema.nullable().optional().label("Phone Number")
|
|
473
|
+
paymentInfo: yup2.array().of(paymentInfoSchema).min(1, "At least one payment info is required").required("Payment info is required")
|
|
468
474
|
});
|
|
469
475
|
|
|
470
476
|
// src/yupSchema/stallholder.ts
|
|
@@ -475,13 +481,13 @@ var stallHolderSchema = globalResourceSchema.shape({
|
|
|
475
481
|
products: yup3.array().of(yup3.string().defined()).min(1, "Product list must contain at least one item").required("Products are required")
|
|
476
482
|
});
|
|
477
483
|
var stallholderInfoSchema = yup3.object().shape({
|
|
484
|
+
contactDetails: contactDetailsSchema,
|
|
478
485
|
electricity: yup3.object().shape({
|
|
479
486
|
details: yup3.string().trim().test("details-required", "Please add details", function(value) {
|
|
480
487
|
return !this.parent?.isRequired || (value?.trim().length ?? 0) > 0;
|
|
481
488
|
}).nullable(),
|
|
482
489
|
isRequired: yup3.boolean().required("Electricity requirement is required")
|
|
483
490
|
}),
|
|
484
|
-
email: emailSchema,
|
|
485
491
|
foodSafetyGradeFiles: yup3.array().of(yup3.string().defined()).nullable(),
|
|
486
492
|
foodSafetyGradeFilesUpload: yup3.array().of(yup3.string().defined()).nullable(),
|
|
487
493
|
gazebo: yup3.object().shape({
|
|
@@ -491,7 +497,6 @@ var stallholderInfoSchema = yup3.object().shape({
|
|
|
491
497
|
isRequired: yup3.boolean().required("Gazebo requirement is required")
|
|
492
498
|
}),
|
|
493
499
|
packaging: yup3.array().of(yup3.string().defined()).min(1, "Packaging list must contain at least one item").required("Packaging is required"),
|
|
494
|
-
phoneNumber: phoneSchema.nullable().optional().label("Phone Number"),
|
|
495
500
|
priceRange: yup3.object().shape({
|
|
496
501
|
max: yup3.number().min(1).required("Max price is required").test(
|
|
497
502
|
"is-greater",
|
|
@@ -521,7 +526,7 @@ var stallholderInfoSchema = yup3.object().shape({
|
|
|
521
526
|
var yup4 = __toESM(require("yup"));
|
|
522
527
|
var userSchema = yup4.object().shape({
|
|
523
528
|
active: yup4.boolean().required("Active is required"),
|
|
524
|
-
email:
|
|
529
|
+
email: emailRequiredSchema,
|
|
525
530
|
firstName: yup4.string().required("First name is required"),
|
|
526
531
|
lastName: yup4.string().required("Last name is required"),
|
|
527
532
|
password: passwordSchema,
|
|
@@ -534,27 +539,27 @@ var userSchema = yup4.object().shape({
|
|
|
534
539
|
// src/yupSchema/auth.ts
|
|
535
540
|
var yup5 = __toESM(require("yup"));
|
|
536
541
|
var loginSchema = yup5.object().shape({
|
|
537
|
-
email:
|
|
542
|
+
email: emailRequiredSchema,
|
|
538
543
|
password: passwordSchema
|
|
539
544
|
});
|
|
540
545
|
var registerSchema = yup5.object().shape({
|
|
541
|
-
email:
|
|
546
|
+
email: emailRequiredSchema,
|
|
542
547
|
firstName: yup5.string().label("First Name").required("First Name is required"),
|
|
543
548
|
lastName: yup5.string().label("Last Name").required("Last Name is required"),
|
|
544
549
|
password: passwordSchema,
|
|
545
550
|
preferredRegion: yup5.string().label("Preferred Region").required("Preferred Region is required")
|
|
546
551
|
});
|
|
547
552
|
var requestPasswordResetSchema = yup5.object().shape({
|
|
548
|
-
email:
|
|
553
|
+
email: emailRequiredSchema
|
|
549
554
|
});
|
|
550
555
|
var resetPasswordSchema = yup5.object().shape({
|
|
551
|
-
email:
|
|
556
|
+
email: emailRequiredSchema,
|
|
552
557
|
password: passwordSchema,
|
|
553
558
|
// eslint-disable-next-line sort-keys
|
|
554
559
|
confirmPassword: yup5.string().oneOf([yup5.ref("password")], "Passwords must match").required("Confirm Password is required")
|
|
555
560
|
});
|
|
556
561
|
var validateVerificationTokenSchema = yup5.object().shape({
|
|
557
|
-
email:
|
|
562
|
+
email: emailRequiredSchema,
|
|
558
563
|
verificationToken: yup5.string().required("Verification code is required").matches(/^\d{6}$/, "Verification code must be exactly 6 digits")
|
|
559
564
|
});
|
|
560
565
|
|
|
@@ -567,7 +572,7 @@ var testersSchema = yup6.object().shape({
|
|
|
567
572
|
otherwise: () => yup6.array().nullable().notRequired()
|
|
568
573
|
}),
|
|
569
574
|
companyName: yup6.string().required("Company name is required"),
|
|
570
|
-
email:
|
|
575
|
+
email: emailRequiredSchema,
|
|
571
576
|
firstName: yup6.string().required("First name is required"),
|
|
572
577
|
lastName: yup6.string().required("Last name is required"),
|
|
573
578
|
osType: yup6.mixed().oneOf(Object.values(EnumOSPlatform), "Please select Android or iOS device").required("OS Type is required"),
|
|
@@ -679,16 +684,10 @@ var defaultMarketFormValues = {
|
|
|
679
684
|
...globalDefaultValues,
|
|
680
685
|
dateTime: [
|
|
681
686
|
{
|
|
682
|
-
endDate: "
|
|
683
|
-
endTime: "
|
|
684
|
-
startDate: "
|
|
685
|
-
startTime: "
|
|
686
|
-
},
|
|
687
|
-
{
|
|
688
|
-
endDate: "05-09-2025",
|
|
689
|
-
endTime: "15:00",
|
|
690
|
-
startDate: "05-09-2025",
|
|
691
|
-
startTime: "09:00"
|
|
687
|
+
endDate: "",
|
|
688
|
+
endTime: "",
|
|
689
|
+
startDate: "",
|
|
690
|
+
startTime: ""
|
|
692
691
|
}
|
|
693
692
|
],
|
|
694
693
|
location: {
|
|
@@ -709,6 +708,11 @@ var defaultMarketFormValues = {
|
|
|
709
708
|
};
|
|
710
709
|
var defaultMarketInfoFormValues = {
|
|
711
710
|
applicationDeadlineHours: 48,
|
|
711
|
+
contactDetails: {
|
|
712
|
+
email: null,
|
|
713
|
+
landlinePhone: null,
|
|
714
|
+
mobilePhone: null
|
|
715
|
+
},
|
|
712
716
|
dateTime: [
|
|
713
717
|
{
|
|
714
718
|
endDate: "",
|
|
@@ -718,16 +722,11 @@ var defaultMarketInfoFormValues = {
|
|
|
718
722
|
startTime: ""
|
|
719
723
|
}
|
|
720
724
|
],
|
|
721
|
-
email: "",
|
|
722
725
|
marketId: "",
|
|
723
726
|
packInTime: 2,
|
|
724
727
|
// e.g., 2 hours before market opens
|
|
725
728
|
paymentDueHours: 24,
|
|
726
729
|
paymentInfo: [],
|
|
727
|
-
phoneNumber: {
|
|
728
|
-
landlinePhone: null,
|
|
729
|
-
mobilePhone: null
|
|
730
|
-
},
|
|
731
730
|
requirements: []
|
|
732
731
|
};
|
|
733
732
|
var defaultStallholderFormValues = {
|
|
@@ -739,16 +738,16 @@ var defaultStallholderFormValues = {
|
|
|
739
738
|
specialities: null
|
|
740
739
|
};
|
|
741
740
|
var defaultStallholderInfoFormValues = {
|
|
741
|
+
contactDetails: {
|
|
742
|
+
email: null,
|
|
743
|
+
landlinePhone: null,
|
|
744
|
+
mobilePhone: null
|
|
745
|
+
},
|
|
742
746
|
electricity: { details: null, isRequired: false },
|
|
743
|
-
email: "",
|
|
744
747
|
foodSafetyGradeFiles: null,
|
|
745
748
|
foodSafetyGradeFilesUpload: null,
|
|
746
749
|
gazebo: { details: null, isRequired: false },
|
|
747
750
|
packaging: [],
|
|
748
|
-
phoneNumber: {
|
|
749
|
-
landlinePhone: null,
|
|
750
|
-
mobilePhone: null
|
|
751
|
-
},
|
|
752
751
|
priceRange: { max: 0, min: 0 },
|
|
753
752
|
producedIn: [],
|
|
754
753
|
stallholderId: "",
|
|
@@ -872,13 +871,12 @@ function useStallholderInfoForm(data) {
|
|
|
872
871
|
if (data) {
|
|
873
872
|
reset({
|
|
874
873
|
_id: data._id,
|
|
874
|
+
contactDetails: data.contactDetails,
|
|
875
875
|
electricity: data.electricity,
|
|
876
|
-
email: data.email,
|
|
877
876
|
foodSafetyGradeFiles: data.foodSafetyGradeFiles,
|
|
878
877
|
foodSafetyGradeFilesUpload: data.foodSafetyGradeFilesUpload,
|
|
879
878
|
gazebo: data.gazebo,
|
|
880
879
|
packaging: data.packaging,
|
|
881
|
-
phoneNumber: data.phoneNumber,
|
|
882
880
|
priceRange: data.priceRange,
|
|
883
881
|
producedIn: data.producedIn,
|
|
884
882
|
stallholderId: data.stallholderId,
|
|
@@ -891,13 +889,12 @@ function useStallholderInfoForm(data) {
|
|
|
891
889
|
}, [data]);
|
|
892
890
|
const {
|
|
893
891
|
_id,
|
|
892
|
+
contactDetails,
|
|
894
893
|
electricity,
|
|
895
|
-
email,
|
|
896
894
|
foodSafetyGradeFiles,
|
|
897
895
|
foodSafetyGradeFilesUpload,
|
|
898
896
|
gazebo,
|
|
899
897
|
packaging,
|
|
900
|
-
phoneNumber,
|
|
901
898
|
priceRange,
|
|
902
899
|
producedIn,
|
|
903
900
|
stallholderId,
|
|
@@ -908,13 +905,12 @@ function useStallholderInfoForm(data) {
|
|
|
908
905
|
control,
|
|
909
906
|
fields: {
|
|
910
907
|
_id,
|
|
908
|
+
contactDetails,
|
|
911
909
|
electricity,
|
|
912
|
-
email,
|
|
913
910
|
foodSafetyGradeFiles,
|
|
914
911
|
foodSafetyGradeFilesUpload,
|
|
915
912
|
gazebo,
|
|
916
913
|
packaging,
|
|
917
|
-
phoneNumber,
|
|
918
914
|
priceRange,
|
|
919
915
|
producedIn,
|
|
920
916
|
stallholderId,
|
|
@@ -1032,13 +1028,12 @@ function useMarketInfoForm(data) {
|
|
|
1032
1028
|
reset({
|
|
1033
1029
|
_id: data._id,
|
|
1034
1030
|
applicationDeadlineHours: data.applicationDeadlineHours,
|
|
1031
|
+
contactDetails: data.contactDetails,
|
|
1035
1032
|
dateTime: data.dateTime,
|
|
1036
|
-
email: data.email,
|
|
1037
1033
|
marketId: data.marketId,
|
|
1038
1034
|
packInTime: data.packInTime,
|
|
1039
1035
|
paymentDueHours: data.paymentDueHours,
|
|
1040
1036
|
paymentInfo: data.paymentInfo,
|
|
1041
|
-
phoneNumber: data.phoneNumber,
|
|
1042
1037
|
requirements: data.requirements
|
|
1043
1038
|
});
|
|
1044
1039
|
} else {
|
|
@@ -1048,13 +1043,12 @@ function useMarketInfoForm(data) {
|
|
|
1048
1043
|
const {
|
|
1049
1044
|
_id,
|
|
1050
1045
|
applicationDeadlineHours,
|
|
1046
|
+
contactDetails,
|
|
1051
1047
|
dateTime,
|
|
1052
|
-
email,
|
|
1053
1048
|
marketId,
|
|
1054
1049
|
packInTime,
|
|
1055
1050
|
paymentDueHours,
|
|
1056
1051
|
paymentInfo,
|
|
1057
|
-
phoneNumber,
|
|
1058
1052
|
requirements
|
|
1059
1053
|
} = getValues();
|
|
1060
1054
|
return {
|
|
@@ -1062,13 +1056,12 @@ function useMarketInfoForm(data) {
|
|
|
1062
1056
|
fields: {
|
|
1063
1057
|
_id,
|
|
1064
1058
|
applicationDeadlineHours,
|
|
1059
|
+
contactDetails,
|
|
1065
1060
|
dateTime,
|
|
1066
|
-
email,
|
|
1067
1061
|
marketId,
|
|
1068
1062
|
packInTime,
|
|
1069
1063
|
paymentDueHours,
|
|
1070
1064
|
paymentInfo,
|
|
1071
|
-
phoneNumber,
|
|
1072
1065
|
requirements
|
|
1073
1066
|
},
|
|
1074
1067
|
formState: { errors },
|
|
@@ -1421,7 +1414,7 @@ var import_react_hook_form12 = require("react-hook-form");
|
|
|
1421
1414
|
// src/yupSchema/contactUs.ts
|
|
1422
1415
|
var yup8 = __toESM(require("yup"));
|
|
1423
1416
|
var contactUsSchema = yup8.object().shape({
|
|
1424
|
-
email:
|
|
1417
|
+
email: emailRequiredSchema,
|
|
1425
1418
|
firstName: yup8.string().required("First name is required"),
|
|
1426
1419
|
lastName: yup8.string().required("Last name is required"),
|
|
1427
1420
|
message: yup8.string().required("Message is required")
|