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