@timardex/cluemart-shared 1.6.112 → 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.
Files changed (145) hide show
  1. package/dist/ad-CVkVX_z5.d.ts +296 -0
  2. package/dist/ad-DA9ECAhK.d.mts +296 -0
  3. package/dist/affiliate-1RtkLnLP.d.ts +35 -0
  4. package/dist/affiliate-Cos2Syz5.d.mts +35 -0
  5. package/dist/{chunk-R6PCFOYO.mjs → chunk-HZMP7GXC.mjs} +2628 -948
  6. package/dist/chunk-HZMP7GXC.mjs.map +1 -0
  7. package/dist/{chunk-X3OLM35T.mjs → chunk-KZTOISPA.mjs} +8 -14
  8. package/dist/chunk-KZTOISPA.mjs.map +1 -0
  9. package/dist/{chunk-ILILH7E2.mjs → chunk-MVQ3CFQR.mjs} +23 -12
  10. package/dist/chunk-MVQ3CFQR.mjs.map +1 -0
  11. package/dist/{chunk-AYO3E4DM.mjs → chunk-RKIRWZCH.mjs} +183 -39
  12. package/dist/chunk-RKIRWZCH.mjs.map +1 -0
  13. package/dist/{chunk-LBEJECG3.mjs → chunk-TAECMXM4.mjs} +219 -249
  14. package/dist/{chunk-LBEJECG3.mjs.map → chunk-TAECMXM4.mjs.map} +1 -1
  15. package/dist/{chunk-BIJ5NDXW.mjs → chunk-ZZJSCYJK.mjs} +42 -46
  16. package/dist/chunk-ZZJSCYJK.mjs.map +1 -0
  17. package/dist/{contactUs-CBWzefUS.d.mts → contactUs-DGrDzJaM.d.mts} +1 -1
  18. package/dist/{contactUs--NoohZBu.d.ts → contactUs-H7799pWe.d.ts} +1 -1
  19. package/dist/enums/index.cjs +7 -13
  20. package/dist/enums/index.cjs.map +1 -1
  21. package/dist/enums/index.d.mts +9 -15
  22. package/dist/enums/index.d.ts +9 -15
  23. package/dist/enums/index.mjs +1 -1
  24. package/dist/formFields/index.cjs +73 -136
  25. package/dist/formFields/index.cjs.map +1 -1
  26. package/dist/formFields/index.d.mts +2 -3
  27. package/dist/formFields/index.d.ts +2 -3
  28. package/dist/formFields/index.mjs +4 -9
  29. package/dist/{global-DePDtOFt.d.mts → global-BUUfmCo7.d.mts} +11 -12
  30. package/dist/{global-CUYYxpy2.d.ts → global-fKbMmluy.d.ts} +11 -12
  31. package/dist/graphql/index.cjs +1251 -694
  32. package/dist/graphql/index.cjs.map +1 -1
  33. package/dist/graphql/index.d.mts +173 -423
  34. package/dist/graphql/index.d.ts +173 -423
  35. package/dist/graphql/index.mjs +21 -33
  36. package/dist/hooks/index.cjs +306 -936
  37. package/dist/hooks/index.cjs.map +1 -1
  38. package/dist/hooks/index.d.mts +4 -10
  39. package/dist/hooks/index.d.ts +4 -10
  40. package/dist/hooks/index.mjs +58 -170
  41. package/dist/hooks/index.mjs.map +1 -1
  42. package/dist/images/apple-maps-icon.webp.d.ts +1 -8
  43. package/dist/images/banner-horizontal.webp.d.ts +1 -8
  44. package/dist/images/banner-vertical.webp.d.ts +1 -8
  45. package/dist/images/cluiTui.webp.d.ts +1 -8
  46. package/dist/images/corporate.webp.d.ts +1 -8
  47. package/dist/images/facebook.webp.d.ts +1 -8
  48. package/dist/images/gazebo-top.webp.d.ts +1 -8
  49. package/dist/images/google-maps-icon.webp.d.ts +1 -8
  50. package/dist/images/googleMaps-logo-dark.webp.d.ts +1 -8
  51. package/dist/images/googleMaps-logo-light.webp.d.ts +1 -8
  52. package/dist/images/instagram.webp.d.ts +1 -8
  53. package/dist/images/logo-atr.webp.d.ts +1 -8
  54. package/dist/images/logo-dark.webp.d.ts +1 -8
  55. package/dist/images/logo.webp.d.ts +1 -8
  56. package/dist/images/meet.webp.d.ts +1 -8
  57. package/dist/images/mini-market1.webp.d.ts +1 -8
  58. package/dist/images/mini-market2.webp.d.ts +1 -8
  59. package/dist/images/mini-market3.webp.d.ts +1 -8
  60. package/dist/images/mini-market4.webp.d.ts +1 -8
  61. package/dist/images/mini-market5.webp.d.ts +1 -8
  62. package/dist/images/poll.webp.d.ts +1 -8
  63. package/dist/images/poster1.webp.d.ts +1 -8
  64. package/dist/images/poster2.webp.d.ts +1 -8
  65. package/dist/images/poster3.webp.d.ts +1 -8
  66. package/dist/images/poster4.webp.d.ts +1 -8
  67. package/dist/images/private.webp.d.ts +1 -8
  68. package/dist/images/qr-code.webp.d.ts +1 -8
  69. package/dist/images/school.webp.d.ts +1 -8
  70. package/dist/images/sima.webp.d.ts +1 -8
  71. package/dist/images/store-android.webp.d.ts +1 -8
  72. package/dist/images/store-ios.webp.d.ts +1 -8
  73. package/dist/images/tablas.webp.d.ts +1 -8
  74. package/dist/images/telefonos.webp.d.ts +1 -8
  75. package/dist/images/tiktok.webp.d.ts +1 -8
  76. package/dist/images/tip.webp.d.ts +1 -8
  77. package/dist/images/ugralos.webp.d.ts +1 -8
  78. package/dist/images/waze-maps-icon.webp.d.ts +1 -8
  79. package/dist/images/website.webp.d.ts +1 -8
  80. package/dist/images/youtube.webp.d.ts +1 -8
  81. package/dist/index.cjs +1673 -1623
  82. package/dist/index.cjs.map +1 -1
  83. package/dist/index.d.mts +240 -654
  84. package/dist/index.d.ts +240 -654
  85. package/dist/index.mjs +1672 -1585
  86. package/dist/index.mjs.map +1 -1
  87. package/dist/map/index.cjs +9 -14
  88. package/dist/map/index.cjs.map +1 -1
  89. package/dist/map/index.d.mts +13 -16
  90. package/dist/map/index.d.ts +13 -16
  91. package/dist/map/index.mjs +9 -14
  92. package/dist/map/index.mjs.map +1 -1
  93. package/dist/{resourceActivities-CMUcn2P7.d.ts → resourceActivities-BL_12IAo.d.ts} +4 -9
  94. package/dist/{resourceActivities-CwbJFGIp.d.mts → resourceActivities-zczOntNk.d.mts} +4 -9
  95. package/dist/sharing/index.cjs +1252 -39
  96. package/dist/sharing/index.cjs.map +1 -1
  97. package/dist/sharing/index.d.mts +5 -17
  98. package/dist/sharing/index.d.ts +5 -17
  99. package/dist/sharing/index.mjs +30 -34
  100. package/dist/types/index.cjs +2 -15
  101. package/dist/types/index.cjs.map +1 -1
  102. package/dist/types/index.d.mts +23 -10
  103. package/dist/types/index.d.ts +23 -10
  104. package/dist/types/index.mjs +5 -9
  105. package/dist/utils/index.cjs +136 -355
  106. package/dist/utils/index.cjs.map +1 -1
  107. package/dist/utils/index.d.mts +35 -87
  108. package/dist/utils/index.d.ts +35 -87
  109. package/dist/utils/index.mjs +15 -42
  110. package/package.json +10 -31
  111. package/dist/ad-BUYzE6zx.d.ts +0 -181
  112. package/dist/ad-BhLoEul3.d.mts +0 -181
  113. package/dist/affiliate-BbtjeUP4.d.mts +0 -73
  114. package/dist/affiliate-C51nzKsw.d.ts +0 -73
  115. package/dist/apollo/index.cjs +0 -1383
  116. package/dist/apollo/index.cjs.map +0 -1
  117. package/dist/apollo/index.d.mts +0 -323
  118. package/dist/apollo/index.d.ts +0 -323
  119. package/dist/apollo/index.mjs +0 -1295
  120. package/dist/apollo/index.mjs.map +0 -1
  121. package/dist/auth/index.cjs +0 -1727
  122. package/dist/auth/index.cjs.map +0 -1
  123. package/dist/auth/index.d.mts +0 -166
  124. package/dist/auth/index.d.ts +0 -166
  125. package/dist/auth/index.mjs +0 -380
  126. package/dist/auth/index.mjs.map +0 -1
  127. package/dist/chunk-32MKHJTX.mjs +0 -1207
  128. package/dist/chunk-32MKHJTX.mjs.map +0 -1
  129. package/dist/chunk-AYO3E4DM.mjs.map +0 -1
  130. package/dist/chunk-BIJ5NDXW.mjs.map +0 -1
  131. package/dist/chunk-DQ7ZHIXW.mjs +0 -26
  132. package/dist/chunk-DQ7ZHIXW.mjs.map +0 -1
  133. package/dist/chunk-ILILH7E2.mjs.map +0 -1
  134. package/dist/chunk-R6PCFOYO.mjs.map +0 -1
  135. package/dist/chunk-RAYUJODN.mjs +0 -45
  136. package/dist/chunk-RAYUJODN.mjs.map +0 -1
  137. package/dist/chunk-SD42WIMV.mjs +0 -297
  138. package/dist/chunk-SD42WIMV.mjs.map +0 -1
  139. package/dist/chunk-VPANTTZI.mjs +0 -262
  140. package/dist/chunk-VPANTTZI.mjs.map +0 -1
  141. package/dist/chunk-X3OLM35T.mjs.map +0 -1
  142. package/dist/subscription-BU8GvH2K.d.ts +0 -12
  143. package/dist/subscription-bmAdrnfi.d.mts +0 -12
  144. package/dist/user-D47MLFyH.d.ts +0 -134
  145. package/dist/user-DE8edl3u.d.mts +0 -134
@@ -1,9 +1,8 @@
1
- import { J as DailyClueGameData, a0 as GamePlacementClue, $ as GamePlacement, O as OptionItem, k as EnumPostType, aw as SocialMediaType, av as ResourceImageType, K as DateTimeType, L as LocationType, V as VendorType, g as UnregisteredVendorType, c as EventListItemType } from '../global-DePDtOFt.mjs';
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
3
  import { EnumRegions, EnumUserLicence, EnumReward, EnumInviteStatus, EnumEventDateStatus, EnumResourceType } from '../enums/index.mjs';
4
- import { h as EnumAffiliateRewardType, f as AffiliateRewardType } from '../affiliate-BbtjeUP4.mjs';
4
+ import { E as EnumAffiliateRewardType, b as AffiliateReward } from '../affiliate-Cos2Syz5.mjs';
5
5
  import 'react-hook-form';
6
- import '../user-DE8edl3u.mjs';
7
6
 
8
7
  /** Seeded shuffle so all players see the same letter order / placements for a game. */
9
8
  declare function seededShuffle<T>(array: readonly T[], seed: string): T[];
@@ -51,11 +50,6 @@ declare const futureTimePeriods: {
51
50
  value: string;
52
51
  }[];
53
52
 
54
- /**
55
- * Convert an array of strings to an array of objects with label and value properties.
56
- */
57
- declare const mapArrayToOptions: (items: string[]) => OptionItem[];
58
-
59
53
  declare const removeTypename: (obj: any) => any;
60
54
  /**
61
55
  * Truncate text to a specified length and append ellipsis if necessary.
@@ -64,6 +58,12 @@ declare const removeTypename: (obj: any) => any;
64
58
  * @returns
65
59
  */
66
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[];
67
67
  declare const capitalizeFirstLetter: (str: string) => string;
68
68
  declare const statusOptions: {
69
69
  label: EnumInviteStatus;
@@ -85,11 +85,34 @@ declare const rewardNiceNames: Record<EnumReward, {
85
85
  points: number;
86
86
  }>;
87
87
  declare const PostTypeLabels: Record<EnumPostType, string>;
88
- /** Hardcoded registration gateway code; only valid at sign-up (not a generated school referral code). */
88
+ /** Hardcoded promo; compared to trimmed + uppercased registration input. */
89
89
  declare const CM_SCHOOL_PROMO_CODE = "CM-SCHOOL";
90
- /** Hardcoded registration gateway code; only valid at sign-up (not a generated affiliate referral code). */
91
90
  declare const CM_AFFILIATE_PROMO_CODE = "CM-AFFILIATE";
92
- declare function formatNZBankAccount(input: string): string;
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;
93
116
 
94
117
  /**
95
118
  * Loose input shape for normalization helpers. Callers often pass partial or legacy
@@ -174,79 +197,4 @@ declare function getVendorEventRelationStartDates(events: EventListItemType[] |
174
197
  declare function getVendorEventRelationDateOptions(events: EventListItemType[] | null | undefined): StallholderFilterOption[];
175
198
  declare function getVendorEventsEmptyMessage(): string;
176
199
 
177
- declare const AFFILIATE_PARTICIPANT_TYPE_LABELS: {
178
- readonly INDIVIDUAL: "Individual";
179
- readonly SOLE_TRADER: "Sole Trader";
180
- readonly COMPANY: "Company";
181
- };
182
- declare const AFFILIATE_REWARDS: {
183
- NEW_EVENT_REGISTRATION: {
184
- description: string;
185
- value: number;
186
- };
187
- NEW_VENDOR_REGISTRATION: {
188
- description: string;
189
- value: number;
190
- };
191
- ACTIVE_VENDOR_PRO_SUBSCRIPTION: {
192
- description: string;
193
- value: number;
194
- };
195
- ACTIVE_VENDOR_STANDARD_SUBSCRIPTION: {
196
- description: string;
197
- value: number;
198
- };
199
- ACTIVE_VENDOR_BONUS_REWARD: {
200
- description: string;
201
- value: number;
202
- };
203
- ACTIVE_EVENT_WITH_VENDOR_REGISTRATIONS: {
204
- description: string;
205
- value: number;
206
- };
207
- };
208
- /**
209
- * Create an affiliate reward
210
- * @param rewardType - The type of reward
211
- * @param createdAt - The date the reward was received
212
- * @returns The affiliate reward
213
- * @example
214
- * const reward = createAffiliateReward(EnumAffiliateRewardType.NEW_EVENT_REGISTRATION, new Date());
215
- * console.log(reward);
216
- */
217
- declare function createAffiliateReward(rewardType: EnumAffiliateRewardType, createdAt: Date): AffiliateRewardType;
218
-
219
- /**
220
- * NZ IRD number validation (Inland Revenue modulus-11 check digit).
221
- *
222
- * Valid range: 10,000,000 – 200,000,000 (upper limit raised Feb 2026; length stays
223
- * 8–9 digits). See IRD file-upload / payday filing specifications.
224
- */
225
- /** Digits only; strips spaces/hyphens and other non-digits. */
226
- declare function normalizeIrdNumber(value: string): string;
227
- /**
228
- * Formats an IRD number as groups of three digits separated by hyphens
229
- * (e.g. `490-918-50` / `049-091-850`), capping at 9 digits.
230
- */
231
- declare function formatIrdNumber(input: string): string;
232
- /**
233
- * Returns true when `value` is a valid NZ IRD number (8–9 digits, in issued
234
- * range, and modulus-11 check digit matches).
235
- */
236
- declare function isValidIrdNumber(value: string): boolean;
237
-
238
- /** True for short-lived connectivity failures (e.g. resume before the stack is ready). */
239
- declare function isTransientNetworkError(err: unknown): boolean;
240
-
241
- declare const DEFAULT_USER_FACING_ERROR = "Something went wrong. Please try again.";
242
- declare const NETWORK_USER_FACING_ERROR = "Unable to connect. Please check your internet connection and try again.";
243
- declare function isInternalErrorMessage(message: string): boolean;
244
- /**
245
- * Maps raw API/client errors to a safe message for UI surfaces.
246
- * Keeps intentional product copy (e.g. "Vendor not found"); hides infra details.
247
- */
248
- declare function toUserFacingErrorMessage(error: string | null | undefined, fallback?: string): string;
249
- /** Extracts and sanitizes an unknown catch/Apollo error for toasts and alerts. */
250
- declare function getErrorMessage(error: unknown, fallback?: string): string;
251
-
252
- 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 };
@@ -1,9 +1,8 @@
1
- import { J as DailyClueGameData, a0 as GamePlacementClue, $ as GamePlacement, O as OptionItem, k as EnumPostType, aw as SocialMediaType, av as ResourceImageType, K as DateTimeType, L as LocationType, V as VendorType, g as UnregisteredVendorType, c as EventListItemType } from '../global-CUYYxpy2.js';
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
3
  import { EnumRegions, EnumUserLicence, EnumReward, EnumInviteStatus, EnumEventDateStatus, EnumResourceType } from '../enums/index.js';
4
- import { h as EnumAffiliateRewardType, f as AffiliateRewardType } from '../affiliate-C51nzKsw.js';
4
+ import { E as EnumAffiliateRewardType, b as AffiliateReward } from '../affiliate-1RtkLnLP.js';
5
5
  import 'react-hook-form';
6
- import '../user-D47MLFyH.js';
7
6
 
8
7
  /** Seeded shuffle so all players see the same letter order / placements for a game. */
9
8
  declare function seededShuffle<T>(array: readonly T[], seed: string): T[];
@@ -51,11 +50,6 @@ declare const futureTimePeriods: {
51
50
  value: string;
52
51
  }[];
53
52
 
54
- /**
55
- * Convert an array of strings to an array of objects with label and value properties.
56
- */
57
- declare const mapArrayToOptions: (items: string[]) => OptionItem[];
58
-
59
53
  declare const removeTypename: (obj: any) => any;
60
54
  /**
61
55
  * Truncate text to a specified length and append ellipsis if necessary.
@@ -64,6 +58,12 @@ declare const removeTypename: (obj: any) => any;
64
58
  * @returns
65
59
  */
66
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[];
67
67
  declare const capitalizeFirstLetter: (str: string) => string;
68
68
  declare const statusOptions: {
69
69
  label: EnumInviteStatus;
@@ -85,11 +85,34 @@ declare const rewardNiceNames: Record<EnumReward, {
85
85
  points: number;
86
86
  }>;
87
87
  declare const PostTypeLabels: Record<EnumPostType, string>;
88
- /** Hardcoded registration gateway code; only valid at sign-up (not a generated school referral code). */
88
+ /** Hardcoded promo; compared to trimmed + uppercased registration input. */
89
89
  declare const CM_SCHOOL_PROMO_CODE = "CM-SCHOOL";
90
- /** Hardcoded registration gateway code; only valid at sign-up (not a generated affiliate referral code). */
91
90
  declare const CM_AFFILIATE_PROMO_CODE = "CM-AFFILIATE";
92
- declare function formatNZBankAccount(input: string): string;
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;
93
116
 
94
117
  /**
95
118
  * Loose input shape for normalization helpers. Callers often pass partial or legacy
@@ -174,79 +197,4 @@ declare function getVendorEventRelationStartDates(events: EventListItemType[] |
174
197
  declare function getVendorEventRelationDateOptions(events: EventListItemType[] | null | undefined): StallholderFilterOption[];
175
198
  declare function getVendorEventsEmptyMessage(): string;
176
199
 
177
- declare const AFFILIATE_PARTICIPANT_TYPE_LABELS: {
178
- readonly INDIVIDUAL: "Individual";
179
- readonly SOLE_TRADER: "Sole Trader";
180
- readonly COMPANY: "Company";
181
- };
182
- declare const AFFILIATE_REWARDS: {
183
- NEW_EVENT_REGISTRATION: {
184
- description: string;
185
- value: number;
186
- };
187
- NEW_VENDOR_REGISTRATION: {
188
- description: string;
189
- value: number;
190
- };
191
- ACTIVE_VENDOR_PRO_SUBSCRIPTION: {
192
- description: string;
193
- value: number;
194
- };
195
- ACTIVE_VENDOR_STANDARD_SUBSCRIPTION: {
196
- description: string;
197
- value: number;
198
- };
199
- ACTIVE_VENDOR_BONUS_REWARD: {
200
- description: string;
201
- value: number;
202
- };
203
- ACTIVE_EVENT_WITH_VENDOR_REGISTRATIONS: {
204
- description: string;
205
- value: number;
206
- };
207
- };
208
- /**
209
- * Create an affiliate reward
210
- * @param rewardType - The type of reward
211
- * @param createdAt - The date the reward was received
212
- * @returns The affiliate reward
213
- * @example
214
- * const reward = createAffiliateReward(EnumAffiliateRewardType.NEW_EVENT_REGISTRATION, new Date());
215
- * console.log(reward);
216
- */
217
- declare function createAffiliateReward(rewardType: EnumAffiliateRewardType, createdAt: Date): AffiliateRewardType;
218
-
219
- /**
220
- * NZ IRD number validation (Inland Revenue modulus-11 check digit).
221
- *
222
- * Valid range: 10,000,000 – 200,000,000 (upper limit raised Feb 2026; length stays
223
- * 8–9 digits). See IRD file-upload / payday filing specifications.
224
- */
225
- /** Digits only; strips spaces/hyphens and other non-digits. */
226
- declare function normalizeIrdNumber(value: string): string;
227
- /**
228
- * Formats an IRD number as groups of three digits separated by hyphens
229
- * (e.g. `490-918-50` / `049-091-850`), capping at 9 digits.
230
- */
231
- declare function formatIrdNumber(input: string): string;
232
- /**
233
- * Returns true when `value` is a valid NZ IRD number (8–9 digits, in issued
234
- * range, and modulus-11 check digit matches).
235
- */
236
- declare function isValidIrdNumber(value: string): boolean;
237
-
238
- /** True for short-lived connectivity failures (e.g. resume before the stack is ready). */
239
- declare function isTransientNetworkError(err: unknown): boolean;
240
-
241
- declare const DEFAULT_USER_FACING_ERROR = "Something went wrong. Please try again.";
242
- declare const NETWORK_USER_FACING_ERROR = "Unable to connect. Please check your internet connection and try again.";
243
- declare function isInternalErrorMessage(message: string): boolean;
244
- /**
245
- * Maps raw API/client errors to a safe message for UI surfaces.
246
- * Keeps intentional product copy (e.g. "Vendor not found"); hides infra details.
247
- */
248
- declare function toUserFacingErrorMessage(error: string | null | undefined, fallback?: string): string;
249
- /** Extracts and sanitizes an unknown catch/Apollo error for toasts and alerts. */
250
- declare function getErrorMessage(error: unknown, fallback?: string): string;
251
-
252
- 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 };
@@ -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
- formatIrdNumber,
38
- formatNZBankAccount,
35
+ formatDate,
36
+ formatTimestamp,
39
37
  fromCalendarIsoDate,
38
+ futureTimePeriods,
40
39
  getAllowedEventDateStatuses,
41
- getErrorMessage,
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
- isInternalErrorMessage,
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,33 +71,16 @@ import {
71
71
  rewardNiceNames,
72
72
  seededShuffle,
73
73
  shouldShowEventActionsWithWeather,
74
+ sortDatesChronologically,
74
75
  statusOptions,
76
+ timeFormat,
75
77
  toCalendarIsoDate,
76
- toUserFacingErrorMessage,
78
+ toNZTime,
77
79
  truncateText
78
- } from "../chunk-LBEJECG3.mjs";
79
- import {
80
- dateFormat,
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-SD42WIMV.mjs";
93
- import "../chunk-ILILH7E2.mjs";
94
- import {
95
- isTransientNetworkError
96
- } from "../chunk-RAYUJODN.mjs";
97
- import "../chunk-DQ7ZHIXW.mjs";
98
- import "../chunk-X3OLM35T.mjs";
80
+ } from "../chunk-TAECMXM4.mjs";
81
+ import "../chunk-MVQ3CFQR.mjs";
82
+ import "../chunk-KZTOISPA.mjs";
99
83
  export {
100
- AFFILIATE_PARTICIPANT_TYPE_LABELS,
101
84
  AFFILIATE_REWARDS,
102
85
  ANDROID_URL,
103
86
  CLUEMART_MAIN_DOMAIN_URL,
@@ -105,11 +88,9 @@ export {
105
88
  CM_SCHOOL_PROMO_CODE,
106
89
  DEFAULT_RESOURCES_RETURN_LIMIT,
107
90
  DEFAULT_RESOURCES_RETURN_OFFSET,
108
- DEFAULT_USER_FACING_ERROR,
109
91
  EVENT_DATE_STATUS_PERIOD_MAP,
110
92
  IOS_URL,
111
93
  KNOWN_EVENT_SCHEDULE_STATUSES,
112
- NETWORK_USER_FACING_ERROR,
113
94
  PostTypeLabels,
114
95
  SCHOOL_MAX_STUDENT_COUNT,
115
96
  SCHOOL_MIN_STUDENT_COUNT,
@@ -134,14 +115,11 @@ export {
134
115
  filterVendorEventsBySelectedDate,
135
116
  findEventDateTimeByIsoDate,
136
117
  formatDate,
137
- formatIrdNumber,
138
- formatNZBankAccount,
139
118
  formatTimestamp,
140
119
  fromCalendarIsoDate,
141
120
  futureTimePeriods,
142
121
  getAllowedEventDateStatuses,
143
122
  getCurrentAndFutureDates,
144
- getErrorMessage,
145
123
  getEventCalendarIsoDates,
146
124
  getEventDatesWithStallholders,
147
125
  getEventScheduleStatusLabel,
@@ -159,16 +137,12 @@ export {
159
137
  getVendorEventsEmptyMessage,
160
138
  hasMatchingEventDate,
161
139
  isFutureDatesBeforeThreshold,
162
- isInternalErrorMessage,
163
140
  isIsoDateString,
164
141
  isResourceImageActive,
165
- isTransientNetworkError,
166
- isValidIrdNumber,
167
142
  licenseNiceNames,
168
143
  mapArrayToOptions,
169
144
  matchesCategory,
170
145
  matchesSelectedDate,
171
- normalizeIrdNumber,
172
146
  normalizeResourceImage,
173
147
  normalizeUrl,
174
148
  nzStartOfDay,
@@ -184,7 +158,6 @@ export {
184
158
  timeFormat,
185
159
  toCalendarIsoDate,
186
160
  toNZTime,
187
- toUserFacingErrorMessage,
188
161
  truncateText
189
162
  };
190
163
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timardex/cluemart-shared",
3
- "version": "1.6.112",
3
+ "version": "1.7.0",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -41,16 +41,6 @@
41
41
  "import": "./dist/hooks/index.mjs",
42
42
  "require": "./dist/hooks/index.cjs"
43
43
  },
44
- "./auth": {
45
- "types": "./dist/auth/index.d.ts",
46
- "import": "./dist/auth/index.mjs",
47
- "require": "./dist/auth/index.cjs"
48
- },
49
- "./apollo": {
50
- "types": "./dist/apollo/index.d.ts",
51
- "import": "./dist/apollo/index.mjs",
52
- "require": "./dist/apollo/index.cjs"
53
- },
54
44
  "./map": {
55
45
  "types": "./dist/map/index.d.ts",
56
46
  "import": "./dist/map/index.mjs",
@@ -91,10 +81,7 @@
91
81
  "import": "./dist/images/node.mjs",
92
82
  "require": "./dist/images/node.cjs"
93
83
  },
94
- "./images/*": {
95
- "types": "./dist/images/*.d.ts",
96
- "default": "./dist/images/*"
97
- }
84
+ "./images/*": "./dist/images/*"
98
85
  },
99
86
  "files": [
100
87
  "dist"
@@ -102,20 +89,7 @@
102
89
  "keywords": [],
103
90
  "author": "",
104
91
  "license": "ISC",
105
- "dependencies": {
106
- "@hookform/resolvers": "4.1.1",
107
- "dayjs": "^1.11.21",
108
- "react-hook-form": "7.54.2",
109
- "yup": "1.6.1"
110
- },
111
- "peerDependencies": {
112
- "@apollo/client": "^3.14.1",
113
- "graphql": "^16.12.0",
114
- "graphql-ws": "^6.0.6",
115
- "react": "^19.2.3"
116
- },
117
92
  "devDependencies": {
118
- "@apollo/client": "^3.14.1",
119
93
  "@types/node": "^22.13.4",
120
94
  "@types/react": "~19.2.10",
121
95
  "@typescript-eslint/eslint-plugin": "^8.20.0",
@@ -126,15 +100,20 @@
126
100
  "eslint-import-resolver-typescript": "^3.6.1",
127
101
  "eslint-plugin-import": "^2.29.1",
128
102
  "eslint-plugin-prettier": "^5.2.6",
129
- "graphql": "^16.12.0",
130
- "graphql-ws": "^6.0.6",
131
103
  "prettier": "^3.4.2",
132
104
  "prettier-eslint": "^16.4.1",
133
- "react": "19.2.3",
134
105
  "rimraf": "^6.0.1",
135
106
  "tsup": "^8.3.6",
136
107
  "typescript": "^5.7.3",
137
108
  "typescript-eslint": "^8.31.1",
138
109
  "vitest": "^3.2.4"
110
+ },
111
+ "dependencies": {
112
+ "@apollo/client": "^3.14.1",
113
+ "@hookform/resolvers": "4.1.1",
114
+ "dayjs": "^1.11.21",
115
+ "react": "19.2.3",
116
+ "react-hook-form": "7.54.2",
117
+ "yup": "1.6.1"
139
118
  }
140
119
  }