@timardex/cluemart-shared 1.6.130 → 1.7.1
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-BUYzE6zx.d.ts +181 -0
- package/dist/ad-BhLoEul3.d.mts +181 -0
- package/dist/affiliate-BbtjeUP4.d.mts +73 -0
- package/dist/affiliate-C51nzKsw.d.ts +73 -0
- package/dist/apollo/index.d.mts +3 -3
- package/dist/apollo/index.d.ts +3 -3
- package/dist/auth/index.cjs +951 -2546
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.d.mts +30 -28
- package/dist/auth/index.d.ts +30 -28
- package/dist/auth/index.mjs +25 -24
- package/dist/auth/index.mjs.map +1 -1
- package/dist/chunk-32MKHJTX.mjs +1207 -0
- package/dist/chunk-32MKHJTX.mjs.map +1 -0
- package/dist/chunk-AYO3E4DM.mjs +224 -0
- package/dist/chunk-AYO3E4DM.mjs.map +1 -0
- package/dist/chunk-BIJ5NDXW.mjs +962 -0
- package/dist/chunk-BIJ5NDXW.mjs.map +1 -0
- package/dist/chunk-DQ7ZHIXW.mjs +26 -0
- package/dist/chunk-DQ7ZHIXW.mjs.map +1 -0
- package/dist/chunk-ILILH7E2.mjs +219 -0
- package/dist/chunk-ILILH7E2.mjs.map +1 -0
- package/dist/{chunk-OHHJ3KJJ.mjs → chunk-LBEJECG3.mjs} +64 -71
- package/dist/chunk-LBEJECG3.mjs.map +1 -0
- package/dist/chunk-NPFJ2CN2.mjs +109 -0
- package/dist/chunk-NPFJ2CN2.mjs.map +1 -0
- package/dist/chunk-R6PCFOYO.mjs +3650 -0
- package/dist/chunk-R6PCFOYO.mjs.map +1 -0
- package/dist/{chunk-NWWKI4PJ.mjs → chunk-SD42WIMV.mjs} +5 -5
- package/dist/chunk-SD42WIMV.mjs.map +1 -0
- package/dist/chunk-VA5YN2K3.mjs +48 -0
- package/dist/chunk-VA5YN2K3.mjs.map +1 -0
- package/dist/{chunk-DATBGC2K.mjs → chunk-VPANTTZI.mjs} +23 -108
- package/dist/chunk-VPANTTZI.mjs.map +1 -0
- package/dist/chunk-X3OLM35T.mjs +278 -0
- package/dist/chunk-X3OLM35T.mjs.map +1 -0
- package/dist/contactUs--NoohZBu.d.ts +11 -0
- package/dist/contactUs-CBWzefUS.d.mts +11 -0
- package/dist/enums/index.cjs +229 -2
- package/dist/enums/index.cjs.map +1 -1
- package/dist/enums/index.d.mts +170 -5
- package/dist/enums/index.d.ts +170 -5
- package/dist/enums/index.mjs +41 -1
- package/dist/formFields/index.cjs +112 -284
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +2 -4
- package/dist/formFields/index.d.ts +2 -4
- package/dist/formFields/index.mjs +50 -919
- package/dist/formFields/index.mjs.map +1 -1
- package/dist/global-CUYYxpy2.d.ts +699 -0
- package/dist/global-DePDtOFt.d.mts +699 -0
- package/dist/graphql/index.cjs +2304 -2872
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +469 -422
- package/dist/graphql/index.d.ts +469 -422
- package/dist/graphql/index.mjs +160 -2547
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +3869 -534
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +9 -10
- package/dist/hooks/index.d.ts +9 -10
- package/dist/hooks/index.mjs +72 -54
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/images/index.mjs +21 -86
- package/dist/images/index.mjs.map +1 -1
- package/dist/index.cjs +4477 -5723
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1679 -2539
- package/dist/index.d.ts +1679 -2539
- package/dist/index.mjs +4453 -5682
- package/dist/index.mjs.map +1 -1
- package/dist/map/index.d.mts +2 -3
- package/dist/map/index.d.ts +2 -3
- package/dist/resourceActivities-CMUcn2P7.d.ts +130 -0
- package/dist/resourceActivities-CwbJFGIp.d.mts +130 -0
- package/dist/sharing/index.cjs +19 -23
- package/dist/sharing/index.cjs.map +1 -1
- package/dist/sharing/index.d.mts +3 -16
- package/dist/sharing/index.d.ts +3 -16
- package/dist/sharing/index.mjs +29 -183
- package/dist/sharing/index.mjs.map +1 -1
- package/dist/subscription-BU8GvH2K.d.ts +12 -0
- package/dist/subscription-bmAdrnfi.d.mts +12 -0
- package/dist/theme/index.mjs +5 -41
- package/dist/theme/index.mjs.map +1 -1
- package/dist/types/index.cjs +123 -868
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +15 -234
- package/dist/types/index.d.ts +15 -234
- package/dist/types/index.mjs +31 -61
- package/dist/user-D47MLFyH.d.ts +134 -0
- package/dist/user-DE8edl3u.d.mts +134 -0
- package/dist/utils/index.cjs +117 -292
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +23 -25
- package/dist/utils/index.d.ts +23 -25
- package/dist/utils/index.mjs +5 -6
- package/package.json +3 -10
- package/dist/affiliate-Bqqlffw8.d.mts +0 -36
- package/dist/affiliate-Btlp5XUp.d.ts +0 -36
- package/dist/affiliateAdapters-BW3BY7c5.d.mts +0 -118
- package/dist/affiliateAdapters-C51ISmuA.d.ts +0 -118
- package/dist/auth-BOmAO53v.d.ts +0 -169
- package/dist/auth-CsITA95p.d.mts +0 -169
- package/dist/chunk-DATBGC2K.mjs.map +0 -1
- package/dist/chunk-DDHECBJR.mjs +0 -726
- package/dist/chunk-DDHECBJR.mjs.map +0 -1
- package/dist/chunk-INQCDU24.mjs +0 -139
- package/dist/chunk-INQCDU24.mjs.map +0 -1
- package/dist/chunk-NWWKI4PJ.mjs.map +0 -1
- package/dist/chunk-OHHJ3KJJ.mjs.map +0 -1
- package/dist/chunk-TOEFAEF2.mjs +0 -69
- package/dist/chunk-TOEFAEF2.mjs.map +0 -1
- package/dist/chunk-UKW7NZEQ.mjs +0 -2813
- package/dist/chunk-UKW7NZEQ.mjs.map +0 -1
- package/dist/dailyClue-C6WXY73z.d.mts +0 -105
- package/dist/dailyClue-C6WXY73z.d.ts +0 -105
- package/dist/event-C9K7CSg4.d.ts +0 -53
- package/dist/event-W0NhL5Cd.d.mts +0 -53
- package/dist/global-BbSFfYdd.d.ts +0 -181
- package/dist/global-C6v9tRji.d.mts +0 -181
- package/dist/graphql-CDOfA79A.d.ts +0 -1253
- package/dist/graphql-CcvzTs9k.d.mts +0 -1253
- package/dist/resourceActivities-CS8YRIIL.d.mts +0 -89
- package/dist/resourceActivities-DOdNPkhW.d.ts +0 -89
- package/dist/subscription-Cj_qBA7u.d.mts +0 -20
- package/dist/subscription-OiJ50uJb.d.ts +0 -20
- package/dist/vendor-DmMi2qmx.d.mts +0 -73
- package/dist/vendor-M9hVZlni.d.ts +0 -73
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { L as LocationType } from '../
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { A as AffiliateFormData, C as CreateAffiliateFormData } from '../affiliate-Bqqlffw8.mjs';
|
|
7
|
-
import { P as PartnerFormData, C as ContactUsFormData, d as CreateContactUsFormData, A as AdFormData, c as CreateAdFormState, e as CreatePartnerFormData, p as PostFormData, f as CreatePostFormData, S as SchoolFormData, g as CreateSchoolFormData } from '../affiliateAdapters-BW3BY7c5.mjs';
|
|
8
|
-
export { q as mapAffiliateToFormData } from '../affiliateAdapters-BW3BY7c5.mjs';
|
|
9
|
-
import '../images/index.mjs';
|
|
1
|
+
import { L as LocationType, m as VendorFormData, n as CreateVendorFormData, o as VendorInfoFormData, p as CreateVendorInfoFormData, q as UnregisteredVendorFormData, r as CreateUnregisteredVendorFormData, s as EventFormData, t as CreateEventFormData, u as EventInfoFormData, v as CreateEventInfoFormData, B as BaseResourceTypeFormData, w as PostFormData, x as CreatePostFormData } from '../global-DePDtOFt.mjs';
|
|
2
|
+
import { U as UserFormData, C as CreateUserFormData } from '../user-DE8edl3u.mjs';
|
|
3
|
+
import { C as CreateLoginFormData, d as CreateRegisterFormData, e as CreateRequestPasswordResetFormData, f as CreateValidateVerificationTokenFormData, g as CreateResetPasswordFormData, h as PartnerFormData, i as AdFormData, j as CreateAdFormState, k as CreatePartnerFormData, l as AppSettingsFormData, m as CreateAppSettingsFormData, n as SchoolFormData, o as CreateSchoolFormData } from '../ad-BhLoEul3.mjs';
|
|
4
|
+
import { a as AffiliateFormData, A as AffiliateType, C as CreateAffiliateFormData } from '../affiliate-BbtjeUP4.mjs';
|
|
5
|
+
import { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-CBWzefUS.mjs';
|
|
10
6
|
import 'react-hook-form';
|
|
7
|
+
import '../enums/index.mjs';
|
|
8
|
+
import '../images/index.mjs';
|
|
11
9
|
|
|
12
10
|
interface PlacePrediction {
|
|
13
11
|
place_id: string;
|
|
@@ -95,6 +93,7 @@ declare const defaultVendorFormValues: VendorFormData;
|
|
|
95
93
|
declare const defaultUnregisteredVendorFormValues: UnregisteredVendorFormData;
|
|
96
94
|
declare const defaultVendorInfoFormValues: VendorInfoFormData;
|
|
97
95
|
declare const defaultAffiliateFormValues: AffiliateFormData;
|
|
96
|
+
declare function mapAffiliateToFormData(affiliate: Pick<AffiliateType, "affiliateDetails">): AffiliateFormData;
|
|
98
97
|
declare function mapBaseResourceTypeToFormData(data: BaseResourceTypeFormData): BaseResourceTypeFormData;
|
|
99
98
|
|
|
100
99
|
declare function useContactUsForm(data?: ContactUsFormData): CreateContactUsFormData;
|
|
@@ -117,4 +116,4 @@ declare function useSchoolForm(data?: SchoolFormData): CreateSchoolFormData;
|
|
|
117
116
|
|
|
118
117
|
declare function useAffiliateForm(data: AffiliateFormData): CreateAffiliateFormData;
|
|
119
118
|
|
|
120
|
-
export { type PlacePrediction, defaultAffiliateFormValues, defaultEventFormValues, defaultEventInfoFormValues, defaultLocation, defaultPartnerFormValues, defaultUnregisteredVendorFormValues, defaultVendorFormValues, defaultVendorInfoFormValues, globalDefaultValues, mapBaseResourceTypeToFormData, useAdForm, useAffiliateForm, useAppSettingsForm, useContactUsForm, useEventForm, useEventInfoForm, useLocationSearch, useLoginForm, usePartnerForm, usePostForm, useRegisterForm, useRequestPasswordResetForm, useResetPasswordForm, useSchoolForm, useUnregisteredVendorForm, useUserForm, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm };
|
|
119
|
+
export { type PlacePrediction, defaultAffiliateFormValues, defaultEventFormValues, defaultEventInfoFormValues, defaultLocation, defaultPartnerFormValues, defaultUnregisteredVendorFormValues, defaultVendorFormValues, defaultVendorInfoFormValues, globalDefaultValues, mapAffiliateToFormData, mapBaseResourceTypeToFormData, useAdForm, useAffiliateForm, useAppSettingsForm, useContactUsForm, useEventForm, useEventInfoForm, useLocationSearch, useLoginForm, usePartnerForm, usePostForm, useRegisterForm, useRequestPasswordResetForm, useResetPasswordForm, useSchoolForm, useUnregisteredVendorForm, useUserForm, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm };
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { L as LocationType } from '../
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { A as AffiliateFormData, C as CreateAffiliateFormData } from '../affiliate-Btlp5XUp.js';
|
|
7
|
-
import { P as PartnerFormData, C as ContactUsFormData, d as CreateContactUsFormData, A as AdFormData, c as CreateAdFormState, e as CreatePartnerFormData, p as PostFormData, f as CreatePostFormData, S as SchoolFormData, g as CreateSchoolFormData } from '../affiliateAdapters-C51ISmuA.js';
|
|
8
|
-
export { q as mapAffiliateToFormData } from '../affiliateAdapters-C51ISmuA.js';
|
|
9
|
-
import '../images/index.js';
|
|
1
|
+
import { L as LocationType, m as VendorFormData, n as CreateVendorFormData, o as VendorInfoFormData, p as CreateVendorInfoFormData, q as UnregisteredVendorFormData, r as CreateUnregisteredVendorFormData, s as EventFormData, t as CreateEventFormData, u as EventInfoFormData, v as CreateEventInfoFormData, B as BaseResourceTypeFormData, w as PostFormData, x as CreatePostFormData } from '../global-CUYYxpy2.js';
|
|
2
|
+
import { U as UserFormData, C as CreateUserFormData } from '../user-D47MLFyH.js';
|
|
3
|
+
import { C as CreateLoginFormData, d as CreateRegisterFormData, e as CreateRequestPasswordResetFormData, f as CreateValidateVerificationTokenFormData, g as CreateResetPasswordFormData, h as PartnerFormData, i as AdFormData, j as CreateAdFormState, k as CreatePartnerFormData, l as AppSettingsFormData, m as CreateAppSettingsFormData, n as SchoolFormData, o as CreateSchoolFormData } from '../ad-BUYzE6zx.js';
|
|
4
|
+
import { a as AffiliateFormData, A as AffiliateType, C as CreateAffiliateFormData } from '../affiliate-C51nzKsw.js';
|
|
5
|
+
import { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs--NoohZBu.js';
|
|
10
6
|
import 'react-hook-form';
|
|
7
|
+
import '../enums/index.js';
|
|
8
|
+
import '../images/index.js';
|
|
11
9
|
|
|
12
10
|
interface PlacePrediction {
|
|
13
11
|
place_id: string;
|
|
@@ -95,6 +93,7 @@ declare const defaultVendorFormValues: VendorFormData;
|
|
|
95
93
|
declare const defaultUnregisteredVendorFormValues: UnregisteredVendorFormData;
|
|
96
94
|
declare const defaultVendorInfoFormValues: VendorInfoFormData;
|
|
97
95
|
declare const defaultAffiliateFormValues: AffiliateFormData;
|
|
96
|
+
declare function mapAffiliateToFormData(affiliate: Pick<AffiliateType, "affiliateDetails">): AffiliateFormData;
|
|
98
97
|
declare function mapBaseResourceTypeToFormData(data: BaseResourceTypeFormData): BaseResourceTypeFormData;
|
|
99
98
|
|
|
100
99
|
declare function useContactUsForm(data?: ContactUsFormData): CreateContactUsFormData;
|
|
@@ -117,4 +116,4 @@ declare function useSchoolForm(data?: SchoolFormData): CreateSchoolFormData;
|
|
|
117
116
|
|
|
118
117
|
declare function useAffiliateForm(data: AffiliateFormData): CreateAffiliateFormData;
|
|
119
118
|
|
|
120
|
-
export { type PlacePrediction, defaultAffiliateFormValues, defaultEventFormValues, defaultEventInfoFormValues, defaultLocation, defaultPartnerFormValues, defaultUnregisteredVendorFormValues, defaultVendorFormValues, defaultVendorInfoFormValues, globalDefaultValues, mapBaseResourceTypeToFormData, useAdForm, useAffiliateForm, useAppSettingsForm, useContactUsForm, useEventForm, useEventInfoForm, useLocationSearch, useLoginForm, usePartnerForm, usePostForm, useRegisterForm, useRequestPasswordResetForm, useResetPasswordForm, useSchoolForm, useUnregisteredVendorForm, useUserForm, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm };
|
|
119
|
+
export { type PlacePrediction, defaultAffiliateFormValues, defaultEventFormValues, defaultEventInfoFormValues, defaultLocation, defaultPartnerFormValues, defaultUnregisteredVendorFormValues, defaultVendorFormValues, defaultVendorInfoFormValues, globalDefaultValues, mapAffiliateToFormData, mapBaseResourceTypeToFormData, useAdForm, useAffiliateForm, useAppSettingsForm, useContactUsForm, useEventForm, useEventInfoForm, useLocationSearch, useLoginForm, usePartnerForm, usePostForm, useRegisterForm, useRequestPasswordResetForm, useResetPasswordForm, useSchoolForm, useUnregisteredVendorForm, useUserForm, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm };
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,35 +1,41 @@
|
|
|
1
|
+
import "../chunk-AYO3E4DM.mjs";
|
|
2
|
+
import "../chunk-VA5YN2K3.mjs";
|
|
3
|
+
import "../chunk-VPANTTZI.mjs";
|
|
4
|
+
import "../chunk-DWO35OY4.mjs";
|
|
5
|
+
import "../chunk-BIJ5NDXW.mjs";
|
|
1
6
|
import {
|
|
2
7
|
SCHOOL_MIN_STUDENT_COUNT,
|
|
3
8
|
isValidIrdNumber,
|
|
4
9
|
normalizeUrl
|
|
5
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-LBEJECG3.mjs";
|
|
6
11
|
import {
|
|
7
12
|
dateFormat,
|
|
8
13
|
timeFormat
|
|
9
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-SD42WIMV.mjs";
|
|
10
15
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
EnumAdShowOn,
|
|
17
|
+
EnumAdStatus,
|
|
18
|
+
EnumAdStyle,
|
|
19
|
+
EnumAdType,
|
|
20
|
+
EnumAffiliateParticipantType,
|
|
21
|
+
EnumPostContentType,
|
|
22
|
+
EnumPostType
|
|
23
|
+
} from "../chunk-ILILH7E2.mjs";
|
|
13
24
|
import "../chunk-RAYUJODN.mjs";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-DQ7ZHIXW.mjs";
|
|
26
|
+
import "../chunk-R6PCFOYO.mjs";
|
|
27
|
+
import "../chunk-32MKHJTX.mjs";
|
|
16
28
|
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
PostContentEnum,
|
|
28
|
-
PostTypeEnum,
|
|
29
|
-
ResourceTypeEnum,
|
|
30
|
-
SocialMediaEnumType,
|
|
31
|
-
VendorEnumType
|
|
32
|
-
} from "../chunk-INQCDU24.mjs";
|
|
29
|
+
EnumEventDateStatus,
|
|
30
|
+
EnumEventType,
|
|
31
|
+
EnumFoodFlavor,
|
|
32
|
+
EnumPartnerType,
|
|
33
|
+
EnumPaymentMethod,
|
|
34
|
+
EnumResourceType,
|
|
35
|
+
EnumSocialMedia,
|
|
36
|
+
EnumVendorType
|
|
37
|
+
} from "../chunk-X3OLM35T.mjs";
|
|
38
|
+
import "../chunk-NPFJ2CN2.mjs";
|
|
33
39
|
|
|
34
40
|
// src/hooks/useLocationSearch.ts
|
|
35
41
|
var handleApiError = (error, message) => {
|
|
@@ -265,7 +271,7 @@ var startTimeCannotBeInPastTest = yup.string().test(
|
|
|
265
271
|
}
|
|
266
272
|
);
|
|
267
273
|
var dateTimeSchema = yup.object().shape({
|
|
268
|
-
dateStatus: yup.mixed().oneOf(Object.values(
|
|
274
|
+
dateStatus: yup.mixed().oneOf(Object.values(EnumEventDateStatus)).required("Date status is required"),
|
|
269
275
|
endDate: yup.string().label("End Date").concat(endDateNotInPastTest).concat(endDateAfterStartDateTest).required("End date is required"),
|
|
270
276
|
endTime: yup.string().label("End Time").concat(endTimeMustBeAfterStartTimeTest).required("End time is required"),
|
|
271
277
|
startDate: yup.string().label("Start Date").concat(startDateNotInPastTest).required("Start date is required"),
|
|
@@ -292,11 +298,7 @@ var locationSchema = yup.object().shape({
|
|
|
292
298
|
2,
|
|
293
299
|
"Coordinates must contain exactly two numbers (longitude, latitude)"
|
|
294
300
|
).required("Coordinates are required"),
|
|
295
|
-
type: yup.string().
|
|
296
|
-
"is-point",
|
|
297
|
-
"Type must be 'Point'",
|
|
298
|
-
(value) => value == null || value === "Point"
|
|
299
|
-
).default("Point").required("Type is required")
|
|
301
|
+
type: yup.string().oneOf(["Point"], "Type must be 'Point'").default("Point").required("Type is required")
|
|
300
302
|
}),
|
|
301
303
|
latitude: yup.number().label("Latitude").required("Latitude is required"),
|
|
302
304
|
longitude: yup.number().label("Longitude").required("Longitude is required"),
|
|
@@ -304,7 +306,7 @@ var locationSchema = yup.object().shape({
|
|
|
304
306
|
});
|
|
305
307
|
var passwordSchema = yup.string().trim().label("Password").min(8, "Password must be at least 8 characters long").required("Password is required");
|
|
306
308
|
var socialMediaSchema = yup.object({
|
|
307
|
-
name: yup.mixed().oneOf(Object.values(
|
|
309
|
+
name: yup.mixed().oneOf(Object.values(EnumSocialMedia)).label("Social Media Name").optional(),
|
|
308
310
|
link: yup.string().when("name", {
|
|
309
311
|
is: (name) => !!name,
|
|
310
312
|
// If name has a value
|
|
@@ -364,7 +366,7 @@ var eventSchema = globalResourceSchema.shape({
|
|
|
364
366
|
return true;
|
|
365
367
|
}
|
|
366
368
|
),
|
|
367
|
-
eventType: yup2.mixed().oneOf(Object.values(
|
|
369
|
+
eventType: yup2.mixed().oneOf(Object.values(EnumEventType), "Please select a valid Event type").required("Please select an Event type"),
|
|
368
370
|
location: locationSchema,
|
|
369
371
|
nzbn: yup2.string().required("NZBN is required").matches(nzbnRegex, "NZBN must be 13 digits and start with 94"),
|
|
370
372
|
rainOrShine: yup2.boolean().label("Rain or Shine").required("Please specify if the event is rain or shine"),
|
|
@@ -372,16 +374,16 @@ var eventSchema = globalResourceSchema.shape({
|
|
|
372
374
|
});
|
|
373
375
|
var paymentInfoSchema = yup2.object({
|
|
374
376
|
paymentMethod: yup2.mixed().oneOf(
|
|
375
|
-
Object.values(
|
|
377
|
+
Object.values(EnumPaymentMethod),
|
|
376
378
|
"Please select a valid Payment method"
|
|
377
379
|
).required("Please select a Payment method"),
|
|
378
380
|
accountHolderName: yup2.string().when("paymentMethod", {
|
|
379
|
-
is: "bank_transfer" /*
|
|
381
|
+
is: "bank_transfer" /* BANK_TRANSFER */,
|
|
380
382
|
then: (schema) => schema.required("Account holder name is required for bank transfer").trim(),
|
|
381
383
|
otherwise: (schema) => schema.notRequired()
|
|
382
384
|
}),
|
|
383
385
|
accountNumber: yup2.string().when("paymentMethod", {
|
|
384
|
-
is: "bank_transfer" /*
|
|
386
|
+
is: "bank_transfer" /* BANK_TRANSFER */,
|
|
385
387
|
then: (schema) => schema.required("Account number is required for bank transfer").matches(
|
|
386
388
|
nzBankAccountRegex,
|
|
387
389
|
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
@@ -389,7 +391,7 @@ var paymentInfoSchema = yup2.object({
|
|
|
389
391
|
otherwise: (schema) => schema.notRequired()
|
|
390
392
|
}),
|
|
391
393
|
link: yup2.string().when("paymentMethod", {
|
|
392
|
-
is: (val) => val === "paypal" /*
|
|
394
|
+
is: (val) => val === "paypal" /* PAYPAL */ || val === "stripe" /* STRIPE */,
|
|
393
395
|
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
394
396
|
otherwise: (schema) => schema.notRequired()
|
|
395
397
|
})
|
|
@@ -439,7 +441,7 @@ var vendorSchema = globalResourceSchema.shape({
|
|
|
439
441
|
active: yup3.boolean().nullable().optional(),
|
|
440
442
|
productsList: yup3.array().of(vendorMenuSchema).nullable().optional()
|
|
441
443
|
}).nullable().optional(),
|
|
442
|
-
vendorType: yup3.mixed().oneOf(Object.values(
|
|
444
|
+
vendorType: yup3.mixed().oneOf(Object.values(EnumVendorType)).required("Please select a Vendor type")
|
|
443
445
|
});
|
|
444
446
|
var unregisteredVendorSchema = yup3.object().shape({
|
|
445
447
|
categoryIds: yup3.array().of(yup3.string().defined()).min(1, "Category list must contain at least one item").required("Categories are required"),
|
|
@@ -452,7 +454,7 @@ var unregisteredVendorSchema = yup3.object().shape({
|
|
|
452
454
|
var vendorInfoSchema = yup3.object().shape({
|
|
453
455
|
product: yup3.object().shape({
|
|
454
456
|
foodFlavors: yup3.array().of(
|
|
455
|
-
yup3.mixed().oneOf(Object.values(
|
|
457
|
+
yup3.mixed().oneOf(Object.values(EnumFoodFlavor), "Invalid flavor selected").required("Flavor is required")
|
|
456
458
|
).min(1, "Food flavors list must contain at least one item").required("Food flavors are required"),
|
|
457
459
|
packaging: yup3.array().of(yup3.string().defined()).min(1, "Packaging list must contain at least one item").required("Packaging is required"),
|
|
458
460
|
priceRange: yup3.object().shape({
|
|
@@ -587,13 +589,13 @@ import * as yup6 from "yup";
|
|
|
587
589
|
var adResourceSchema = yup6.object({
|
|
588
590
|
adDescription: yup6.string().trim().required("Ad description is required").max(150, "Ad description must be at most 150 characters"),
|
|
589
591
|
adImage: yup6.string().required("Ad image is required"),
|
|
590
|
-
adStyle: yup6.mixed().oneOf(Object.values(
|
|
592
|
+
adStyle: yup6.mixed().oneOf(Object.values(EnumAdStyle), "Please select a valid ad style").required("Ad style is required"),
|
|
591
593
|
adTitle: yup6.string().trim().required("Ad title is required").max(30, "Ad title must be at most 30 characters"),
|
|
592
|
-
adType: yup6.mixed().oneOf(Object.values(
|
|
594
|
+
adType: yup6.mixed().oneOf(Object.values(EnumAdType), "Please select a valid ad type").required("Ad type is required"),
|
|
593
595
|
resourceId: yup6.string().required("Resource ID is required"),
|
|
594
596
|
resourceName: yup6.string().required("Resource name is required"),
|
|
595
597
|
resourceRegion: yup6.string().required("Resource region is required"),
|
|
596
|
-
resourceType: yup6.mixed().oneOf(Object.values(
|
|
598
|
+
resourceType: yup6.mixed().oneOf(Object.values(EnumResourceType), "Please select Event or Vendor").required("Resource type is required"),
|
|
597
599
|
resourceSlug: yup6.string().required("Resource slug is required")
|
|
598
600
|
});
|
|
599
601
|
var adSchema = yup6.object().shape({
|
|
@@ -616,10 +618,10 @@ var adSchema = yup6.object().shape({
|
|
|
616
618
|
)
|
|
617
619
|
}),
|
|
618
620
|
resource: adResourceSchema.required("Resource information is required"),
|
|
619
|
-
showOn: yup6.array().of(yup6.mixed().oneOf(Object.values(
|
|
620
|
-
status: yup6.mixed().oneOf(Object.values(
|
|
621
|
+
showOn: yup6.array().of(yup6.mixed().oneOf(Object.values(EnumAdShowOn)).required()).min(1, "At least one display location is required").required("Display location is required"),
|
|
622
|
+
status: yup6.mixed().oneOf(Object.values(EnumAdStatus)).required("Ad status is required"),
|
|
621
623
|
start: yup6.date().when("status", {
|
|
622
|
-
is: (status) => status !== "Active" /*
|
|
624
|
+
is: (status) => status !== "Active" /* ACTIVE */,
|
|
623
625
|
then: () => yup6.date().required("Start date is required").test("is-future-date", "Start date must be in the future", (value) => {
|
|
624
626
|
if (!value) return false;
|
|
625
627
|
return value > /* @__PURE__ */ new Date();
|
|
@@ -635,7 +637,7 @@ import * as yup7 from "yup";
|
|
|
635
637
|
var partnerSchema = globalResourceSchema.shape({
|
|
636
638
|
location: locationSchema,
|
|
637
639
|
nzbn: yup7.string().required("NZBN is required").matches(nzbnRegex, "NZBN must be 13 digits and start with 94"),
|
|
638
|
-
partnerType: yup7.mixed().oneOf(Object.values(
|
|
640
|
+
partnerType: yup7.mixed().oneOf(Object.values(EnumPartnerType), "Please select a valid Partner type").required("Please select a Partner type")
|
|
639
641
|
});
|
|
640
642
|
|
|
641
643
|
// src/yupSchema/post.ts
|
|
@@ -643,18 +645,18 @@ import * as yup8 from "yup";
|
|
|
643
645
|
var postContentSchema = yup8.object().shape({
|
|
644
646
|
contentData: yup8.mixed().optional().nullable(),
|
|
645
647
|
contentOrder: yup8.number().nullable(),
|
|
646
|
-
contentType: yup8.mixed().oneOf(Object.values(
|
|
648
|
+
contentType: yup8.mixed().oneOf(Object.values(EnumPostContentType)).nullable()
|
|
647
649
|
});
|
|
648
650
|
var postSchema = yup8.object().shape({
|
|
649
651
|
active: yup8.boolean().required(),
|
|
650
652
|
caption: yup8.string().required(),
|
|
651
653
|
content: yup8.array().of(postContentSchema).required(),
|
|
652
|
-
postType: yup8.mixed().oneOf(Object.values(
|
|
654
|
+
postType: yup8.mixed().oneOf(Object.values(EnumPostType)).required(),
|
|
653
655
|
resource: yup8.object({
|
|
654
656
|
resourceId: yup8.string().required(),
|
|
655
657
|
resourceRegion: yup8.string().required(),
|
|
656
658
|
resourceSlug: yup8.string().required(),
|
|
657
|
-
resourceType: yup8.mixed().oneOf(Object.values(
|
|
659
|
+
resourceType: yup8.mixed().oneOf(Object.values(EnumResourceType)).required()
|
|
658
660
|
}).nullable().optional(),
|
|
659
661
|
tags: yup8.array().of(yup8.string().required()).nullable().optional(),
|
|
660
662
|
title: yup8.string().required()
|
|
@@ -753,7 +755,7 @@ var defaultVendorFormValues = {
|
|
|
753
755
|
foodTruck: false,
|
|
754
756
|
products: null,
|
|
755
757
|
unregisteredVendorId: null,
|
|
756
|
-
vendorType: "Stallholder" /*
|
|
758
|
+
vendorType: "Stallholder" /* STALLHOLDER */
|
|
757
759
|
};
|
|
758
760
|
var defaultUnregisteredVendorFormValues = {
|
|
759
761
|
categoryIds: [],
|
|
@@ -797,6 +799,22 @@ var defaultAffiliateFormValues = {
|
|
|
797
799
|
socialMedia: null,
|
|
798
800
|
termsAgreement: null
|
|
799
801
|
};
|
|
802
|
+
function mapAffiliateToFormData(affiliate) {
|
|
803
|
+
return {
|
|
804
|
+
bankAccountDetails: affiliate.affiliateDetails?.bankAccountDetails ?? {
|
|
805
|
+
accountHolderName: "",
|
|
806
|
+
accountNumber: ""
|
|
807
|
+
},
|
|
808
|
+
contactDetails: affiliate.affiliateDetails?.contactDetails ?? {
|
|
809
|
+
mobilePhone: ""
|
|
810
|
+
},
|
|
811
|
+
irdNumber: affiliate.affiliateDetails?.irdNumber ?? "",
|
|
812
|
+
location: affiliate.affiliateDetails?.location ?? defaultLocation,
|
|
813
|
+
participantType: affiliate.affiliateDetails?.participantType ?? "",
|
|
814
|
+
socialMedia: affiliate.affiliateDetails?.socialMedia ?? null,
|
|
815
|
+
termsAgreement: affiliate.affiliateDetails?.termsAgreement ?? null
|
|
816
|
+
};
|
|
817
|
+
}
|
|
800
818
|
function mapBaseResourceTypeToFormData(data) {
|
|
801
819
|
return {
|
|
802
820
|
_id: data._id,
|
|
@@ -1551,19 +1569,19 @@ var defaultValues8 = {
|
|
|
1551
1569
|
resource: {
|
|
1552
1570
|
adDescription: "",
|
|
1553
1571
|
adImage: "",
|
|
1554
|
-
adStyle: ""
|
|
1572
|
+
adStyle: "Bloom" /* BLOOM */,
|
|
1555
1573
|
adTitle: "",
|
|
1556
|
-
adType: ""
|
|
1574
|
+
adType: "Sponsored" /* SPONSORED */,
|
|
1557
1575
|
resourceId: "",
|
|
1558
1576
|
resourceName: "",
|
|
1559
1577
|
resourceRegion: "",
|
|
1560
1578
|
resourceSlug: "",
|
|
1561
|
-
resourceType: ""
|
|
1579
|
+
resourceType: "event" /* EVENT */
|
|
1562
1580
|
},
|
|
1563
|
-
showOn: ["Front_page" /*
|
|
1581
|
+
showOn: ["Front_page" /* FRONT_PAGE */],
|
|
1564
1582
|
// `start` is only required (and must be future) when status !== ACTIVE.
|
|
1565
1583
|
start: void 0,
|
|
1566
|
-
status: "Active" /*
|
|
1584
|
+
status: "Active" /* ACTIVE */,
|
|
1567
1585
|
targetRegion: []
|
|
1568
1586
|
};
|
|
1569
1587
|
function useAdForm(data) {
|
|
@@ -1964,7 +1982,7 @@ var affiliateSchema = yup12.object().shape({
|
|
|
1964
1982
|
),
|
|
1965
1983
|
location: locationSchema.required("Location is required"),
|
|
1966
1984
|
participantType: yup12.mixed().oneOf(
|
|
1967
|
-
Object.values(
|
|
1985
|
+
Object.values(EnumAffiliateParticipantType),
|
|
1968
1986
|
"Please select a valid participant type"
|
|
1969
1987
|
).required("Participant type is required"),
|
|
1970
1988
|
socialMedia: yup12.array().of(socialMediaSchema).nullable().default(null)
|
|
@@ -2037,7 +2055,7 @@ export {
|
|
|
2037
2055
|
defaultVendorFormValues,
|
|
2038
2056
|
defaultVendorInfoFormValues,
|
|
2039
2057
|
globalDefaultValues,
|
|
2040
|
-
|
|
2058
|
+
mapAffiliateToFormData,
|
|
2041
2059
|
mapBaseResourceTypeToFormData,
|
|
2042
2060
|
useAdForm,
|
|
2043
2061
|
useAffiliateForm,
|