@timardex/cluemart-shared 1.6.130 → 1.7.0
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-CVkVX_z5.d.ts +296 -0
- package/dist/ad-DA9ECAhK.d.mts +296 -0
- package/dist/affiliate-1RtkLnLP.d.ts +35 -0
- package/dist/affiliate-Cos2Syz5.d.mts +35 -0
- package/dist/chunk-HZMP7GXC.mjs +5330 -0
- package/dist/chunk-HZMP7GXC.mjs.map +1 -0
- package/dist/chunk-KZTOISPA.mjs +272 -0
- package/dist/chunk-KZTOISPA.mjs.map +1 -0
- package/dist/chunk-MVQ3CFQR.mjs +230 -0
- package/dist/chunk-MVQ3CFQR.mjs.map +1 -0
- package/dist/chunk-NPFJ2CN2.mjs +109 -0
- package/dist/chunk-NPFJ2CN2.mjs.map +1 -0
- package/dist/chunk-RKIRWZCH.mjs +368 -0
- package/dist/chunk-RKIRWZCH.mjs.map +1 -0
- package/dist/{chunk-OHHJ3KJJ.mjs → chunk-TAECMXM4.mjs} +267 -304
- package/dist/chunk-TAECMXM4.mjs.map +1 -0
- package/dist/chunk-VA5YN2K3.mjs +48 -0
- package/dist/chunk-VA5YN2K3.mjs.map +1 -0
- package/dist/chunk-ZZJSCYJK.mjs +958 -0
- package/dist/chunk-ZZJSCYJK.mjs.map +1 -0
- package/dist/contactUs-DGrDzJaM.d.mts +11 -0
- package/dist/contactUs-H7799pWe.d.ts +11 -0
- package/dist/enums/index.cjs +223 -2
- package/dist/enums/index.cjs.map +1 -1
- package/dist/enums/index.d.mts +164 -5
- package/dist/enums/index.d.ts +164 -5
- package/dist/enums/index.mjs +41 -1
- package/dist/formFields/index.cjs +168 -403
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +3 -6
- package/dist/formFields/index.d.ts +3 -6
- package/dist/formFields/index.mjs +47 -921
- package/dist/formFields/index.mjs.map +1 -1
- package/dist/global-BUUfmCo7.d.mts +698 -0
- package/dist/global-fKbMmluy.d.ts +698 -0
- package/dist/graphql/index.cjs +3329 -3340
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +487 -690
- package/dist/graphql/index.d.ts +487 -690
- package/dist/graphql/index.mjs +153 -2552
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +3478 -773
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +6 -13
- package/dist/hooks/index.d.ts +6 -13
- package/dist/hooks/index.mjs +99 -193
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/images/apple-maps-icon.webp.d.ts +1 -8
- package/dist/images/banner-horizontal.webp.d.ts +1 -8
- package/dist/images/banner-vertical.webp.d.ts +1 -8
- package/dist/images/cluiTui.webp.d.ts +1 -8
- package/dist/images/corporate.webp.d.ts +1 -8
- package/dist/images/facebook.webp.d.ts +1 -8
- package/dist/images/gazebo-top.webp.d.ts +1 -8
- package/dist/images/google-maps-icon.webp.d.ts +1 -8
- package/dist/images/googleMaps-logo-dark.webp.d.ts +1 -8
- package/dist/images/googleMaps-logo-light.webp.d.ts +1 -8
- package/dist/images/index.mjs +21 -86
- package/dist/images/index.mjs.map +1 -1
- package/dist/images/instagram.webp.d.ts +1 -8
- package/dist/images/logo-atr.webp.d.ts +1 -8
- package/dist/images/logo-dark.webp.d.ts +1 -8
- package/dist/images/logo.webp.d.ts +1 -8
- package/dist/images/meet.webp.d.ts +1 -8
- package/dist/images/mini-market1.webp.d.ts +1 -8
- package/dist/images/mini-market2.webp.d.ts +1 -8
- package/dist/images/mini-market3.webp.d.ts +1 -8
- package/dist/images/mini-market4.webp.d.ts +1 -8
- package/dist/images/mini-market5.webp.d.ts +1 -8
- package/dist/images/poll.webp.d.ts +1 -8
- package/dist/images/poster1.webp.d.ts +1 -8
- package/dist/images/poster2.webp.d.ts +1 -8
- package/dist/images/poster3.webp.d.ts +1 -8
- package/dist/images/poster4.webp.d.ts +1 -8
- package/dist/images/private.webp.d.ts +1 -8
- package/dist/images/qr-code.webp.d.ts +1 -8
- package/dist/images/school.webp.d.ts +1 -8
- package/dist/images/sima.webp.d.ts +1 -8
- package/dist/images/store-android.webp.d.ts +1 -8
- package/dist/images/store-ios.webp.d.ts +1 -8
- package/dist/images/tablas.webp.d.ts +1 -8
- package/dist/images/telefonos.webp.d.ts +1 -8
- package/dist/images/tiktok.webp.d.ts +1 -8
- package/dist/images/tip.webp.d.ts +1 -8
- package/dist/images/ugralos.webp.d.ts +1 -8
- package/dist/images/waze-maps-icon.webp.d.ts +1 -8
- package/dist/images/website.webp.d.ts +1 -8
- package/dist/images/youtube.webp.d.ts +1 -8
- package/dist/index.cjs +5883 -7079
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1692 -2966
- package/dist/index.d.ts +1692 -2966
- package/dist/index.mjs +5020 -6162
- package/dist/index.mjs.map +1 -1
- package/dist/map/index.cjs +9 -14
- package/dist/map/index.cjs.map +1 -1
- package/dist/map/index.d.mts +14 -18
- package/dist/map/index.d.ts +14 -18
- package/dist/map/index.mjs +9 -14
- package/dist/map/index.mjs.map +1 -1
- package/dist/resourceActivities-BL_12IAo.d.ts +125 -0
- package/dist/resourceActivities-zczOntNk.d.mts +125 -0
- package/dist/sharing/index.cjs +1272 -63
- package/dist/sharing/index.cjs.map +1 -1
- package/dist/sharing/index.d.mts +7 -32
- package/dist/sharing/index.d.ts +7 -32
- package/dist/sharing/index.mjs +30 -188
- package/dist/sharing/index.mjs.map +1 -1
- package/dist/theme/index.mjs +5 -41
- package/dist/theme/index.mjs.map +1 -1
- package/dist/types/index.cjs +110 -868
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +24 -230
- package/dist/types/index.d.ts +24 -230
- package/dist/types/index.mjs +27 -61
- package/dist/utils/index.cjs +214 -608
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +53 -107
- package/dist/utils/index.d.ts +53 -107
- package/dist/utils/index.mjs +15 -43
- package/package.json +12 -40
- 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/apollo/index.cjs +0 -1383
- package/dist/apollo/index.cjs.map +0 -1
- package/dist/apollo/index.d.mts +0 -323
- package/dist/apollo/index.d.ts +0 -323
- package/dist/apollo/index.mjs +0 -1295
- package/dist/apollo/index.mjs.map +0 -1
- package/dist/auth/index.cjs +0 -3322
- package/dist/auth/index.cjs.map +0 -1
- package/dist/auth/index.d.mts +0 -164
- package/dist/auth/index.d.ts +0 -164
- package/dist/auth/index.mjs +0 -379
- package/dist/auth/index.mjs.map +0 -1
- package/dist/auth-BOmAO53v.d.ts +0 -169
- package/dist/auth-CsITA95p.d.mts +0 -169
- package/dist/chunk-DATBGC2K.mjs +0 -347
- 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 +0 -297
- package/dist/chunk-NWWKI4PJ.mjs.map +0 -1
- package/dist/chunk-OHHJ3KJJ.mjs.map +0 -1
- package/dist/chunk-RAYUJODN.mjs +0 -45
- package/dist/chunk-RAYUJODN.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/utils/index.d.mts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { J as DailyClueGameData, $ as GamePlacementClue, _ as GamePlacement, j as EnumPostType, O as OptionItem, aw as SocialMediaType, av as ResourceImageType, K as DateTimeType, L as LocationType, V as VendorType, g as UnregisteredVendorType, c as EventListItemType } from '../global-BUUfmCo7.mjs';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { EnumRegions } from '../enums/index.mjs';
|
|
6
|
-
import { c as AffiliateRewardWriteType } from '../affiliate-Bqqlffw8.mjs';
|
|
3
|
+
import { EnumRegions, EnumUserLicence, EnumReward, EnumInviteStatus, EnumEventDateStatus, EnumResourceType } from '../enums/index.mjs';
|
|
4
|
+
import { E as EnumAffiliateRewardType, b as AffiliateReward } from '../affiliate-Cos2Syz5.mjs';
|
|
7
5
|
import 'react-hook-form';
|
|
8
|
-
import '../images/index.mjs';
|
|
9
6
|
|
|
10
7
|
/** Seeded shuffle so all players see the same letter order / placements for a game. */
|
|
11
8
|
declare function seededShuffle<T>(array: readonly T[], seed: string): T[];
|
|
@@ -53,11 +50,6 @@ declare const futureTimePeriods: {
|
|
|
53
50
|
value: string;
|
|
54
51
|
}[];
|
|
55
52
|
|
|
56
|
-
/**
|
|
57
|
-
* Convert an array of strings to an array of objects with label and value properties.
|
|
58
|
-
*/
|
|
59
|
-
declare const mapArrayToOptions: (items: string[]) => OptionItem[];
|
|
60
|
-
|
|
61
53
|
declare const removeTypename: (obj: any) => any;
|
|
62
54
|
/**
|
|
63
55
|
* Truncate text to a specified length and append ellipsis if necessary.
|
|
@@ -66,32 +58,61 @@ declare const removeTypename: (obj: any) => any;
|
|
|
66
58
|
* @returns
|
|
67
59
|
*/
|
|
68
60
|
declare const truncateText: (text: string, maxLength?: number) => string;
|
|
61
|
+
/**
|
|
62
|
+
* Convert an array of strings to an array of objects with label and value properties.
|
|
63
|
+
* @param items - The array of strings to convert.
|
|
64
|
+
* @returns - The converted array of objects.
|
|
65
|
+
*/
|
|
66
|
+
declare const mapArrayToOptions: (items: string[]) => OptionItem[];
|
|
69
67
|
declare const capitalizeFirstLetter: (str: string) => string;
|
|
70
68
|
declare const statusOptions: {
|
|
71
|
-
label:
|
|
72
|
-
value:
|
|
69
|
+
label: EnumInviteStatus;
|
|
70
|
+
value: EnumInviteStatus;
|
|
73
71
|
}[];
|
|
74
72
|
declare const availableRegionTypes: EnumRegions[];
|
|
75
73
|
declare const availableRegionOptions: OptionItem[];
|
|
76
74
|
declare const paymentMethodOptions: OptionItem[];
|
|
77
75
|
declare function normalizeUrl(url: string): string;
|
|
78
|
-
declare const licenseNiceNames: Record<
|
|
76
|
+
declare const licenseNiceNames: Record<EnumUserLicence, string>;
|
|
79
77
|
declare const cluemartSocialMedia: SocialMediaType[];
|
|
80
78
|
declare const IOS_URL = "https://apps.apple.com/nz/app/cluemart/id6747251008";
|
|
81
79
|
declare const ANDROID_URL = "https://play.google.com/store/apps/details?id=com.timardex.cluemart";
|
|
82
80
|
declare const DEFAULT_RESOURCES_RETURN_LIMIT = 1000;
|
|
83
81
|
declare const DEFAULT_RESOURCES_RETURN_OFFSET = 0;
|
|
84
82
|
declare const CLUEMART_MAIN_DOMAIN_URL = "https://cluemart.co.nz";
|
|
85
|
-
declare const rewardNiceNames: Record<
|
|
83
|
+
declare const rewardNiceNames: Record<EnumReward, {
|
|
86
84
|
name: string;
|
|
87
85
|
points: number;
|
|
88
86
|
}>;
|
|
89
|
-
declare const PostTypeLabels: Record<
|
|
90
|
-
/** Hardcoded
|
|
87
|
+
declare const PostTypeLabels: Record<EnumPostType, string>;
|
|
88
|
+
/** Hardcoded promo; compared to trimmed + uppercased registration input. */
|
|
91
89
|
declare const CM_SCHOOL_PROMO_CODE = "CM-SCHOOL";
|
|
92
|
-
/** Hardcoded registration gateway code; only valid at sign-up (not a generated affiliate referral code). */
|
|
93
90
|
declare const CM_AFFILIATE_PROMO_CODE = "CM-AFFILIATE";
|
|
94
|
-
|
|
91
|
+
|
|
92
|
+
declare const AFFILIATE_REWARDS: {
|
|
93
|
+
NEW_EVENT_REGISTRATION: {
|
|
94
|
+
description: string;
|
|
95
|
+
value: number;
|
|
96
|
+
};
|
|
97
|
+
NEW_VENDOR_REGISTRATION: {
|
|
98
|
+
description: string;
|
|
99
|
+
value: number;
|
|
100
|
+
};
|
|
101
|
+
NEW_PARTNER_REGISTRATION: {
|
|
102
|
+
description: string;
|
|
103
|
+
value: number;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Create an affiliate reward
|
|
108
|
+
* @param rewardType - The type of reward
|
|
109
|
+
* @param receivedAt - The date the reward was received
|
|
110
|
+
* @returns The affiliate reward
|
|
111
|
+
* @example
|
|
112
|
+
* const reward = createAffiliateReward(EnumAffiliateRewardType.NEW_EVENT_REGISTRATION, new Date());
|
|
113
|
+
* console.log(reward);
|
|
114
|
+
*/
|
|
115
|
+
declare function createAffiliateReward(rewardType: EnumAffiliateRewardType, createdAt: Date): AffiliateReward;
|
|
95
116
|
|
|
96
117
|
/**
|
|
97
118
|
* Loose input shape for normalization helpers. Callers often pass partial or legacy
|
|
@@ -115,23 +136,23 @@ declare function isResourceImageActive(image: ResourceImageLike | null | undefin
|
|
|
115
136
|
declare const SCHOOL_MIN_STUDENT_COUNT = 300;
|
|
116
137
|
declare const SCHOOL_MAX_STUDENT_COUNT = 0;
|
|
117
138
|
|
|
118
|
-
declare const EVENT_DATE_STATUS_PERIOD_MAP: Partial<Record<
|
|
119
|
-
declare function getAllowedEventDateStatuses(period:
|
|
120
|
-
declare function eventMatchesDateStatusPeriod(dateTime: Pick<DateTimeType, "dateStatus">[] | null | undefined, period:
|
|
139
|
+
declare const EVENT_DATE_STATUS_PERIOD_MAP: Partial<Record<EnumEventDateStatus, EnumEventDateStatus[]>>;
|
|
140
|
+
declare function getAllowedEventDateStatuses(period: EnumEventDateStatus): EnumEventDateStatus[];
|
|
141
|
+
declare function eventMatchesDateStatusPeriod(dateTime: Pick<DateTimeType, "dateStatus">[] | null | undefined, period: EnumEventDateStatus): boolean;
|
|
121
142
|
declare function filterEventsByDateStatusPeriod<T extends {
|
|
122
143
|
dateTime?: Pick<DateTimeType, "dateStatus">[] | null;
|
|
123
|
-
}>(events: T[], period:
|
|
144
|
+
}>(events: T[], period: EnumEventDateStatus): T[];
|
|
124
145
|
|
|
125
146
|
type CalendarSheetContentData = {
|
|
126
147
|
dateTime: DateTimeType;
|
|
127
148
|
location: LocationType;
|
|
128
149
|
resourceId: string;
|
|
129
|
-
resourceType:
|
|
150
|
+
resourceType: EnumResourceType;
|
|
130
151
|
};
|
|
131
|
-
declare const KNOWN_EVENT_SCHEDULE_STATUSES: Set<
|
|
152
|
+
declare const KNOWN_EVENT_SCHEDULE_STATUSES: Set<EnumEventDateStatus>;
|
|
132
153
|
type EventScheduleStatusTone = "started" | "startingSoon" | "ended" | "default";
|
|
133
154
|
type EventScheduleStatusPresentation = {
|
|
134
|
-
status:
|
|
155
|
+
status: EnumEventDateStatus;
|
|
135
156
|
statusLabel: string;
|
|
136
157
|
tone: EventScheduleStatusTone;
|
|
137
158
|
};
|
|
@@ -139,11 +160,11 @@ declare function toCalendarIsoDate(startDate: string): string | null;
|
|
|
139
160
|
declare function fromCalendarIsoDate(isoDate: string): string;
|
|
140
161
|
declare function getEventCalendarIsoDates(dateTimes: DateTimeType[] | null | undefined): string[];
|
|
141
162
|
declare function findEventDateTimeByIsoDate(dateTimes: DateTimeType[] | null | undefined, isoDate: string): DateTimeType | null;
|
|
142
|
-
declare function buildCalendarSheetContentData(dateTimes: DateTimeType[], isoDate: string, location: LocationType, resourceId: string, resourceType:
|
|
143
|
-
declare function getEventScheduleStatusTone(status:
|
|
163
|
+
declare function buildCalendarSheetContentData(dateTimes: DateTimeType[], isoDate: string, location: LocationType, resourceId: string, resourceType: EnumResourceType): CalendarSheetContentData | null;
|
|
164
|
+
declare function getEventScheduleStatusTone(status: EnumEventDateStatus): EventScheduleStatusTone;
|
|
144
165
|
declare function getEventScheduleStatusPresentation(dateTime: DateTimeType): EventScheduleStatusPresentation;
|
|
145
166
|
declare function getEventScheduleStatusLabel(dateTime: DateTimeType, onlyShowKnownStatuses: boolean): string | null;
|
|
146
|
-
declare function shouldShowEventActionsWithWeather(resourceType:
|
|
167
|
+
declare function shouldShowEventActionsWithWeather(resourceType: EnumResourceType, dateTime: DateTimeType, location: LocationType | null | undefined): boolean;
|
|
147
168
|
|
|
148
169
|
type StallholderFilterOption = {
|
|
149
170
|
label: string;
|
|
@@ -167,88 +188,13 @@ declare function getStallholderCategoryNames(registeredVendors: VendorType[], un
|
|
|
167
188
|
declare function getStallholderCategoryOptions(registeredVendors: VendorType[], unregisteredVendors?: UnregisteredVendorType[]): StallholderFilterOption[];
|
|
168
189
|
declare function getEventStallholderEmptyMessage(hasAnyStallholdersForEvent: boolean, selectedDate: string | null): string;
|
|
169
190
|
|
|
170
|
-
type RelationType = NonNullable<
|
|
191
|
+
type RelationType = NonNullable<EventListItemType["relations"]>[number];
|
|
171
192
|
declare function relationHasSelectedDate(relation: RelationType, selectedDate: string): boolean;
|
|
172
193
|
declare function eventHasSelectedDate(event: EventListItemType, selectedDate: string): boolean;
|
|
173
194
|
declare function filterVendorEventsBySelectedDate(events: EventListItemType[] | null | undefined, selectedDate: string | null): EventListItemType[];
|
|
174
|
-
declare function collectVendorEventRelationDateTimes(events: EventListItemType[] | null | undefined):
|
|
195
|
+
declare function collectVendorEventRelationDateTimes(events: EventListItemType[] | null | undefined): DateTimeType[];
|
|
175
196
|
declare function getVendorEventRelationStartDates(events: EventListItemType[] | null | undefined): string[];
|
|
176
197
|
declare function getVendorEventRelationDateOptions(events: EventListItemType[] | null | undefined): StallholderFilterOption[];
|
|
177
198
|
declare function getVendorEventsEmptyMessage(): string;
|
|
178
199
|
|
|
179
|
-
|
|
180
|
-
readonly INDIVIDUAL: "Individual";
|
|
181
|
-
readonly SOLE_TRADER: "Sole Trader";
|
|
182
|
-
readonly COMPANY: "Company";
|
|
183
|
-
};
|
|
184
|
-
declare const AFFILIATE_REWARDS: {
|
|
185
|
-
NEW_EVENT_REGISTRATION: {
|
|
186
|
-
description: string;
|
|
187
|
-
value: number;
|
|
188
|
-
};
|
|
189
|
-
NEW_VENDOR_REGISTRATION: {
|
|
190
|
-
description: string;
|
|
191
|
-
value: number;
|
|
192
|
-
};
|
|
193
|
-
ACTIVE_VENDOR_PRO_SUBSCRIPTION: {
|
|
194
|
-
description: string;
|
|
195
|
-
value: number;
|
|
196
|
-
};
|
|
197
|
-
ACTIVE_VENDOR_STANDARD_SUBSCRIPTION: {
|
|
198
|
-
description: string;
|
|
199
|
-
value: number;
|
|
200
|
-
};
|
|
201
|
-
ACTIVE_VENDOR_BONUS_REWARD: {
|
|
202
|
-
description: string;
|
|
203
|
-
value: number;
|
|
204
|
-
};
|
|
205
|
-
ACTIVE_EVENT_WITH_VENDOR_REGISTRATIONS: {
|
|
206
|
-
description: string;
|
|
207
|
-
value: number;
|
|
208
|
-
};
|
|
209
|
-
};
|
|
210
|
-
/**
|
|
211
|
-
* Create an affiliate reward
|
|
212
|
-
* @param rewardType - The type of reward
|
|
213
|
-
* @param createdAt - The date the reward was received
|
|
214
|
-
* @returns The affiliate reward
|
|
215
|
-
* @example
|
|
216
|
-
* const reward = createAffiliateReward(AffiliateRewardEnumType.NewEventRegistration, new Date());
|
|
217
|
-
* console.log(reward);
|
|
218
|
-
*/
|
|
219
|
-
declare function createAffiliateReward(rewardType: AffiliateRewardEnumType, createdAt: Date): AffiliateRewardWriteType;
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* NZ IRD number validation (Inland Revenue modulus-11 check digit).
|
|
223
|
-
*
|
|
224
|
-
* Valid range: 10,000,000 – 200,000,000 (upper limit raised Feb 2026; length stays
|
|
225
|
-
* 8–9 digits). See IRD file-upload / payday filing specifications.
|
|
226
|
-
*/
|
|
227
|
-
/** Digits only; strips spaces/hyphens and other non-digits. */
|
|
228
|
-
declare function normalizeIrdNumber(value: string): string;
|
|
229
|
-
/**
|
|
230
|
-
* Formats an IRD number as groups of three digits separated by hyphens
|
|
231
|
-
* (e.g. `490-918-50` / `049-091-850`), capping at 9 digits.
|
|
232
|
-
*/
|
|
233
|
-
declare function formatIrdNumber(input: string): string;
|
|
234
|
-
/**
|
|
235
|
-
* Returns true when `value` is a valid NZ IRD number (8–9 digits, in issued
|
|
236
|
-
* range, and modulus-11 check digit matches).
|
|
237
|
-
*/
|
|
238
|
-
declare function isValidIrdNumber(value: string): boolean;
|
|
239
|
-
|
|
240
|
-
/** True for short-lived connectivity failures (e.g. resume before the stack is ready). */
|
|
241
|
-
declare function isTransientNetworkError(err: unknown): boolean;
|
|
242
|
-
|
|
243
|
-
declare const DEFAULT_USER_FACING_ERROR = "Something went wrong. Please try again.";
|
|
244
|
-
declare const NETWORK_USER_FACING_ERROR = "Unable to connect. Please check your internet connection and try again.";
|
|
245
|
-
declare function isInternalErrorMessage(message: string): boolean;
|
|
246
|
-
/**
|
|
247
|
-
* Maps raw API/client errors to a safe message for UI surfaces.
|
|
248
|
-
* Keeps intentional product copy (e.g. "Vendor not found"); hides infra details.
|
|
249
|
-
*/
|
|
250
|
-
declare function toUserFacingErrorMessage(error: string | null | undefined, fallback?: string): string;
|
|
251
|
-
/** Extracts and sanitizes an unknown catch/Apollo error for toasts and alerts. */
|
|
252
|
-
declare function getErrorMessage(error: unknown, fallback?: string): string;
|
|
253
|
-
|
|
254
|
-
export { AFFILIATE_PARTICIPANT_TYPE_LABELS, AFFILIATE_REWARDS, ANDROID_URL, CLUEMART_MAIN_DOMAIN_URL, CM_AFFILIATE_PROMO_CODE, CM_SCHOOL_PROMO_CODE, type CalendarSheetContentData, DEFAULT_RESOURCES_RETURN_LIMIT, DEFAULT_RESOURCES_RETURN_OFFSET, DEFAULT_USER_FACING_ERROR, EVENT_DATE_STATUS_PERIOD_MAP, type EventScheduleStatusPresentation, type EventScheduleStatusTone, IOS_URL, KNOWN_EVENT_SCHEDULE_STATUSES, NETWORK_USER_FACING_ERROR, PostTypeLabels, SCHOOL_MAX_STUDENT_COUNT, SCHOOL_MIN_STUDENT_COUNT, type StallholderFilterOption, availableRegionOptions, availableRegionTypes, buildCalendarSheetContentData, capitalizeFirstLetter, cluemartSocialMedia, collectStallholderStartDates, collectVendorEventRelationDateTimes, computeDailyClueState, createAffiliateReward, dateFormat, eventHasSelectedDate, eventMatchesDateStatusPeriod, eventStartDatesSet, filterEventsByDateStatusPeriod, filterRegisteredVendorsByEventDatesOnly, filterRegisteredVendorsForEvent, filterUnregisteredVendorsByEventDatesOnly, filterUnregisteredVendorsForEvent, filterVendorEventsBySelectedDate, findEventDateTimeByIsoDate, formatDate, formatIrdNumber, formatNZBankAccount, formatTimestamp, fromCalendarIsoDate, futureTimePeriods, getAllowedEventDateStatuses, getCurrentAndFutureDates, getErrorMessage, getEventCalendarIsoDates, getEventDatesWithStallholders, getEventScheduleStatusLabel, getEventScheduleStatusPresentation, getEventScheduleStatusTone, getEventStallholderEmptyMessage, getRegisteredVendorCategoryNames, getRegisteredVendorStartDates, getStallholderCategoryNames, getStallholderCategoryOptions, getUnregisteredVendorCategoryNames, getUnregisteredVendorStartDates, getVendorEventRelationDateOptions, getVendorEventRelationStartDates, getVendorEventsEmptyMessage, hasMatchingEventDate, isFutureDatesBeforeThreshold, isInternalErrorMessage, isIsoDateString, isResourceImageActive, isTransientNetworkError, isValidIrdNumber, licenseNiceNames, mapArrayToOptions, matchesCategory, matchesSelectedDate, normalizeIrdNumber, normalizeResourceImage, normalizeUrl, nzStartOfDay, paymentMethodOptions, relationHasSelectedDate, removeTypename, resolveResourceImageActive, rewardNiceNames, seededShuffle, shouldShowEventActionsWithWeather, sortDatesChronologically, statusOptions, timeFormat, toCalendarIsoDate, toNZTime, toUserFacingErrorMessage, truncateText };
|
|
200
|
+
export { AFFILIATE_REWARDS, ANDROID_URL, CLUEMART_MAIN_DOMAIN_URL, CM_AFFILIATE_PROMO_CODE, CM_SCHOOL_PROMO_CODE, type CalendarSheetContentData, DEFAULT_RESOURCES_RETURN_LIMIT, DEFAULT_RESOURCES_RETURN_OFFSET, EVENT_DATE_STATUS_PERIOD_MAP, type EventScheduleStatusPresentation, type EventScheduleStatusTone, IOS_URL, KNOWN_EVENT_SCHEDULE_STATUSES, PostTypeLabels, SCHOOL_MAX_STUDENT_COUNT, SCHOOL_MIN_STUDENT_COUNT, type StallholderFilterOption, availableRegionOptions, availableRegionTypes, buildCalendarSheetContentData, capitalizeFirstLetter, cluemartSocialMedia, collectStallholderStartDates, collectVendorEventRelationDateTimes, computeDailyClueState, createAffiliateReward, dateFormat, eventHasSelectedDate, eventMatchesDateStatusPeriod, eventStartDatesSet, filterEventsByDateStatusPeriod, filterRegisteredVendorsByEventDatesOnly, filterRegisteredVendorsForEvent, filterUnregisteredVendorsByEventDatesOnly, filterUnregisteredVendorsForEvent, filterVendorEventsBySelectedDate, findEventDateTimeByIsoDate, formatDate, formatTimestamp, fromCalendarIsoDate, futureTimePeriods, getAllowedEventDateStatuses, getCurrentAndFutureDates, getEventCalendarIsoDates, getEventDatesWithStallholders, getEventScheduleStatusLabel, getEventScheduleStatusPresentation, getEventScheduleStatusTone, getEventStallholderEmptyMessage, getRegisteredVendorCategoryNames, getRegisteredVendorStartDates, getStallholderCategoryNames, getStallholderCategoryOptions, getUnregisteredVendorCategoryNames, getUnregisteredVendorStartDates, getVendorEventRelationDateOptions, getVendorEventRelationStartDates, getVendorEventsEmptyMessage, hasMatchingEventDate, isFutureDatesBeforeThreshold, isIsoDateString, isResourceImageActive, licenseNiceNames, mapArrayToOptions, matchesCategory, matchesSelectedDate, normalizeResourceImage, normalizeUrl, nzStartOfDay, paymentMethodOptions, relationHasSelectedDate, removeTypename, resolveResourceImageActive, rewardNiceNames, seededShuffle, shouldShowEventActionsWithWeather, sortDatesChronologically, statusOptions, timeFormat, toCalendarIsoDate, toNZTime, truncateText };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { J as DailyClueGameData, $ as GamePlacementClue, _ as GamePlacement, j as EnumPostType, O as OptionItem, aw as SocialMediaType, av as ResourceImageType, K as DateTimeType, L as LocationType, V as VendorType, g as UnregisteredVendorType, c as EventListItemType } from '../global-fKbMmluy.js';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { EnumRegions } from '../enums/index.js';
|
|
6
|
-
import { c as AffiliateRewardWriteType } from '../affiliate-Btlp5XUp.js';
|
|
3
|
+
import { EnumRegions, EnumUserLicence, EnumReward, EnumInviteStatus, EnumEventDateStatus, EnumResourceType } from '../enums/index.js';
|
|
4
|
+
import { E as EnumAffiliateRewardType, b as AffiliateReward } from '../affiliate-1RtkLnLP.js';
|
|
7
5
|
import 'react-hook-form';
|
|
8
|
-
import '../images/index.js';
|
|
9
6
|
|
|
10
7
|
/** Seeded shuffle so all players see the same letter order / placements for a game. */
|
|
11
8
|
declare function seededShuffle<T>(array: readonly T[], seed: string): T[];
|
|
@@ -53,11 +50,6 @@ declare const futureTimePeriods: {
|
|
|
53
50
|
value: string;
|
|
54
51
|
}[];
|
|
55
52
|
|
|
56
|
-
/**
|
|
57
|
-
* Convert an array of strings to an array of objects with label and value properties.
|
|
58
|
-
*/
|
|
59
|
-
declare const mapArrayToOptions: (items: string[]) => OptionItem[];
|
|
60
|
-
|
|
61
53
|
declare const removeTypename: (obj: any) => any;
|
|
62
54
|
/**
|
|
63
55
|
* Truncate text to a specified length and append ellipsis if necessary.
|
|
@@ -66,32 +58,61 @@ declare const removeTypename: (obj: any) => any;
|
|
|
66
58
|
* @returns
|
|
67
59
|
*/
|
|
68
60
|
declare const truncateText: (text: string, maxLength?: number) => string;
|
|
61
|
+
/**
|
|
62
|
+
* Convert an array of strings to an array of objects with label and value properties.
|
|
63
|
+
* @param items - The array of strings to convert.
|
|
64
|
+
* @returns - The converted array of objects.
|
|
65
|
+
*/
|
|
66
|
+
declare const mapArrayToOptions: (items: string[]) => OptionItem[];
|
|
69
67
|
declare const capitalizeFirstLetter: (str: string) => string;
|
|
70
68
|
declare const statusOptions: {
|
|
71
|
-
label:
|
|
72
|
-
value:
|
|
69
|
+
label: EnumInviteStatus;
|
|
70
|
+
value: EnumInviteStatus;
|
|
73
71
|
}[];
|
|
74
72
|
declare const availableRegionTypes: EnumRegions[];
|
|
75
73
|
declare const availableRegionOptions: OptionItem[];
|
|
76
74
|
declare const paymentMethodOptions: OptionItem[];
|
|
77
75
|
declare function normalizeUrl(url: string): string;
|
|
78
|
-
declare const licenseNiceNames: Record<
|
|
76
|
+
declare const licenseNiceNames: Record<EnumUserLicence, string>;
|
|
79
77
|
declare const cluemartSocialMedia: SocialMediaType[];
|
|
80
78
|
declare const IOS_URL = "https://apps.apple.com/nz/app/cluemart/id6747251008";
|
|
81
79
|
declare const ANDROID_URL = "https://play.google.com/store/apps/details?id=com.timardex.cluemart";
|
|
82
80
|
declare const DEFAULT_RESOURCES_RETURN_LIMIT = 1000;
|
|
83
81
|
declare const DEFAULT_RESOURCES_RETURN_OFFSET = 0;
|
|
84
82
|
declare const CLUEMART_MAIN_DOMAIN_URL = "https://cluemart.co.nz";
|
|
85
|
-
declare const rewardNiceNames: Record<
|
|
83
|
+
declare const rewardNiceNames: Record<EnumReward, {
|
|
86
84
|
name: string;
|
|
87
85
|
points: number;
|
|
88
86
|
}>;
|
|
89
|
-
declare const PostTypeLabels: Record<
|
|
90
|
-
/** Hardcoded
|
|
87
|
+
declare const PostTypeLabels: Record<EnumPostType, string>;
|
|
88
|
+
/** Hardcoded promo; compared to trimmed + uppercased registration input. */
|
|
91
89
|
declare const CM_SCHOOL_PROMO_CODE = "CM-SCHOOL";
|
|
92
|
-
/** Hardcoded registration gateway code; only valid at sign-up (not a generated affiliate referral code). */
|
|
93
90
|
declare const CM_AFFILIATE_PROMO_CODE = "CM-AFFILIATE";
|
|
94
|
-
|
|
91
|
+
|
|
92
|
+
declare const AFFILIATE_REWARDS: {
|
|
93
|
+
NEW_EVENT_REGISTRATION: {
|
|
94
|
+
description: string;
|
|
95
|
+
value: number;
|
|
96
|
+
};
|
|
97
|
+
NEW_VENDOR_REGISTRATION: {
|
|
98
|
+
description: string;
|
|
99
|
+
value: number;
|
|
100
|
+
};
|
|
101
|
+
NEW_PARTNER_REGISTRATION: {
|
|
102
|
+
description: string;
|
|
103
|
+
value: number;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Create an affiliate reward
|
|
108
|
+
* @param rewardType - The type of reward
|
|
109
|
+
* @param receivedAt - The date the reward was received
|
|
110
|
+
* @returns The affiliate reward
|
|
111
|
+
* @example
|
|
112
|
+
* const reward = createAffiliateReward(EnumAffiliateRewardType.NEW_EVENT_REGISTRATION, new Date());
|
|
113
|
+
* console.log(reward);
|
|
114
|
+
*/
|
|
115
|
+
declare function createAffiliateReward(rewardType: EnumAffiliateRewardType, createdAt: Date): AffiliateReward;
|
|
95
116
|
|
|
96
117
|
/**
|
|
97
118
|
* Loose input shape for normalization helpers. Callers often pass partial or legacy
|
|
@@ -115,23 +136,23 @@ declare function isResourceImageActive(image: ResourceImageLike | null | undefin
|
|
|
115
136
|
declare const SCHOOL_MIN_STUDENT_COUNT = 300;
|
|
116
137
|
declare const SCHOOL_MAX_STUDENT_COUNT = 0;
|
|
117
138
|
|
|
118
|
-
declare const EVENT_DATE_STATUS_PERIOD_MAP: Partial<Record<
|
|
119
|
-
declare function getAllowedEventDateStatuses(period:
|
|
120
|
-
declare function eventMatchesDateStatusPeriod(dateTime: Pick<DateTimeType, "dateStatus">[] | null | undefined, period:
|
|
139
|
+
declare const EVENT_DATE_STATUS_PERIOD_MAP: Partial<Record<EnumEventDateStatus, EnumEventDateStatus[]>>;
|
|
140
|
+
declare function getAllowedEventDateStatuses(period: EnumEventDateStatus): EnumEventDateStatus[];
|
|
141
|
+
declare function eventMatchesDateStatusPeriod(dateTime: Pick<DateTimeType, "dateStatus">[] | null | undefined, period: EnumEventDateStatus): boolean;
|
|
121
142
|
declare function filterEventsByDateStatusPeriod<T extends {
|
|
122
143
|
dateTime?: Pick<DateTimeType, "dateStatus">[] | null;
|
|
123
|
-
}>(events: T[], period:
|
|
144
|
+
}>(events: T[], period: EnumEventDateStatus): T[];
|
|
124
145
|
|
|
125
146
|
type CalendarSheetContentData = {
|
|
126
147
|
dateTime: DateTimeType;
|
|
127
148
|
location: LocationType;
|
|
128
149
|
resourceId: string;
|
|
129
|
-
resourceType:
|
|
150
|
+
resourceType: EnumResourceType;
|
|
130
151
|
};
|
|
131
|
-
declare const KNOWN_EVENT_SCHEDULE_STATUSES: Set<
|
|
152
|
+
declare const KNOWN_EVENT_SCHEDULE_STATUSES: Set<EnumEventDateStatus>;
|
|
132
153
|
type EventScheduleStatusTone = "started" | "startingSoon" | "ended" | "default";
|
|
133
154
|
type EventScheduleStatusPresentation = {
|
|
134
|
-
status:
|
|
155
|
+
status: EnumEventDateStatus;
|
|
135
156
|
statusLabel: string;
|
|
136
157
|
tone: EventScheduleStatusTone;
|
|
137
158
|
};
|
|
@@ -139,11 +160,11 @@ declare function toCalendarIsoDate(startDate: string): string | null;
|
|
|
139
160
|
declare function fromCalendarIsoDate(isoDate: string): string;
|
|
140
161
|
declare function getEventCalendarIsoDates(dateTimes: DateTimeType[] | null | undefined): string[];
|
|
141
162
|
declare function findEventDateTimeByIsoDate(dateTimes: DateTimeType[] | null | undefined, isoDate: string): DateTimeType | null;
|
|
142
|
-
declare function buildCalendarSheetContentData(dateTimes: DateTimeType[], isoDate: string, location: LocationType, resourceId: string, resourceType:
|
|
143
|
-
declare function getEventScheduleStatusTone(status:
|
|
163
|
+
declare function buildCalendarSheetContentData(dateTimes: DateTimeType[], isoDate: string, location: LocationType, resourceId: string, resourceType: EnumResourceType): CalendarSheetContentData | null;
|
|
164
|
+
declare function getEventScheduleStatusTone(status: EnumEventDateStatus): EventScheduleStatusTone;
|
|
144
165
|
declare function getEventScheduleStatusPresentation(dateTime: DateTimeType): EventScheduleStatusPresentation;
|
|
145
166
|
declare function getEventScheduleStatusLabel(dateTime: DateTimeType, onlyShowKnownStatuses: boolean): string | null;
|
|
146
|
-
declare function shouldShowEventActionsWithWeather(resourceType:
|
|
167
|
+
declare function shouldShowEventActionsWithWeather(resourceType: EnumResourceType, dateTime: DateTimeType, location: LocationType | null | undefined): boolean;
|
|
147
168
|
|
|
148
169
|
type StallholderFilterOption = {
|
|
149
170
|
label: string;
|
|
@@ -167,88 +188,13 @@ declare function getStallholderCategoryNames(registeredVendors: VendorType[], un
|
|
|
167
188
|
declare function getStallholderCategoryOptions(registeredVendors: VendorType[], unregisteredVendors?: UnregisteredVendorType[]): StallholderFilterOption[];
|
|
168
189
|
declare function getEventStallholderEmptyMessage(hasAnyStallholdersForEvent: boolean, selectedDate: string | null): string;
|
|
169
190
|
|
|
170
|
-
type RelationType = NonNullable<
|
|
191
|
+
type RelationType = NonNullable<EventListItemType["relations"]>[number];
|
|
171
192
|
declare function relationHasSelectedDate(relation: RelationType, selectedDate: string): boolean;
|
|
172
193
|
declare function eventHasSelectedDate(event: EventListItemType, selectedDate: string): boolean;
|
|
173
194
|
declare function filterVendorEventsBySelectedDate(events: EventListItemType[] | null | undefined, selectedDate: string | null): EventListItemType[];
|
|
174
|
-
declare function collectVendorEventRelationDateTimes(events: EventListItemType[] | null | undefined):
|
|
195
|
+
declare function collectVendorEventRelationDateTimes(events: EventListItemType[] | null | undefined): DateTimeType[];
|
|
175
196
|
declare function getVendorEventRelationStartDates(events: EventListItemType[] | null | undefined): string[];
|
|
176
197
|
declare function getVendorEventRelationDateOptions(events: EventListItemType[] | null | undefined): StallholderFilterOption[];
|
|
177
198
|
declare function getVendorEventsEmptyMessage(): string;
|
|
178
199
|
|
|
179
|
-
|
|
180
|
-
readonly INDIVIDUAL: "Individual";
|
|
181
|
-
readonly SOLE_TRADER: "Sole Trader";
|
|
182
|
-
readonly COMPANY: "Company";
|
|
183
|
-
};
|
|
184
|
-
declare const AFFILIATE_REWARDS: {
|
|
185
|
-
NEW_EVENT_REGISTRATION: {
|
|
186
|
-
description: string;
|
|
187
|
-
value: number;
|
|
188
|
-
};
|
|
189
|
-
NEW_VENDOR_REGISTRATION: {
|
|
190
|
-
description: string;
|
|
191
|
-
value: number;
|
|
192
|
-
};
|
|
193
|
-
ACTIVE_VENDOR_PRO_SUBSCRIPTION: {
|
|
194
|
-
description: string;
|
|
195
|
-
value: number;
|
|
196
|
-
};
|
|
197
|
-
ACTIVE_VENDOR_STANDARD_SUBSCRIPTION: {
|
|
198
|
-
description: string;
|
|
199
|
-
value: number;
|
|
200
|
-
};
|
|
201
|
-
ACTIVE_VENDOR_BONUS_REWARD: {
|
|
202
|
-
description: string;
|
|
203
|
-
value: number;
|
|
204
|
-
};
|
|
205
|
-
ACTIVE_EVENT_WITH_VENDOR_REGISTRATIONS: {
|
|
206
|
-
description: string;
|
|
207
|
-
value: number;
|
|
208
|
-
};
|
|
209
|
-
};
|
|
210
|
-
/**
|
|
211
|
-
* Create an affiliate reward
|
|
212
|
-
* @param rewardType - The type of reward
|
|
213
|
-
* @param createdAt - The date the reward was received
|
|
214
|
-
* @returns The affiliate reward
|
|
215
|
-
* @example
|
|
216
|
-
* const reward = createAffiliateReward(AffiliateRewardEnumType.NewEventRegistration, new Date());
|
|
217
|
-
* console.log(reward);
|
|
218
|
-
*/
|
|
219
|
-
declare function createAffiliateReward(rewardType: AffiliateRewardEnumType, createdAt: Date): AffiliateRewardWriteType;
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* NZ IRD number validation (Inland Revenue modulus-11 check digit).
|
|
223
|
-
*
|
|
224
|
-
* Valid range: 10,000,000 – 200,000,000 (upper limit raised Feb 2026; length stays
|
|
225
|
-
* 8–9 digits). See IRD file-upload / payday filing specifications.
|
|
226
|
-
*/
|
|
227
|
-
/** Digits only; strips spaces/hyphens and other non-digits. */
|
|
228
|
-
declare function normalizeIrdNumber(value: string): string;
|
|
229
|
-
/**
|
|
230
|
-
* Formats an IRD number as groups of three digits separated by hyphens
|
|
231
|
-
* (e.g. `490-918-50` / `049-091-850`), capping at 9 digits.
|
|
232
|
-
*/
|
|
233
|
-
declare function formatIrdNumber(input: string): string;
|
|
234
|
-
/**
|
|
235
|
-
* Returns true when `value` is a valid NZ IRD number (8–9 digits, in issued
|
|
236
|
-
* range, and modulus-11 check digit matches).
|
|
237
|
-
*/
|
|
238
|
-
declare function isValidIrdNumber(value: string): boolean;
|
|
239
|
-
|
|
240
|
-
/** True for short-lived connectivity failures (e.g. resume before the stack is ready). */
|
|
241
|
-
declare function isTransientNetworkError(err: unknown): boolean;
|
|
242
|
-
|
|
243
|
-
declare const DEFAULT_USER_FACING_ERROR = "Something went wrong. Please try again.";
|
|
244
|
-
declare const NETWORK_USER_FACING_ERROR = "Unable to connect. Please check your internet connection and try again.";
|
|
245
|
-
declare function isInternalErrorMessage(message: string): boolean;
|
|
246
|
-
/**
|
|
247
|
-
* Maps raw API/client errors to a safe message for UI surfaces.
|
|
248
|
-
* Keeps intentional product copy (e.g. "Vendor not found"); hides infra details.
|
|
249
|
-
*/
|
|
250
|
-
declare function toUserFacingErrorMessage(error: string | null | undefined, fallback?: string): string;
|
|
251
|
-
/** Extracts and sanitizes an unknown catch/Apollo error for toasts and alerts. */
|
|
252
|
-
declare function getErrorMessage(error: unknown, fallback?: string): string;
|
|
253
|
-
|
|
254
|
-
export { AFFILIATE_PARTICIPANT_TYPE_LABELS, AFFILIATE_REWARDS, ANDROID_URL, CLUEMART_MAIN_DOMAIN_URL, CM_AFFILIATE_PROMO_CODE, CM_SCHOOL_PROMO_CODE, type CalendarSheetContentData, DEFAULT_RESOURCES_RETURN_LIMIT, DEFAULT_RESOURCES_RETURN_OFFSET, DEFAULT_USER_FACING_ERROR, EVENT_DATE_STATUS_PERIOD_MAP, type EventScheduleStatusPresentation, type EventScheduleStatusTone, IOS_URL, KNOWN_EVENT_SCHEDULE_STATUSES, NETWORK_USER_FACING_ERROR, PostTypeLabels, SCHOOL_MAX_STUDENT_COUNT, SCHOOL_MIN_STUDENT_COUNT, type StallholderFilterOption, availableRegionOptions, availableRegionTypes, buildCalendarSheetContentData, capitalizeFirstLetter, cluemartSocialMedia, collectStallholderStartDates, collectVendorEventRelationDateTimes, computeDailyClueState, createAffiliateReward, dateFormat, eventHasSelectedDate, eventMatchesDateStatusPeriod, eventStartDatesSet, filterEventsByDateStatusPeriod, filterRegisteredVendorsByEventDatesOnly, filterRegisteredVendorsForEvent, filterUnregisteredVendorsByEventDatesOnly, filterUnregisteredVendorsForEvent, filterVendorEventsBySelectedDate, findEventDateTimeByIsoDate, formatDate, formatIrdNumber, formatNZBankAccount, formatTimestamp, fromCalendarIsoDate, futureTimePeriods, getAllowedEventDateStatuses, getCurrentAndFutureDates, getErrorMessage, getEventCalendarIsoDates, getEventDatesWithStallholders, getEventScheduleStatusLabel, getEventScheduleStatusPresentation, getEventScheduleStatusTone, getEventStallholderEmptyMessage, getRegisteredVendorCategoryNames, getRegisteredVendorStartDates, getStallholderCategoryNames, getStallholderCategoryOptions, getUnregisteredVendorCategoryNames, getUnregisteredVendorStartDates, getVendorEventRelationDateOptions, getVendorEventRelationStartDates, getVendorEventsEmptyMessage, hasMatchingEventDate, isFutureDatesBeforeThreshold, isInternalErrorMessage, isIsoDateString, isResourceImageActive, isTransientNetworkError, isValidIrdNumber, licenseNiceNames, mapArrayToOptions, matchesCategory, matchesSelectedDate, normalizeIrdNumber, normalizeResourceImage, normalizeUrl, nzStartOfDay, paymentMethodOptions, relationHasSelectedDate, removeTypename, resolveResourceImageActive, rewardNiceNames, seededShuffle, shouldShowEventActionsWithWeather, sortDatesChronologically, statusOptions, timeFormat, toCalendarIsoDate, toNZTime, toUserFacingErrorMessage, truncateText };
|
|
200
|
+
export { AFFILIATE_REWARDS, ANDROID_URL, CLUEMART_MAIN_DOMAIN_URL, CM_AFFILIATE_PROMO_CODE, CM_SCHOOL_PROMO_CODE, type CalendarSheetContentData, DEFAULT_RESOURCES_RETURN_LIMIT, DEFAULT_RESOURCES_RETURN_OFFSET, EVENT_DATE_STATUS_PERIOD_MAP, type EventScheduleStatusPresentation, type EventScheduleStatusTone, IOS_URL, KNOWN_EVENT_SCHEDULE_STATUSES, PostTypeLabels, SCHOOL_MAX_STUDENT_COUNT, SCHOOL_MIN_STUDENT_COUNT, type StallholderFilterOption, availableRegionOptions, availableRegionTypes, buildCalendarSheetContentData, capitalizeFirstLetter, cluemartSocialMedia, collectStallholderStartDates, collectVendorEventRelationDateTimes, computeDailyClueState, createAffiliateReward, dateFormat, eventHasSelectedDate, eventMatchesDateStatusPeriod, eventStartDatesSet, filterEventsByDateStatusPeriod, filterRegisteredVendorsByEventDatesOnly, filterRegisteredVendorsForEvent, filterUnregisteredVendorsByEventDatesOnly, filterUnregisteredVendorsForEvent, filterVendorEventsBySelectedDate, findEventDateTimeByIsoDate, formatDate, formatTimestamp, fromCalendarIsoDate, futureTimePeriods, getAllowedEventDateStatuses, getCurrentAndFutureDates, getEventCalendarIsoDates, getEventDatesWithStallholders, getEventScheduleStatusLabel, getEventScheduleStatusPresentation, getEventScheduleStatusTone, getEventStallholderEmptyMessage, getRegisteredVendorCategoryNames, getRegisteredVendorStartDates, getStallholderCategoryNames, getStallholderCategoryOptions, getUnregisteredVendorCategoryNames, getUnregisteredVendorStartDates, getVendorEventRelationDateOptions, getVendorEventRelationStartDates, getVendorEventsEmptyMessage, hasMatchingEventDate, isFutureDatesBeforeThreshold, isIsoDateString, isResourceImageActive, licenseNiceNames, mapArrayToOptions, matchesCategory, matchesSelectedDate, normalizeResourceImage, normalizeUrl, nzStartOfDay, paymentMethodOptions, relationHasSelectedDate, removeTypename, resolveResourceImageActive, rewardNiceNames, seededShuffle, shouldShowEventActionsWithWeather, sortDatesChronologically, statusOptions, timeFormat, toCalendarIsoDate, toNZTime, truncateText };
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
AFFILIATE_PARTICIPANT_TYPE_LABELS,
|
|
3
2
|
AFFILIATE_REWARDS,
|
|
4
3
|
ANDROID_URL,
|
|
5
4
|
CLUEMART_MAIN_DOMAIN_URL,
|
|
@@ -7,11 +6,9 @@ import {
|
|
|
7
6
|
CM_SCHOOL_PROMO_CODE,
|
|
8
7
|
DEFAULT_RESOURCES_RETURN_LIMIT,
|
|
9
8
|
DEFAULT_RESOURCES_RETURN_OFFSET,
|
|
10
|
-
DEFAULT_USER_FACING_ERROR,
|
|
11
9
|
EVENT_DATE_STATUS_PERIOD_MAP,
|
|
12
10
|
IOS_URL,
|
|
13
11
|
KNOWN_EVENT_SCHEDULE_STATUSES,
|
|
14
|
-
NETWORK_USER_FACING_ERROR,
|
|
15
12
|
PostTypeLabels,
|
|
16
13
|
SCHOOL_MAX_STUDENT_COUNT,
|
|
17
14
|
SCHOOL_MIN_STUDENT_COUNT,
|
|
@@ -24,6 +21,7 @@ import {
|
|
|
24
21
|
collectVendorEventRelationDateTimes,
|
|
25
22
|
computeDailyClueState,
|
|
26
23
|
createAffiliateReward,
|
|
24
|
+
dateFormat,
|
|
27
25
|
eventHasSelectedDate,
|
|
28
26
|
eventMatchesDateStatusPeriod,
|
|
29
27
|
eventStartDatesSet,
|
|
@@ -34,11 +32,12 @@ import {
|
|
|
34
32
|
filterUnregisteredVendorsForEvent,
|
|
35
33
|
filterVendorEventsBySelectedDate,
|
|
36
34
|
findEventDateTimeByIsoDate,
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
formatDate,
|
|
36
|
+
formatTimestamp,
|
|
39
37
|
fromCalendarIsoDate,
|
|
38
|
+
futureTimePeriods,
|
|
40
39
|
getAllowedEventDateStatuses,
|
|
41
|
-
|
|
40
|
+
getCurrentAndFutureDates,
|
|
42
41
|
getEventCalendarIsoDates,
|
|
43
42
|
getEventDatesWithStallholders,
|
|
44
43
|
getEventScheduleStatusLabel,
|
|
@@ -55,15 +54,16 @@ import {
|
|
|
55
54
|
getVendorEventRelationStartDates,
|
|
56
55
|
getVendorEventsEmptyMessage,
|
|
57
56
|
hasMatchingEventDate,
|
|
58
|
-
|
|
57
|
+
isFutureDatesBeforeThreshold,
|
|
58
|
+
isIsoDateString,
|
|
59
59
|
isResourceImageActive,
|
|
60
|
-
isValidIrdNumber,
|
|
61
60
|
licenseNiceNames,
|
|
61
|
+
mapArrayToOptions,
|
|
62
62
|
matchesCategory,
|
|
63
63
|
matchesSelectedDate,
|
|
64
|
-
normalizeIrdNumber,
|
|
65
64
|
normalizeResourceImage,
|
|
66
65
|
normalizeUrl,
|
|
66
|
+
nzStartOfDay,
|
|
67
67
|
paymentMethodOptions,
|
|
68
68
|
relationHasSelectedDate,
|
|
69
69
|
removeTypename,
|
|
@@ -71,34 +71,16 @@ import {
|
|
|
71
71
|
rewardNiceNames,
|
|
72
72
|
seededShuffle,
|
|
73
73
|
shouldShowEventActionsWithWeather,
|
|
74
|
+
sortDatesChronologically,
|
|
74
75
|
statusOptions,
|
|
76
|
+
timeFormat,
|
|
75
77
|
toCalendarIsoDate,
|
|
76
|
-
|
|
78
|
+
toNZTime,
|
|
77
79
|
truncateText
|
|
78
|
-
} from "../chunk-
|
|
79
|
-
import
|
|
80
|
-
|
|
81
|
-
formatDate,
|
|
82
|
-
formatTimestamp,
|
|
83
|
-
futureTimePeriods,
|
|
84
|
-
getCurrentAndFutureDates,
|
|
85
|
-
isFutureDatesBeforeThreshold,
|
|
86
|
-
isIsoDateString,
|
|
87
|
-
mapArrayToOptions,
|
|
88
|
-
nzStartOfDay,
|
|
89
|
-
sortDatesChronologically,
|
|
90
|
-
timeFormat,
|
|
91
|
-
toNZTime
|
|
92
|
-
} from "../chunk-NWWKI4PJ.mjs";
|
|
93
|
-
import "../chunk-DDHECBJR.mjs";
|
|
94
|
-
import {
|
|
95
|
-
isTransientNetworkError
|
|
96
|
-
} from "../chunk-RAYUJODN.mjs";
|
|
97
|
-
import "../chunk-DATBGC2K.mjs";
|
|
98
|
-
import "../chunk-TOEFAEF2.mjs";
|
|
99
|
-
import "../chunk-INQCDU24.mjs";
|
|
80
|
+
} from "../chunk-TAECMXM4.mjs";
|
|
81
|
+
import "../chunk-MVQ3CFQR.mjs";
|
|
82
|
+
import "../chunk-KZTOISPA.mjs";
|
|
100
83
|
export {
|
|
101
|
-
AFFILIATE_PARTICIPANT_TYPE_LABELS,
|
|
102
84
|
AFFILIATE_REWARDS,
|
|
103
85
|
ANDROID_URL,
|
|
104
86
|
CLUEMART_MAIN_DOMAIN_URL,
|
|
@@ -106,11 +88,9 @@ export {
|
|
|
106
88
|
CM_SCHOOL_PROMO_CODE,
|
|
107
89
|
DEFAULT_RESOURCES_RETURN_LIMIT,
|
|
108
90
|
DEFAULT_RESOURCES_RETURN_OFFSET,
|
|
109
|
-
DEFAULT_USER_FACING_ERROR,
|
|
110
91
|
EVENT_DATE_STATUS_PERIOD_MAP,
|
|
111
92
|
IOS_URL,
|
|
112
93
|
KNOWN_EVENT_SCHEDULE_STATUSES,
|
|
113
|
-
NETWORK_USER_FACING_ERROR,
|
|
114
94
|
PostTypeLabels,
|
|
115
95
|
SCHOOL_MAX_STUDENT_COUNT,
|
|
116
96
|
SCHOOL_MIN_STUDENT_COUNT,
|
|
@@ -135,14 +115,11 @@ export {
|
|
|
135
115
|
filterVendorEventsBySelectedDate,
|
|
136
116
|
findEventDateTimeByIsoDate,
|
|
137
117
|
formatDate,
|
|
138
|
-
formatIrdNumber,
|
|
139
|
-
formatNZBankAccount,
|
|
140
118
|
formatTimestamp,
|
|
141
119
|
fromCalendarIsoDate,
|
|
142
120
|
futureTimePeriods,
|
|
143
121
|
getAllowedEventDateStatuses,
|
|
144
122
|
getCurrentAndFutureDates,
|
|
145
|
-
getErrorMessage,
|
|
146
123
|
getEventCalendarIsoDates,
|
|
147
124
|
getEventDatesWithStallholders,
|
|
148
125
|
getEventScheduleStatusLabel,
|
|
@@ -160,16 +137,12 @@ export {
|
|
|
160
137
|
getVendorEventsEmptyMessage,
|
|
161
138
|
hasMatchingEventDate,
|
|
162
139
|
isFutureDatesBeforeThreshold,
|
|
163
|
-
isInternalErrorMessage,
|
|
164
140
|
isIsoDateString,
|
|
165
141
|
isResourceImageActive,
|
|
166
|
-
isTransientNetworkError,
|
|
167
|
-
isValidIrdNumber,
|
|
168
142
|
licenseNiceNames,
|
|
169
143
|
mapArrayToOptions,
|
|
170
144
|
matchesCategory,
|
|
171
145
|
matchesSelectedDate,
|
|
172
|
-
normalizeIrdNumber,
|
|
173
146
|
normalizeResourceImage,
|
|
174
147
|
normalizeUrl,
|
|
175
148
|
nzStartOfDay,
|
|
@@ -185,7 +158,6 @@ export {
|
|
|
185
158
|
timeFormat,
|
|
186
159
|
toCalendarIsoDate,
|
|
187
160
|
toNZTime,
|
|
188
|
-
toUserFacingErrorMessage,
|
|
189
161
|
truncateText
|
|
190
162
|
};
|
|
191
163
|
//# sourceMappingURL=index.mjs.map
|