@timardex/cluemart-shared 2.2.30 → 2.2.41
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-C4L_-r-4.d.ts → ad-CdehhMyb.d.ts} +2 -2
- package/dist/{ad-XtBAH4rD.d.mts → ad-Drhn_Azy.d.mts} +2 -2
- package/dist/{affiliate-CxZHVZb2.d.ts → affiliate-Cd78p2Fz.d.mts} +3 -3
- package/dist/{affiliate-D-L_UtL8.d.mts → affiliate-CdIL0r2o.d.ts} +3 -3
- package/dist/auth/index.cjs +10 -1
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.d.mts +3 -3
- package/dist/auth/index.d.ts +3 -3
- package/dist/auth/index.mjs +2 -2
- package/dist/{chunk-J5N3IEGR.mjs → chunk-2GUAD63W.mjs} +3 -3
- package/dist/{chunk-IKRXLKJ3.mjs → chunk-5AAYX364.mjs} +1 -1
- package/dist/{chunk-IKRXLKJ3.mjs.map → chunk-5AAYX364.mjs.map} +1 -1
- package/dist/{chunk-LLP7OWX5.mjs → chunk-MKHXXZWF.mjs} +2 -2
- package/dist/{chunk-YFFCHTJS.mjs → chunk-PJY7OAQ2.mjs} +18 -23
- package/dist/{chunk-YFFCHTJS.mjs.map → chunk-PJY7OAQ2.mjs.map} +1 -1
- package/dist/{chunk-MQHX5BD6.mjs → chunk-QIF4ZGMY.mjs} +2 -2
- package/dist/{chunk-BR4XNXE7.mjs → chunk-TKSBCN3N.mjs} +11 -2
- package/dist/chunk-TKSBCN3N.mjs.map +1 -0
- package/dist/{chunk-NRNLARYC.mjs → chunk-VHNCSCQU.mjs} +37 -35
- package/dist/chunk-VHNCSCQU.mjs.map +1 -0
- package/dist/{chunk-U3KUTQ43.mjs → chunk-XGGFB7HY.mjs} +11 -2
- package/dist/{chunk-U3KUTQ43.mjs.map → chunk-XGGFB7HY.mjs.map} +1 -1
- package/dist/{contactUs-CwHKoGEt.d.mts → contactUs-BJPQ5nKc.d.mts} +1 -1
- package/dist/{contactUs-CR-nghbk.d.ts → contactUs-ITiB1XV4.d.ts} +1 -1
- package/dist/enums/index.cjs +10 -0
- package/dist/enums/index.cjs.map +1 -1
- package/dist/enums/index.d.mts +8 -1
- package/dist/enums/index.d.ts +8 -1
- package/dist/enums/index.mjs +3 -1
- package/dist/formFields/index.cjs +4 -4
- 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 +5 -5
- package/dist/{global-B4mmQo6R.d.ts → global-DlC7W4p7.d.ts} +9 -0
- package/dist/{global-D1r5ZuQO.d.mts → global-XUBcgjNc.d.mts} +9 -0
- package/dist/graphql/index.cjs +10 -1
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +5 -5
- package/dist/graphql/index.d.ts +5 -5
- package/dist/graphql/index.mjs +3 -3
- package/dist/hooks/index.cjs +14 -5
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +5 -5
- package/dist/hooks/index.d.ts +5 -5
- package/dist/hooks/index.mjs +8 -8
- package/dist/index.cjs +73 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +65 -25
- package/dist/index.d.ts +65 -25
- package/dist/index.mjs +68 -53
- package/dist/index.mjs.map +1 -1
- package/dist/map/index.d.mts +1 -1
- package/dist/map/index.d.ts +1 -1
- package/dist/region/index.cjs.map +1 -1
- package/dist/region/index.d.mts +1 -1
- package/dist/region/index.d.ts +1 -1
- package/dist/region/index.mjs +1 -1
- package/dist/{resourceActivities-Uz9uavhK.d.ts → resourceActivities-C8eIfpKl.d.ts} +1 -1
- package/dist/{resourceActivities-DUReu_jD.d.mts → resourceActivities-Ci12UkJU.d.mts} +1 -1
- package/dist/sharing/index.cjs +4 -25
- package/dist/sharing/index.cjs.map +1 -1
- package/dist/sharing/index.d.mts +3 -22
- package/dist/sharing/index.d.ts +3 -22
- package/dist/sharing/index.mjs +3 -9
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +7 -7
- package/dist/types/index.d.ts +7 -7
- package/dist/types/index.mjs +2 -2
- package/dist/{user-BpR-FTW2.d.mts → user-BSFExFvl.d.ts} +18 -4
- package/dist/{user-IR0bHKFb.d.ts → user-D31zAVuz.d.mts} +18 -4
- package/dist/utils/index.cjs +53 -36
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +36 -7
- package/dist/utils/index.d.ts +36 -7
- package/dist/utils/index.mjs +12 -8
- package/package.json +1 -1
- package/dist/chunk-BR4XNXE7.mjs.map +0 -1
- package/dist/chunk-NRNLARYC.mjs.map +0 -1
- /package/dist/{chunk-J5N3IEGR.mjs.map → chunk-2GUAD63W.mjs.map} +0 -0
- /package/dist/{chunk-LLP7OWX5.mjs.map → chunk-MKHXXZWF.mjs.map} +0 -0
- /package/dist/{chunk-MQHX5BD6.mjs.map → chunk-QIF4ZGMY.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -263,6 +263,14 @@ var EnumReward = /* @__PURE__ */ ((EnumReward2) => {
|
|
|
263
263
|
EnumReward2["MYSTERY_DELUXE_BOX"] = "mystery_deluxe_box";
|
|
264
264
|
return EnumReward2;
|
|
265
265
|
})(EnumReward || {});
|
|
266
|
+
var EnumPointType = /* @__PURE__ */ ((EnumPointType2) => {
|
|
267
|
+
EnumPointType2["DAILY_CLUE_GAME"] = "daily_clue_game";
|
|
268
|
+
EnumPointType2["EVENT_CHECKIN"] = "event_checkin";
|
|
269
|
+
EnumPointType2["INITIAL"] = "initial";
|
|
270
|
+
EnumPointType2["MINI_QUIZ_GAME"] = "mini_quiz_game";
|
|
271
|
+
EnumPointType2["ODD_ONE_OUT_GAME"] = "odd_one_out_game";
|
|
272
|
+
return EnumPointType2;
|
|
273
|
+
})(EnumPointType || {});
|
|
266
274
|
|
|
267
275
|
// src/formFields/vendor/vendor.ts
|
|
268
276
|
var vendorBasicInfoFields = [
|
|
@@ -812,6 +820,18 @@ function sortDatesChronologically(dates) {
|
|
|
812
820
|
return 0;
|
|
813
821
|
});
|
|
814
822
|
}
|
|
823
|
+
function getUniqueStartDates(dates) {
|
|
824
|
+
const seenStartDates = /* @__PURE__ */ new Set();
|
|
825
|
+
const uniqueStartDates = [];
|
|
826
|
+
for (const { startDate } of sortDatesChronologically(dates ?? [])) {
|
|
827
|
+
if (!startDate || seenStartDates.has(startDate)) {
|
|
828
|
+
continue;
|
|
829
|
+
}
|
|
830
|
+
seenStartDates.add(startDate);
|
|
831
|
+
uniqueStartDates.push(startDate);
|
|
832
|
+
}
|
|
833
|
+
return uniqueStartDates;
|
|
834
|
+
}
|
|
815
835
|
var futureTimePeriods = FUTURE_EVENT_DATE_STATUSES.filter(
|
|
816
836
|
(status) => status !== "Starting_Soon" /* STARTING_SOON */
|
|
817
837
|
).map((status) => ({
|
|
@@ -1047,14 +1067,14 @@ var POST_SHARE_RESOURCE_TYPES = [
|
|
|
1047
1067
|
var SHARE_RESOURCE_LABEL = {
|
|
1048
1068
|
[RELATION_SHARE_APPLICATION]: "Application",
|
|
1049
1069
|
[RELATION_SHARE_INVITATION]: "Invitation",
|
|
1070
|
+
affiliate: "Affiliate",
|
|
1050
1071
|
clue_bites: "Clue Bites",
|
|
1051
1072
|
market_faces: "Market Faces",
|
|
1052
|
-
play_and_win: "Play & Win",
|
|
1053
1073
|
market: "Market",
|
|
1054
1074
|
partner: "Partner",
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1075
|
+
play_and_win: "Play & Win",
|
|
1076
|
+
school: "School",
|
|
1077
|
+
stallholder: "Stallholder"
|
|
1058
1078
|
};
|
|
1059
1079
|
function isPostShareResourceType(resourceType) {
|
|
1060
1080
|
return POST_SHARE_RESOURCE_TYPES.includes(
|
|
@@ -1094,16 +1114,6 @@ function normalizeShareText(value) {
|
|
|
1094
1114
|
return leading + rest;
|
|
1095
1115
|
}).join("\n").replace(/\n{3,}/g, "\n\n");
|
|
1096
1116
|
}
|
|
1097
|
-
function shareMessageFooterPlacementForType(_shareType) {
|
|
1098
|
-
return "before-body";
|
|
1099
|
-
}
|
|
1100
|
-
function buildShareMessageSections(input) {
|
|
1101
|
-
const title = normalizeShareText(input.title);
|
|
1102
|
-
const description = normalizeShareText(input.description);
|
|
1103
|
-
return [SHARE_MORE_INFO_LINE, title, description].filter(
|
|
1104
|
-
(section) => section.length > 0
|
|
1105
|
-
);
|
|
1106
|
-
}
|
|
1107
1117
|
function splitShareDescriptionSections(value) {
|
|
1108
1118
|
const trimmed = normalizeShareText(value);
|
|
1109
1119
|
if (!trimmed) {
|
|
@@ -1120,11 +1130,6 @@ function splitShareDescriptionSections(value) {
|
|
|
1120
1130
|
function normalizeShareOgDescription(value) {
|
|
1121
1131
|
return joinShareOgDescriptionSections(splitShareDescriptionSections(value));
|
|
1122
1132
|
}
|
|
1123
|
-
function buildFacebookShareQuote(title, description, shareType) {
|
|
1124
|
-
const sections = buildShareMessageSections({ description, shareType, title });
|
|
1125
|
-
const quote = sections.join(SHARE_DESCRIPTION_SECTION_BREAK).trim();
|
|
1126
|
-
return quote.length > 0 ? quote : void 0;
|
|
1127
|
-
}
|
|
1128
1133
|
function buildShareOgDescriptionFromSections(sections) {
|
|
1129
1134
|
return joinShareOgDescriptionSections(sections);
|
|
1130
1135
|
}
|
|
@@ -1453,6 +1458,14 @@ function isResourceImageActive(image) {
|
|
|
1453
1458
|
var SCHOOL_MIN_STUDENT_COUNT = 300;
|
|
1454
1459
|
var SCHOOL_MAX_STUDENT_COUNT = 0;
|
|
1455
1460
|
|
|
1461
|
+
// src/utils/userPoints.ts
|
|
1462
|
+
function sumUserOverallPoints(points) {
|
|
1463
|
+
return (points ?? []).reduce(
|
|
1464
|
+
(total, entry) => total + (entry?.points ?? 0),
|
|
1465
|
+
0
|
|
1466
|
+
);
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1456
1469
|
// src/calendar/eventCalendar.ts
|
|
1457
1470
|
import dayjs3 from "dayjs";
|
|
1458
1471
|
function toCalendarIsoDate(startDate) {
|
|
@@ -2632,21 +2645,23 @@ function filterUnregisteredVendorsByEventDatesOnly(vendors, eventStartDates) {
|
|
|
2632
2645
|
)
|
|
2633
2646
|
);
|
|
2634
2647
|
}
|
|
2635
|
-
function
|
|
2648
|
+
function collectStallholderDateTimes(registeredVendors, unregisteredVendors = []) {
|
|
2636
2649
|
return [
|
|
2637
|
-
...registeredVendors.flatMap(
|
|
2638
|
-
|
|
2650
|
+
...registeredVendors.flatMap(
|
|
2651
|
+
(vendor) => (vendor.relations ?? []).flatMap(
|
|
2652
|
+
(relation) => (relation.relationDates ?? []).map(
|
|
2653
|
+
(relationDate) => relationDate.dateTime
|
|
2654
|
+
)
|
|
2655
|
+
)
|
|
2656
|
+
),
|
|
2657
|
+
...unregisteredVendors.flatMap(
|
|
2658
|
+
(vendor) => (vendor.invitations ?? []).flatMap((invitation) => invitation.dateTime)
|
|
2659
|
+
)
|
|
2639
2660
|
];
|
|
2640
2661
|
}
|
|
2641
|
-
function
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
}
|
|
2645
|
-
const startDates = new Set(stallholderStartDates);
|
|
2646
|
-
return sortDatesChronologically(
|
|
2647
|
-
eventDateTime.filter(
|
|
2648
|
-
(date) => Boolean(date.startDate) && startDates.has(date.startDate)
|
|
2649
|
-
)
|
|
2662
|
+
function getUniqueStallholderStartDates(registeredVendors, unregisteredVendors = []) {
|
|
2663
|
+
return getUniqueStartDates(
|
|
2664
|
+
collectStallholderDateTimes(registeredVendors, unregisteredVendors)
|
|
2650
2665
|
);
|
|
2651
2666
|
}
|
|
2652
2667
|
function getStallholderCategoryNames(registeredVendors, unregisteredVendors = []) {
|
|
@@ -2702,16 +2717,7 @@ function collectVendorEventRelationDateTimes(events) {
|
|
|
2702
2717
|
);
|
|
2703
2718
|
}
|
|
2704
2719
|
function getVendorEventRelationStartDates(events) {
|
|
2705
|
-
|
|
2706
|
-
collectVendorEventRelationDateTimes(events)
|
|
2707
|
-
);
|
|
2708
|
-
const uniqueStartDates = [];
|
|
2709
|
-
for (const dateTime of sortedDates) {
|
|
2710
|
-
if (dateTime.startDate && !uniqueStartDates.includes(dateTime.startDate)) {
|
|
2711
|
-
uniqueStartDates.push(dateTime.startDate);
|
|
2712
|
-
}
|
|
2713
|
-
}
|
|
2714
|
-
return uniqueStartDates;
|
|
2720
|
+
return getUniqueStartDates(collectVendorEventRelationDateTimes(events));
|
|
2715
2721
|
}
|
|
2716
2722
|
function getVendorEventRelationDateOptions(events) {
|
|
2717
2723
|
return getVendorEventRelationStartDates(events).map((startDate) => ({
|
|
@@ -2976,12 +2982,12 @@ function getEventStallholdersData({
|
|
|
2976
2982
|
registeredForSelectedDate,
|
|
2977
2983
|
unregisteredForSelectedDate
|
|
2978
2984
|
);
|
|
2979
|
-
const futureEventStartDates =
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
).map((
|
|
2983
|
-
label: formatDate(
|
|
2984
|
-
value:
|
|
2985
|
+
const futureEventStartDates = getUniqueStallholderStartDates(
|
|
2986
|
+
registeredForEvent,
|
|
2987
|
+
unregisteredForEvent
|
|
2988
|
+
).map((startDate) => ({
|
|
2989
|
+
label: formatDate(startDate, "date"),
|
|
2990
|
+
value: startDate
|
|
2985
2991
|
}));
|
|
2986
2992
|
const hasDatePills = futureEventStartDates.length > 0;
|
|
2987
2993
|
const hasStallholders = vendorList.length > 0 || unregisteredVendorList.length > 0;
|
|
@@ -3978,7 +3984,7 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
3978
3984
|
...LocationFields
|
|
3979
3985
|
}
|
|
3980
3986
|
partner
|
|
3981
|
-
|
|
3987
|
+
totalOverallPoints
|
|
3982
3988
|
platform
|
|
3983
3989
|
preferredRegion
|
|
3984
3990
|
permissions
|
|
@@ -4008,6 +4014,15 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
4008
4014
|
${REDEEMED_REWARD_FIELDS_FRAGMENT}
|
|
4009
4015
|
${STRIPE_FIELDS_FRAGMENT}
|
|
4010
4016
|
`;
|
|
4017
|
+
var USER_OVERALL_POINTS_FIELDS_FRAGMENT = gql`
|
|
4018
|
+
fragment UserOverallPointsFields on UserType {
|
|
4019
|
+
overallPoints {
|
|
4020
|
+
createdAt
|
|
4021
|
+
pointType
|
|
4022
|
+
points
|
|
4023
|
+
}
|
|
4024
|
+
}
|
|
4025
|
+
`;
|
|
4011
4026
|
var STALL_TYPE_FIELDS_FRAGMENT = gql`
|
|
4012
4027
|
fragment StallTypeFields on StallTypeType {
|
|
4013
4028
|
label
|
|
@@ -9795,6 +9810,7 @@ export {
|
|
|
9795
9810
|
EnumOSPlatform,
|
|
9796
9811
|
EnumPartnerType,
|
|
9797
9812
|
EnumPaymentMethod,
|
|
9813
|
+
EnumPointType,
|
|
9798
9814
|
EnumPostContentType,
|
|
9799
9815
|
EnumPostType,
|
|
9800
9816
|
EnumRegions,
|
|
@@ -9904,12 +9920,10 @@ export {
|
|
|
9904
9920
|
billingCatalogDefinitionMatches,
|
|
9905
9921
|
buildApplicationShareDescription,
|
|
9906
9922
|
buildCalendarSheetContentData,
|
|
9907
|
-
buildFacebookShareQuote,
|
|
9908
9923
|
buildInvitationShareDescription,
|
|
9909
9924
|
buildPublicEventShareDescription,
|
|
9910
9925
|
buildPublicVendorShareDescription,
|
|
9911
9926
|
buildRelationEligibleEventSchedule,
|
|
9912
|
-
buildShareMessageSections,
|
|
9913
9927
|
buildShareOgDescription,
|
|
9914
9928
|
buildShareOgDescriptionFromSections,
|
|
9915
9929
|
buildSharePagePath,
|
|
@@ -9922,7 +9936,7 @@ export {
|
|
|
9922
9936
|
cluiFiles,
|
|
9923
9937
|
cluiIds,
|
|
9924
9938
|
cluiImages,
|
|
9925
|
-
|
|
9939
|
+
collectStallholderDateTimes,
|
|
9926
9940
|
collectVendorEventRelationDateTimes,
|
|
9927
9941
|
companyContactFields,
|
|
9928
9942
|
computeDailyClueState,
|
|
@@ -9985,7 +9999,6 @@ export {
|
|
|
9985
9999
|
getDistanceInMeters,
|
|
9986
10000
|
getErrorMessage,
|
|
9987
10001
|
getEventCalendarIsoDates,
|
|
9988
|
-
getEventDatesWithStallholders,
|
|
9989
10002
|
getEventScheduleStatusLabel,
|
|
9990
10003
|
getEventScheduleStatusPresentation,
|
|
9991
10004
|
getEventScheduleStatusTone,
|
|
@@ -9997,6 +10010,8 @@ export {
|
|
|
9997
10010
|
getRegisteredVendorStartDates,
|
|
9998
10011
|
getStallholderCategoryNames,
|
|
9999
10012
|
getStallholderCategoryOptions,
|
|
10013
|
+
getUniqueStallholderStartDates,
|
|
10014
|
+
getUniqueStartDates,
|
|
10000
10015
|
getUnregisteredVendorCategoryNames,
|
|
10001
10016
|
getUnregisteredVendorStartDates,
|
|
10002
10017
|
getUsableAdminContexts,
|
|
@@ -10066,7 +10081,6 @@ export {
|
|
|
10066
10081
|
resolveResourceImageActive,
|
|
10067
10082
|
rewardNiceNames,
|
|
10068
10083
|
seededShuffle,
|
|
10069
|
-
shareMessageFooterPlacementForType,
|
|
10070
10084
|
shareSlugResourceId,
|
|
10071
10085
|
shouldShowEventActionsWithWeather,
|
|
10072
10086
|
socialMediaFields,
|
|
@@ -10075,6 +10089,7 @@ export {
|
|
|
10075
10089
|
stallTypeOptions,
|
|
10076
10090
|
statusOptions,
|
|
10077
10091
|
stripOverlaySubtitleSpecialChars,
|
|
10092
|
+
sumUserOverallPoints,
|
|
10078
10093
|
tagOptions,
|
|
10079
10094
|
timeFormat,
|
|
10080
10095
|
toCalendarIsoDate,
|