@timardex/cluemart-shared 1.5.784 → 1.5.786
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-DTYfndpt.d.ts → affiliate-BEePbi9S.d.ts} +15 -4
- package/dist/{affiliate-CmM8wWML.d.mts → affiliate-DOhfbYFj.d.mts} +15 -4
- package/dist/{chunk-QMNC5R4O.mjs → chunk-E4KHWSQE.mjs} +1 -1
- package/dist/{chunk-QMNC5R4O.mjs.map → chunk-E4KHWSQE.mjs.map} +1 -1
- package/dist/{chunk-ZQ6ENPBG.mjs → chunk-QFGYDBE7.mjs} +2 -2
- package/dist/{chunk-HMLNWBOQ.mjs → chunk-RTF7BGNH.mjs} +2 -2
- package/dist/{chunk-ZROT2ZU7.mjs → chunk-RUM5PJHN.mjs} +2 -2
- package/dist/{chunk-W7W7X6WH.mjs → chunk-YYRWWHUW.mjs} +21 -1
- package/dist/{chunk-W7W7X6WH.mjs.map → chunk-YYRWWHUW.mjs.map} +1 -1
- package/dist/formFields/index.mjs +3 -3
- package/dist/graphql/index.cjs +20 -0
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +1 -1
- package/dist/graphql/index.d.ts +1 -1
- package/dist/graphql/index.mjs +1 -1
- package/dist/hooks/index.cjs +96 -5
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +4 -1
- package/dist/hooks/index.d.ts +4 -1
- package/dist/hooks/index.mjs +80 -10
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +20 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.mjs +20 -0
- package/dist/index.mjs.map +1 -1
- package/dist/sharing/index.mjs +3 -3
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.mjs +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/{chunk-ZQ6ENPBG.mjs.map → chunk-QFGYDBE7.mjs.map} +0 -0
- /package/dist/{chunk-HMLNWBOQ.mjs.map → chunk-RTF7BGNH.mjs.map} +0 -0
- /package/dist/{chunk-ZROT2ZU7.mjs.map → chunk-RUM5PJHN.mjs.map} +0 -0
package/dist/graphql/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { EnumResourceType, EnumEventDateStatus } from '../enums/index.mjs';
|
|
|
4
4
|
import { A as AuthPayloadType, R as RefreshTokenPayloadType, S as SafeUserType, a as RedeemRewardResponse, P as PartnerType, b as ResourceByUser, c as AdType, E as EnumAdStatus, d as SubscriptionPlansResponse, e as SubscriptionStatusData, f as AppSettingsType, g as SchoolReturnType, h as SchoolType } from '../ad-kAjUceeE.mjs';
|
|
5
5
|
import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-zczOntNk.mjs';
|
|
6
6
|
import { E as EventType, c as EventListItemType, d as EventInfoType, U as UseGetResourcesByRegionOptions, e as RelationType, f as ResourceConnectionsType, g as UnregisteredVendorType, V as VendorType, h as VendorInfoType, i as UserLicenceType, P as PostType, j as EnumPostType, G as GameDocType, k as GameLeaderboard } from '../global-BUUfmCo7.mjs';
|
|
7
|
-
import { A as AffiliateType } from '../affiliate-
|
|
7
|
+
import { A as AffiliateType } from '../affiliate-DOhfbYFj.mjs';
|
|
8
8
|
import '../images/index.mjs';
|
|
9
9
|
import 'react-hook-form';
|
|
10
10
|
|
package/dist/graphql/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { EnumResourceType, EnumEventDateStatus } from '../enums/index.js';
|
|
|
4
4
|
import { A as AuthPayloadType, R as RefreshTokenPayloadType, S as SafeUserType, a as RedeemRewardResponse, P as PartnerType, b as ResourceByUser, c as AdType, E as EnumAdStatus, d as SubscriptionPlansResponse, e as SubscriptionStatusData, f as AppSettingsType, g as SchoolReturnType, h as SchoolType } from '../ad-BmDOVKmE.js';
|
|
5
5
|
import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-BL_12IAo.js';
|
|
6
6
|
import { E as EventType, c as EventListItemType, d as EventInfoType, U as UseGetResourcesByRegionOptions, e as RelationType, f as ResourceConnectionsType, g as UnregisteredVendorType, V as VendorType, h as VendorInfoType, i as UserLicenceType, P as PostType, j as EnumPostType, G as GameDocType, k as GameLeaderboard } from '../global-fKbMmluy.js';
|
|
7
|
-
import { A as AffiliateType } from '../affiliate-
|
|
7
|
+
import { A as AffiliateType } from '../affiliate-BEePbi9S.js';
|
|
8
8
|
import '../images/index.js';
|
|
9
9
|
import 'react-hook-form';
|
|
10
10
|
|
package/dist/graphql/index.mjs
CHANGED
package/dist/hooks/index.cjs
CHANGED
|
@@ -40,6 +40,7 @@ __export(hooks_exports, {
|
|
|
40
40
|
globalDefaultValues: () => globalDefaultValues,
|
|
41
41
|
mapBaseResourceTypeToFormData: () => mapBaseResourceTypeToFormData,
|
|
42
42
|
useAdForm: () => useAdForm,
|
|
43
|
+
useAffiliateForm: () => useAffiliateForm,
|
|
43
44
|
useAppSettingsForm: () => useAppSettingsForm,
|
|
44
45
|
useContactUsForm: () => useContactUsForm,
|
|
45
46
|
useEventForm: () => useEventForm,
|
|
@@ -1903,7 +1904,7 @@ var vendorInfoSchema = yup3.object().shape({
|
|
|
1903
1904
|
max: yup3.string().required("Max price is required").test(
|
|
1904
1905
|
"is-number",
|
|
1905
1906
|
"Max price must be a valid number",
|
|
1906
|
-
(value) => value !== void 0 && value !== "" && !isNaN(Number(value))
|
|
1907
|
+
(value) => value !== void 0 && value !== "" && !Number.isNaN(Number(value))
|
|
1907
1908
|
).test(
|
|
1908
1909
|
"is-greater",
|
|
1909
1910
|
"Max price must be greater than or equal to Min price",
|
|
@@ -1912,14 +1913,14 @@ var vendorInfoSchema = yup3.object().shape({
|
|
|
1912
1913
|
if (!max || !min) return true;
|
|
1913
1914
|
const maxNum = Number(max);
|
|
1914
1915
|
const minNum = Number(min);
|
|
1915
|
-
if (isNaN(maxNum) || isNaN(minNum)) return true;
|
|
1916
|
+
if (Number.isNaN(maxNum) || Number.isNaN(minNum)) return true;
|
|
1916
1917
|
return maxNum >= minNum;
|
|
1917
1918
|
}
|
|
1918
1919
|
),
|
|
1919
1920
|
min: yup3.string().required("Min price is required").test(
|
|
1920
1921
|
"is-number",
|
|
1921
1922
|
"Min price must be a valid number",
|
|
1922
|
-
(value) => value !== void 0 && value !== "" && !isNaN(Number(value))
|
|
1923
|
+
(value) => value !== void 0 && value !== "" && !Number.isNaN(Number(value))
|
|
1923
1924
|
)
|
|
1924
1925
|
}),
|
|
1925
1926
|
producedIn: yup3.array().of(yup3.string().defined()).min(1, "Produced in list must contain at least one item").required("Produced in is required")
|
|
@@ -1961,7 +1962,7 @@ var vendorInfoSchema = yup3.object().shape({
|
|
|
1961
1962
|
depth: yup3.string().required("Depth is required").test(
|
|
1962
1963
|
"is-number",
|
|
1963
1964
|
"Depth must be a valid number",
|
|
1964
|
-
(value) => value !== void 0 && value !== "" && !isNaN(Number(value))
|
|
1965
|
+
(value) => value !== void 0 && value !== "" && !Number.isNaN(Number(value))
|
|
1965
1966
|
).test(
|
|
1966
1967
|
"is-positive",
|
|
1967
1968
|
"Depth must be greater than 0",
|
|
@@ -1970,7 +1971,7 @@ var vendorInfoSchema = yup3.object().shape({
|
|
|
1970
1971
|
width: yup3.string().required("Width is required").test(
|
|
1971
1972
|
"is-number",
|
|
1972
1973
|
"Width must be a valid number",
|
|
1973
|
-
(value) => value !== void 0 && value !== "" && !isNaN(Number(value))
|
|
1974
|
+
(value) => value !== void 0 && value !== "" && !Number.isNaN(Number(value))
|
|
1974
1975
|
).test(
|
|
1975
1976
|
"is-positive",
|
|
1976
1977
|
"Width must be greater than 0",
|
|
@@ -5017,11 +5018,30 @@ var AFFILIATE_RESOURCE_FIELDS_FRAGMENT = import_client74.gql`
|
|
|
5017
5018
|
}
|
|
5018
5019
|
${AFFILIATE_REWARD_FIELDS_FRAGMENT}
|
|
5019
5020
|
`;
|
|
5021
|
+
var AFFILIATE_DETAILS_FIELDS_FRAGMENT = import_client74.gql`
|
|
5022
|
+
fragment AffiliateDetailsFields on AffiliateDetailsType {
|
|
5023
|
+
contactDetails {
|
|
5024
|
+
mobilePhone
|
|
5025
|
+
}
|
|
5026
|
+
region
|
|
5027
|
+
socialMedia {
|
|
5028
|
+
...SocialMediaFields
|
|
5029
|
+
}
|
|
5030
|
+
termsAgreement {
|
|
5031
|
+
...TermsAgreementFields
|
|
5032
|
+
}
|
|
5033
|
+
}
|
|
5034
|
+
${SOCIAL_MEDIA_FIELDS_FRAGMENT}
|
|
5035
|
+
${TERMS_AGREEMENT_FIELDS_FRAGMENT}
|
|
5036
|
+
`;
|
|
5020
5037
|
var AFFILIATE_FIELDS_FRAGMENT = import_client74.gql`
|
|
5021
5038
|
fragment AffiliateFields on AffiliateType {
|
|
5022
5039
|
_id
|
|
5023
5040
|
active
|
|
5024
5041
|
affiliateCode
|
|
5042
|
+
affiliateDetails {
|
|
5043
|
+
...AffiliateDetailsFields
|
|
5044
|
+
}
|
|
5025
5045
|
affiliateResources {
|
|
5026
5046
|
...AffiliateResourceFields
|
|
5027
5047
|
}
|
|
@@ -5033,6 +5053,7 @@ var AFFILIATE_FIELDS_FRAGMENT = import_client74.gql`
|
|
|
5033
5053
|
}
|
|
5034
5054
|
updatedAt
|
|
5035
5055
|
}
|
|
5056
|
+
${AFFILIATE_DETAILS_FIELDS_FRAGMENT}
|
|
5036
5057
|
${AFFILIATE_RESOURCE_FIELDS_FRAGMENT}
|
|
5037
5058
|
${OWNER_FIELDS_FRAGMENT}
|
|
5038
5059
|
`;
|
|
@@ -6485,6 +6506,75 @@ function useSchoolForm(data) {
|
|
|
6485
6506
|
watch
|
|
6486
6507
|
};
|
|
6487
6508
|
}
|
|
6509
|
+
|
|
6510
|
+
// src/hooks/useAffiliateForm.ts
|
|
6511
|
+
var import_yup18 = require("@hookform/resolvers/yup");
|
|
6512
|
+
var import_react6 = require("react");
|
|
6513
|
+
var import_react_hook_form18 = require("react-hook-form");
|
|
6514
|
+
|
|
6515
|
+
// src/yupSchema/affiliate.ts
|
|
6516
|
+
var yup12 = __toESM(require("yup"));
|
|
6517
|
+
var affiliateContactDetailsSchema = yup12.object({
|
|
6518
|
+
mobilePhone: yup12.string().trim().required("Mobile phone is required").test(
|
|
6519
|
+
"mobile-phone",
|
|
6520
|
+
"Mobile must start with 02 and be 9\u201311 digits",
|
|
6521
|
+
(value) => mobileRegex.test(value)
|
|
6522
|
+
)
|
|
6523
|
+
});
|
|
6524
|
+
var affiliateSchema = yup12.object().shape({
|
|
6525
|
+
contactDetails: affiliateContactDetailsSchema.nullable().default(null).test(
|
|
6526
|
+
"contact-details-required",
|
|
6527
|
+
"Mobile phone is required",
|
|
6528
|
+
(value) => Boolean(value?.mobilePhone?.trim())
|
|
6529
|
+
),
|
|
6530
|
+
region: yup12.string().trim().required("Region is required"),
|
|
6531
|
+
socialMedia: yup12.array().of(socialMediaSchema).nullable().default(null)
|
|
6532
|
+
});
|
|
6533
|
+
|
|
6534
|
+
// src/hooks/useAffiliateForm.ts
|
|
6535
|
+
var defaultAffiliateFormValues = {
|
|
6536
|
+
contactDetails: null,
|
|
6537
|
+
region: "",
|
|
6538
|
+
socialMedia: [],
|
|
6539
|
+
termsAgreement: null
|
|
6540
|
+
};
|
|
6541
|
+
function useAffiliateForm(data) {
|
|
6542
|
+
const {
|
|
6543
|
+
control,
|
|
6544
|
+
formState,
|
|
6545
|
+
getValues,
|
|
6546
|
+
handleSubmit,
|
|
6547
|
+
reset,
|
|
6548
|
+
setValue,
|
|
6549
|
+
watch
|
|
6550
|
+
} = (0, import_react_hook_form18.useForm)({
|
|
6551
|
+
defaultValues: defaultAffiliateFormValues,
|
|
6552
|
+
resolver: (0, import_yup18.yupResolver)(affiliateSchema)
|
|
6553
|
+
});
|
|
6554
|
+
(0, import_react6.useEffect)(() => {
|
|
6555
|
+
if (data) {
|
|
6556
|
+
reset({
|
|
6557
|
+
contactDetails: data.contactDetails,
|
|
6558
|
+
region: data.region,
|
|
6559
|
+
socialMedia: data.socialMedia,
|
|
6560
|
+
termsAgreement: data.termsAgreement
|
|
6561
|
+
});
|
|
6562
|
+
} else {
|
|
6563
|
+
reset(defaultAffiliateFormValues);
|
|
6564
|
+
}
|
|
6565
|
+
}, [data, reset]);
|
|
6566
|
+
const { contactDetails, region, socialMedia: socialMedia2, termsAgreement } = getValues();
|
|
6567
|
+
return {
|
|
6568
|
+
control,
|
|
6569
|
+
fields: { contactDetails, region, socialMedia: socialMedia2, termsAgreement },
|
|
6570
|
+
formState,
|
|
6571
|
+
getValues,
|
|
6572
|
+
handleSubmit,
|
|
6573
|
+
reset,
|
|
6574
|
+
setValue,
|
|
6575
|
+
watch
|
|
6576
|
+
};
|
|
6577
|
+
}
|
|
6488
6578
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6489
6579
|
0 && (module.exports = {
|
|
6490
6580
|
defaultEventFormValues,
|
|
@@ -6497,6 +6587,7 @@ function useSchoolForm(data) {
|
|
|
6497
6587
|
globalDefaultValues,
|
|
6498
6588
|
mapBaseResourceTypeToFormData,
|
|
6499
6589
|
useAdForm,
|
|
6590
|
+
useAffiliateForm,
|
|
6500
6591
|
useAppSettingsForm,
|
|
6501
6592
|
useContactUsForm,
|
|
6502
6593
|
useEventForm,
|