@timardex/cluemart-shared 1.6.112 → 1.6.130

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/dist/affiliate-Bqqlffw8.d.mts +36 -0
  2. package/dist/affiliate-Btlp5XUp.d.ts +36 -0
  3. package/dist/affiliateAdapters-BW3BY7c5.d.mts +118 -0
  4. package/dist/affiliateAdapters-C51ISmuA.d.ts +118 -0
  5. package/dist/apollo/index.d.mts +3 -3
  6. package/dist/apollo/index.d.ts +3 -3
  7. package/dist/auth/index.cjs +2546 -951
  8. package/dist/auth/index.cjs.map +1 -1
  9. package/dist/auth/index.d.mts +28 -30
  10. package/dist/auth/index.d.ts +28 -30
  11. package/dist/auth/index.mjs +24 -25
  12. package/dist/auth/index.mjs.map +1 -1
  13. package/dist/auth-BOmAO53v.d.ts +169 -0
  14. package/dist/auth-CsITA95p.d.mts +169 -0
  15. package/dist/{chunk-VPANTTZI.mjs → chunk-DATBGC2K.mjs} +108 -23
  16. package/dist/chunk-DATBGC2K.mjs.map +1 -0
  17. package/dist/chunk-DDHECBJR.mjs +726 -0
  18. package/dist/chunk-DDHECBJR.mjs.map +1 -0
  19. package/dist/chunk-INQCDU24.mjs +139 -0
  20. package/dist/chunk-INQCDU24.mjs.map +1 -0
  21. package/dist/{chunk-SD42WIMV.mjs → chunk-NWWKI4PJ.mjs} +5 -5
  22. package/dist/chunk-NWWKI4PJ.mjs.map +1 -0
  23. package/dist/{chunk-LBEJECG3.mjs → chunk-OHHJ3KJJ.mjs} +71 -64
  24. package/dist/chunk-OHHJ3KJJ.mjs.map +1 -0
  25. package/dist/chunk-TOEFAEF2.mjs +69 -0
  26. package/dist/chunk-TOEFAEF2.mjs.map +1 -0
  27. package/dist/chunk-UKW7NZEQ.mjs +2813 -0
  28. package/dist/chunk-UKW7NZEQ.mjs.map +1 -0
  29. package/dist/dailyClue-C6WXY73z.d.mts +105 -0
  30. package/dist/dailyClue-C6WXY73z.d.ts +105 -0
  31. package/dist/enums/index.cjs +2 -229
  32. package/dist/enums/index.cjs.map +1 -1
  33. package/dist/enums/index.d.mts +5 -170
  34. package/dist/enums/index.d.ts +5 -170
  35. package/dist/enums/index.mjs +1 -41
  36. package/dist/event-C9K7CSg4.d.ts +53 -0
  37. package/dist/event-W0NhL5Cd.d.mts +53 -0
  38. package/dist/formFields/index.cjs +284 -112
  39. package/dist/formFields/index.cjs.map +1 -1
  40. package/dist/formFields/index.d.mts +4 -2
  41. package/dist/formFields/index.d.ts +4 -2
  42. package/dist/formFields/index.mjs +919 -50
  43. package/dist/formFields/index.mjs.map +1 -1
  44. package/dist/global-BbSFfYdd.d.ts +181 -0
  45. package/dist/global-C6v9tRji.d.mts +181 -0
  46. package/dist/graphql/index.cjs +2860 -2292
  47. package/dist/graphql/index.cjs.map +1 -1
  48. package/dist/graphql/index.d.mts +422 -469
  49. package/dist/graphql/index.d.ts +422 -469
  50. package/dist/graphql/index.mjs +2547 -160
  51. package/dist/graphql/index.mjs.map +1 -1
  52. package/dist/graphql-CDOfA79A.d.ts +1253 -0
  53. package/dist/graphql-CcvzTs9k.d.mts +1253 -0
  54. package/dist/hooks/index.cjs +511 -3846
  55. package/dist/hooks/index.cjs.map +1 -1
  56. package/dist/hooks/index.d.mts +10 -9
  57. package/dist/hooks/index.d.ts +10 -9
  58. package/dist/hooks/index.mjs +54 -72
  59. package/dist/hooks/index.mjs.map +1 -1
  60. package/dist/images/index.mjs +86 -21
  61. package/dist/images/index.mjs.map +1 -1
  62. package/dist/index.cjs +4414 -3168
  63. package/dist/index.cjs.map +1 -1
  64. package/dist/index.d.mts +2439 -1579
  65. package/dist/index.d.ts +2439 -1579
  66. package/dist/index.mjs +4350 -3121
  67. package/dist/index.mjs.map +1 -1
  68. package/dist/map/index.d.mts +3 -2
  69. package/dist/map/index.d.ts +3 -2
  70. package/dist/resourceActivities-CS8YRIIL.d.mts +89 -0
  71. package/dist/resourceActivities-DOdNPkhW.d.ts +89 -0
  72. package/dist/sharing/index.cjs +23 -19
  73. package/dist/sharing/index.cjs.map +1 -1
  74. package/dist/sharing/index.d.mts +16 -3
  75. package/dist/sharing/index.d.ts +16 -3
  76. package/dist/sharing/index.mjs +183 -29
  77. package/dist/sharing/index.mjs.map +1 -1
  78. package/dist/subscription-Cj_qBA7u.d.mts +20 -0
  79. package/dist/subscription-OiJ50uJb.d.ts +20 -0
  80. package/dist/theme/index.mjs +41 -5
  81. package/dist/theme/index.mjs.map +1 -1
  82. package/dist/types/index.cjs +868 -123
  83. package/dist/types/index.cjs.map +1 -1
  84. package/dist/types/index.d.mts +234 -15
  85. package/dist/types/index.d.ts +234 -15
  86. package/dist/types/index.mjs +61 -31
  87. package/dist/utils/index.cjs +292 -117
  88. package/dist/utils/index.cjs.map +1 -1
  89. package/dist/utils/index.d.mts +25 -23
  90. package/dist/utils/index.d.ts +25 -23
  91. package/dist/utils/index.mjs +6 -5
  92. package/dist/vendor-DmMi2qmx.d.mts +73 -0
  93. package/dist/vendor-M9hVZlni.d.ts +73 -0
  94. package/package.json +10 -3
  95. package/dist/ad-BUYzE6zx.d.ts +0 -181
  96. package/dist/ad-BhLoEul3.d.mts +0 -181
  97. package/dist/affiliate-BbtjeUP4.d.mts +0 -73
  98. package/dist/affiliate-C51nzKsw.d.ts +0 -73
  99. package/dist/chunk-32MKHJTX.mjs +0 -1207
  100. package/dist/chunk-32MKHJTX.mjs.map +0 -1
  101. package/dist/chunk-AYO3E4DM.mjs +0 -224
  102. package/dist/chunk-AYO3E4DM.mjs.map +0 -1
  103. package/dist/chunk-BIJ5NDXW.mjs +0 -962
  104. package/dist/chunk-BIJ5NDXW.mjs.map +0 -1
  105. package/dist/chunk-DQ7ZHIXW.mjs +0 -26
  106. package/dist/chunk-DQ7ZHIXW.mjs.map +0 -1
  107. package/dist/chunk-ILILH7E2.mjs +0 -219
  108. package/dist/chunk-ILILH7E2.mjs.map +0 -1
  109. package/dist/chunk-LBEJECG3.mjs.map +0 -1
  110. package/dist/chunk-NPFJ2CN2.mjs +0 -109
  111. package/dist/chunk-NPFJ2CN2.mjs.map +0 -1
  112. package/dist/chunk-R6PCFOYO.mjs +0 -3650
  113. package/dist/chunk-R6PCFOYO.mjs.map +0 -1
  114. package/dist/chunk-SD42WIMV.mjs.map +0 -1
  115. package/dist/chunk-VA5YN2K3.mjs +0 -48
  116. package/dist/chunk-VA5YN2K3.mjs.map +0 -1
  117. package/dist/chunk-VPANTTZI.mjs.map +0 -1
  118. package/dist/chunk-X3OLM35T.mjs +0 -278
  119. package/dist/chunk-X3OLM35T.mjs.map +0 -1
  120. package/dist/contactUs--NoohZBu.d.ts +0 -11
  121. package/dist/contactUs-CBWzefUS.d.mts +0 -11
  122. package/dist/global-CUYYxpy2.d.ts +0 -699
  123. package/dist/global-DePDtOFt.d.mts +0 -699
  124. package/dist/resourceActivities-CMUcn2P7.d.ts +0 -130
  125. package/dist/resourceActivities-CwbJFGIp.d.mts +0 -130
  126. package/dist/subscription-BU8GvH2K.d.ts +0 -12
  127. package/dist/subscription-bmAdrnfi.d.mts +0 -12
  128. package/dist/user-D47MLFyH.d.ts +0 -134
  129. package/dist/user-DE8edl3u.d.mts +0 -134
@@ -1,9 +1,11 @@
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 { D as DailyClueGameData, a as GamePlacementClue, G as GamePlacement } from '../dailyClue-C6WXY73z.mjs';
2
2
  import dayjs from 'dayjs';
3
- import { EnumRegions, EnumUserLicence, EnumReward, EnumInviteStatus, EnumEventDateStatus, EnumResourceType } from '../enums/index.mjs';
4
- import { h as EnumAffiliateRewardType, f as AffiliateRewardType } from '../affiliate-BbtjeUP4.mjs';
3
+ import { O as OptionItem, S as SocialMediaType } from '../global-C6v9tRji.mjs';
4
+ import { g as PostTypeEnum, e as LicencesEnumType, j as RewardEnumType, I as InviteEnumType, R as ResourceImageType, s as EventDateStatusEnumType, D as DateTimeType, L as LocationType, f as ResourceTypeEnum, d as VendorType, W as UnregisteredVendorType, c as EventListItemType, aH as RelationDateTimeType, b as AffiliateRewardEnumType } from '../graphql-CcvzTs9k.mjs';
5
+ import { EnumRegions } from '../enums/index.mjs';
6
+ import { c as AffiliateRewardWriteType } from '../affiliate-Bqqlffw8.mjs';
5
7
  import 'react-hook-form';
6
- import '../user-DE8edl3u.mjs';
8
+ import '../images/index.mjs';
7
9
 
8
10
  /** Seeded shuffle so all players see the same letter order / placements for a game. */
9
11
  declare function seededShuffle<T>(array: readonly T[], seed: string): T[];
@@ -66,25 +68,25 @@ declare const removeTypename: (obj: any) => any;
66
68
  declare const truncateText: (text: string, maxLength?: number) => string;
67
69
  declare const capitalizeFirstLetter: (str: string) => string;
68
70
  declare const statusOptions: {
69
- label: EnumInviteStatus;
70
- value: EnumInviteStatus;
71
+ label: InviteEnumType;
72
+ value: InviteEnumType;
71
73
  }[];
72
74
  declare const availableRegionTypes: EnumRegions[];
73
75
  declare const availableRegionOptions: OptionItem[];
74
76
  declare const paymentMethodOptions: OptionItem[];
75
77
  declare function normalizeUrl(url: string): string;
76
- declare const licenseNiceNames: Record<EnumUserLicence, string>;
78
+ declare const licenseNiceNames: Record<LicencesEnumType, string>;
77
79
  declare const cluemartSocialMedia: SocialMediaType[];
78
80
  declare const IOS_URL = "https://apps.apple.com/nz/app/cluemart/id6747251008";
79
81
  declare const ANDROID_URL = "https://play.google.com/store/apps/details?id=com.timardex.cluemart";
80
82
  declare const DEFAULT_RESOURCES_RETURN_LIMIT = 1000;
81
83
  declare const DEFAULT_RESOURCES_RETURN_OFFSET = 0;
82
84
  declare const CLUEMART_MAIN_DOMAIN_URL = "https://cluemart.co.nz";
83
- declare const rewardNiceNames: Record<EnumReward, {
85
+ declare const rewardNiceNames: Record<RewardEnumType, {
84
86
  name: string;
85
87
  points: number;
86
88
  }>;
87
- declare const PostTypeLabels: Record<EnumPostType, string>;
89
+ declare const PostTypeLabels: Record<PostTypeEnum, string>;
88
90
  /** Hardcoded registration gateway code; only valid at sign-up (not a generated school referral code). */
89
91
  declare const CM_SCHOOL_PROMO_CODE = "CM-SCHOOL";
90
92
  /** Hardcoded registration gateway code; only valid at sign-up (not a generated affiliate referral code). */
@@ -113,23 +115,23 @@ declare function isResourceImageActive(image: ResourceImageLike | null | undefin
113
115
  declare const SCHOOL_MIN_STUDENT_COUNT = 300;
114
116
  declare const SCHOOL_MAX_STUDENT_COUNT = 0;
115
117
 
116
- declare const EVENT_DATE_STATUS_PERIOD_MAP: Partial<Record<EnumEventDateStatus, EnumEventDateStatus[]>>;
117
- declare function getAllowedEventDateStatuses(period: EnumEventDateStatus): EnumEventDateStatus[];
118
- declare function eventMatchesDateStatusPeriod(dateTime: Pick<DateTimeType, "dateStatus">[] | null | undefined, period: EnumEventDateStatus): boolean;
118
+ declare const EVENT_DATE_STATUS_PERIOD_MAP: Partial<Record<EventDateStatusEnumType, EventDateStatusEnumType[]>>;
119
+ declare function getAllowedEventDateStatuses(period: EventDateStatusEnumType): EventDateStatusEnumType[];
120
+ declare function eventMatchesDateStatusPeriod(dateTime: Pick<DateTimeType, "dateStatus">[] | null | undefined, period: EventDateStatusEnumType): boolean;
119
121
  declare function filterEventsByDateStatusPeriod<T extends {
120
122
  dateTime?: Pick<DateTimeType, "dateStatus">[] | null;
121
- }>(events: T[], period: EnumEventDateStatus): T[];
123
+ }>(events: T[], period: EventDateStatusEnumType): T[];
122
124
 
123
125
  type CalendarSheetContentData = {
124
126
  dateTime: DateTimeType;
125
127
  location: LocationType;
126
128
  resourceId: string;
127
- resourceType: EnumResourceType;
129
+ resourceType: ResourceTypeEnum;
128
130
  };
129
- declare const KNOWN_EVENT_SCHEDULE_STATUSES: Set<EnumEventDateStatus>;
131
+ declare const KNOWN_EVENT_SCHEDULE_STATUSES: Set<EventDateStatusEnumType>;
130
132
  type EventScheduleStatusTone = "started" | "startingSoon" | "ended" | "default";
131
133
  type EventScheduleStatusPresentation = {
132
- status: EnumEventDateStatus;
134
+ status: EventDateStatusEnumType;
133
135
  statusLabel: string;
134
136
  tone: EventScheduleStatusTone;
135
137
  };
@@ -137,11 +139,11 @@ declare function toCalendarIsoDate(startDate: string): string | null;
137
139
  declare function fromCalendarIsoDate(isoDate: string): string;
138
140
  declare function getEventCalendarIsoDates(dateTimes: DateTimeType[] | null | undefined): string[];
139
141
  declare function findEventDateTimeByIsoDate(dateTimes: DateTimeType[] | null | undefined, isoDate: string): DateTimeType | null;
140
- declare function buildCalendarSheetContentData(dateTimes: DateTimeType[], isoDate: string, location: LocationType, resourceId: string, resourceType: EnumResourceType): CalendarSheetContentData | null;
141
- declare function getEventScheduleStatusTone(status: EnumEventDateStatus): EventScheduleStatusTone;
142
+ declare function buildCalendarSheetContentData(dateTimes: DateTimeType[], isoDate: string, location: LocationType, resourceId: string, resourceType: ResourceTypeEnum): CalendarSheetContentData | null;
143
+ declare function getEventScheduleStatusTone(status: EventDateStatusEnumType): EventScheduleStatusTone;
142
144
  declare function getEventScheduleStatusPresentation(dateTime: DateTimeType): EventScheduleStatusPresentation;
143
145
  declare function getEventScheduleStatusLabel(dateTime: DateTimeType, onlyShowKnownStatuses: boolean): string | null;
144
- declare function shouldShowEventActionsWithWeather(resourceType: EnumResourceType, dateTime: DateTimeType, location: LocationType | null | undefined): boolean;
146
+ declare function shouldShowEventActionsWithWeather(resourceType: ResourceTypeEnum, dateTime: DateTimeType, location: LocationType | null | undefined): boolean;
145
147
 
146
148
  type StallholderFilterOption = {
147
149
  label: string;
@@ -165,11 +167,11 @@ declare function getStallholderCategoryNames(registeredVendors: VendorType[], un
165
167
  declare function getStallholderCategoryOptions(registeredVendors: VendorType[], unregisteredVendors?: UnregisteredVendorType[]): StallholderFilterOption[];
166
168
  declare function getEventStallholderEmptyMessage(hasAnyStallholdersForEvent: boolean, selectedDate: string | null): string;
167
169
 
168
- type RelationType = NonNullable<EventListItemType["relations"]>[number];
170
+ type RelationType = NonNullable<NonNullable<EventListItemType["relations"]>[number]>;
169
171
  declare function relationHasSelectedDate(relation: RelationType, selectedDate: string): boolean;
170
172
  declare function eventHasSelectedDate(event: EventListItemType, selectedDate: string): boolean;
171
173
  declare function filterVendorEventsBySelectedDate(events: EventListItemType[] | null | undefined, selectedDate: string | null): EventListItemType[];
172
- declare function collectVendorEventRelationDateTimes(events: EventListItemType[] | null | undefined): DateTimeType[];
174
+ declare function collectVendorEventRelationDateTimes(events: EventListItemType[] | null | undefined): RelationDateTimeType[];
173
175
  declare function getVendorEventRelationStartDates(events: EventListItemType[] | null | undefined): string[];
174
176
  declare function getVendorEventRelationDateOptions(events: EventListItemType[] | null | undefined): StallholderFilterOption[];
175
177
  declare function getVendorEventsEmptyMessage(): string;
@@ -211,10 +213,10 @@ declare const AFFILIATE_REWARDS: {
211
213
  * @param createdAt - The date the reward was received
212
214
  * @returns The affiliate reward
213
215
  * @example
214
- * const reward = createAffiliateReward(EnumAffiliateRewardType.NEW_EVENT_REGISTRATION, new Date());
216
+ * const reward = createAffiliateReward(AffiliateRewardEnumType.NewEventRegistration, new Date());
215
217
  * console.log(reward);
216
218
  */
217
- declare function createAffiliateReward(rewardType: EnumAffiliateRewardType, createdAt: Date): AffiliateRewardType;
219
+ declare function createAffiliateReward(rewardType: AffiliateRewardEnumType, createdAt: Date): AffiliateRewardWriteType;
218
220
 
219
221
  /**
220
222
  * NZ IRD number validation (Inland Revenue modulus-11 check digit).
@@ -1,9 +1,11 @@
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 { D as DailyClueGameData, a as GamePlacementClue, G as GamePlacement } from '../dailyClue-C6WXY73z.js';
2
2
  import dayjs from 'dayjs';
3
- import { EnumRegions, EnumUserLicence, EnumReward, EnumInviteStatus, EnumEventDateStatus, EnumResourceType } from '../enums/index.js';
4
- import { h as EnumAffiliateRewardType, f as AffiliateRewardType } from '../affiliate-C51nzKsw.js';
3
+ import { O as OptionItem, S as SocialMediaType } from '../global-BbSFfYdd.js';
4
+ import { g as PostTypeEnum, e as LicencesEnumType, j as RewardEnumType, I as InviteEnumType, R as ResourceImageType, s as EventDateStatusEnumType, D as DateTimeType, L as LocationType, f as ResourceTypeEnum, d as VendorType, W as UnregisteredVendorType, c as EventListItemType, aH as RelationDateTimeType, b as AffiliateRewardEnumType } from '../graphql-CDOfA79A.js';
5
+ import { EnumRegions } from '../enums/index.js';
6
+ import { c as AffiliateRewardWriteType } from '../affiliate-Btlp5XUp.js';
5
7
  import 'react-hook-form';
6
- import '../user-D47MLFyH.js';
8
+ import '../images/index.js';
7
9
 
8
10
  /** Seeded shuffle so all players see the same letter order / placements for a game. */
9
11
  declare function seededShuffle<T>(array: readonly T[], seed: string): T[];
@@ -66,25 +68,25 @@ declare const removeTypename: (obj: any) => any;
66
68
  declare const truncateText: (text: string, maxLength?: number) => string;
67
69
  declare const capitalizeFirstLetter: (str: string) => string;
68
70
  declare const statusOptions: {
69
- label: EnumInviteStatus;
70
- value: EnumInviteStatus;
71
+ label: InviteEnumType;
72
+ value: InviteEnumType;
71
73
  }[];
72
74
  declare const availableRegionTypes: EnumRegions[];
73
75
  declare const availableRegionOptions: OptionItem[];
74
76
  declare const paymentMethodOptions: OptionItem[];
75
77
  declare function normalizeUrl(url: string): string;
76
- declare const licenseNiceNames: Record<EnumUserLicence, string>;
78
+ declare const licenseNiceNames: Record<LicencesEnumType, string>;
77
79
  declare const cluemartSocialMedia: SocialMediaType[];
78
80
  declare const IOS_URL = "https://apps.apple.com/nz/app/cluemart/id6747251008";
79
81
  declare const ANDROID_URL = "https://play.google.com/store/apps/details?id=com.timardex.cluemart";
80
82
  declare const DEFAULT_RESOURCES_RETURN_LIMIT = 1000;
81
83
  declare const DEFAULT_RESOURCES_RETURN_OFFSET = 0;
82
84
  declare const CLUEMART_MAIN_DOMAIN_URL = "https://cluemart.co.nz";
83
- declare const rewardNiceNames: Record<EnumReward, {
85
+ declare const rewardNiceNames: Record<RewardEnumType, {
84
86
  name: string;
85
87
  points: number;
86
88
  }>;
87
- declare const PostTypeLabels: Record<EnumPostType, string>;
89
+ declare const PostTypeLabels: Record<PostTypeEnum, string>;
88
90
  /** Hardcoded registration gateway code; only valid at sign-up (not a generated school referral code). */
89
91
  declare const CM_SCHOOL_PROMO_CODE = "CM-SCHOOL";
90
92
  /** Hardcoded registration gateway code; only valid at sign-up (not a generated affiliate referral code). */
@@ -113,23 +115,23 @@ declare function isResourceImageActive(image: ResourceImageLike | null | undefin
113
115
  declare const SCHOOL_MIN_STUDENT_COUNT = 300;
114
116
  declare const SCHOOL_MAX_STUDENT_COUNT = 0;
115
117
 
116
- declare const EVENT_DATE_STATUS_PERIOD_MAP: Partial<Record<EnumEventDateStatus, EnumEventDateStatus[]>>;
117
- declare function getAllowedEventDateStatuses(period: EnumEventDateStatus): EnumEventDateStatus[];
118
- declare function eventMatchesDateStatusPeriod(dateTime: Pick<DateTimeType, "dateStatus">[] | null | undefined, period: EnumEventDateStatus): boolean;
118
+ declare const EVENT_DATE_STATUS_PERIOD_MAP: Partial<Record<EventDateStatusEnumType, EventDateStatusEnumType[]>>;
119
+ declare function getAllowedEventDateStatuses(period: EventDateStatusEnumType): EventDateStatusEnumType[];
120
+ declare function eventMatchesDateStatusPeriod(dateTime: Pick<DateTimeType, "dateStatus">[] | null | undefined, period: EventDateStatusEnumType): boolean;
119
121
  declare function filterEventsByDateStatusPeriod<T extends {
120
122
  dateTime?: Pick<DateTimeType, "dateStatus">[] | null;
121
- }>(events: T[], period: EnumEventDateStatus): T[];
123
+ }>(events: T[], period: EventDateStatusEnumType): T[];
122
124
 
123
125
  type CalendarSheetContentData = {
124
126
  dateTime: DateTimeType;
125
127
  location: LocationType;
126
128
  resourceId: string;
127
- resourceType: EnumResourceType;
129
+ resourceType: ResourceTypeEnum;
128
130
  };
129
- declare const KNOWN_EVENT_SCHEDULE_STATUSES: Set<EnumEventDateStatus>;
131
+ declare const KNOWN_EVENT_SCHEDULE_STATUSES: Set<EventDateStatusEnumType>;
130
132
  type EventScheduleStatusTone = "started" | "startingSoon" | "ended" | "default";
131
133
  type EventScheduleStatusPresentation = {
132
- status: EnumEventDateStatus;
134
+ status: EventDateStatusEnumType;
133
135
  statusLabel: string;
134
136
  tone: EventScheduleStatusTone;
135
137
  };
@@ -137,11 +139,11 @@ declare function toCalendarIsoDate(startDate: string): string | null;
137
139
  declare function fromCalendarIsoDate(isoDate: string): string;
138
140
  declare function getEventCalendarIsoDates(dateTimes: DateTimeType[] | null | undefined): string[];
139
141
  declare function findEventDateTimeByIsoDate(dateTimes: DateTimeType[] | null | undefined, isoDate: string): DateTimeType | null;
140
- declare function buildCalendarSheetContentData(dateTimes: DateTimeType[], isoDate: string, location: LocationType, resourceId: string, resourceType: EnumResourceType): CalendarSheetContentData | null;
141
- declare function getEventScheduleStatusTone(status: EnumEventDateStatus): EventScheduleStatusTone;
142
+ declare function buildCalendarSheetContentData(dateTimes: DateTimeType[], isoDate: string, location: LocationType, resourceId: string, resourceType: ResourceTypeEnum): CalendarSheetContentData | null;
143
+ declare function getEventScheduleStatusTone(status: EventDateStatusEnumType): EventScheduleStatusTone;
142
144
  declare function getEventScheduleStatusPresentation(dateTime: DateTimeType): EventScheduleStatusPresentation;
143
145
  declare function getEventScheduleStatusLabel(dateTime: DateTimeType, onlyShowKnownStatuses: boolean): string | null;
144
- declare function shouldShowEventActionsWithWeather(resourceType: EnumResourceType, dateTime: DateTimeType, location: LocationType | null | undefined): boolean;
146
+ declare function shouldShowEventActionsWithWeather(resourceType: ResourceTypeEnum, dateTime: DateTimeType, location: LocationType | null | undefined): boolean;
145
147
 
146
148
  type StallholderFilterOption = {
147
149
  label: string;
@@ -165,11 +167,11 @@ declare function getStallholderCategoryNames(registeredVendors: VendorType[], un
165
167
  declare function getStallholderCategoryOptions(registeredVendors: VendorType[], unregisteredVendors?: UnregisteredVendorType[]): StallholderFilterOption[];
166
168
  declare function getEventStallholderEmptyMessage(hasAnyStallholdersForEvent: boolean, selectedDate: string | null): string;
167
169
 
168
- type RelationType = NonNullable<EventListItemType["relations"]>[number];
170
+ type RelationType = NonNullable<NonNullable<EventListItemType["relations"]>[number]>;
169
171
  declare function relationHasSelectedDate(relation: RelationType, selectedDate: string): boolean;
170
172
  declare function eventHasSelectedDate(event: EventListItemType, selectedDate: string): boolean;
171
173
  declare function filterVendorEventsBySelectedDate(events: EventListItemType[] | null | undefined, selectedDate: string | null): EventListItemType[];
172
- declare function collectVendorEventRelationDateTimes(events: EventListItemType[] | null | undefined): DateTimeType[];
174
+ declare function collectVendorEventRelationDateTimes(events: EventListItemType[] | null | undefined): RelationDateTimeType[];
173
175
  declare function getVendorEventRelationStartDates(events: EventListItemType[] | null | undefined): string[];
174
176
  declare function getVendorEventRelationDateOptions(events: EventListItemType[] | null | undefined): StallholderFilterOption[];
175
177
  declare function getVendorEventsEmptyMessage(): string;
@@ -211,10 +213,10 @@ declare const AFFILIATE_REWARDS: {
211
213
  * @param createdAt - The date the reward was received
212
214
  * @returns The affiliate reward
213
215
  * @example
214
- * const reward = createAffiliateReward(EnumAffiliateRewardType.NEW_EVENT_REGISTRATION, new Date());
216
+ * const reward = createAffiliateReward(AffiliateRewardEnumType.NewEventRegistration, new Date());
215
217
  * console.log(reward);
216
218
  */
217
- declare function createAffiliateReward(rewardType: EnumAffiliateRewardType, createdAt: Date): AffiliateRewardType;
219
+ declare function createAffiliateReward(rewardType: AffiliateRewardEnumType, createdAt: Date): AffiliateRewardWriteType;
218
220
 
219
221
  /**
220
222
  * NZ IRD number validation (Inland Revenue modulus-11 check digit).
@@ -75,7 +75,7 @@ import {
75
75
  toCalendarIsoDate,
76
76
  toUserFacingErrorMessage,
77
77
  truncateText
78
- } from "../chunk-LBEJECG3.mjs";
78
+ } from "../chunk-OHHJ3KJJ.mjs";
79
79
  import {
80
80
  dateFormat,
81
81
  formatDate,
@@ -89,13 +89,14 @@ import {
89
89
  sortDatesChronologically,
90
90
  timeFormat,
91
91
  toNZTime
92
- } from "../chunk-SD42WIMV.mjs";
93
- import "../chunk-ILILH7E2.mjs";
92
+ } from "../chunk-NWWKI4PJ.mjs";
93
+ import "../chunk-DDHECBJR.mjs";
94
94
  import {
95
95
  isTransientNetworkError
96
96
  } from "../chunk-RAYUJODN.mjs";
97
- import "../chunk-DQ7ZHIXW.mjs";
98
- import "../chunk-X3OLM35T.mjs";
97
+ import "../chunk-DATBGC2K.mjs";
98
+ import "../chunk-TOEFAEF2.mjs";
99
+ import "../chunk-INQCDU24.mjs";
99
100
  export {
100
101
  AFFILIATE_PARTICIPANT_TYPE_LABELS,
101
102
  AFFILIATE_REWARDS,
@@ -0,0 +1,73 @@
1
+ import { D as DateTimeType, V as VendorProductListType, a as VendorEnumType, R as ResourceImageType, F as FoodFlavorEnumType } from './graphql-CcvzTs9k.mjs';
2
+ import { B as BaseResourceTypeFormData, R as ResourceDetails, C as Category, a as CreateFormData } from './global-C6v9tRji.mjs';
3
+
4
+ type VendorCalendarData = Omit<ResourceDetails, "dateTime" | "eventStatus"> & {
5
+ dateTime: DateTimeType;
6
+ };
7
+ interface VendorFormData extends BaseResourceTypeFormData {
8
+ availability?: {
9
+ school: boolean;
10
+ private: boolean;
11
+ corporate: boolean;
12
+ };
13
+ claimed?: boolean;
14
+ calendar?: {
15
+ active?: boolean | null;
16
+ calendarData?: VendorCalendarData[] | null;
17
+ } | null;
18
+ categories: Category[];
19
+ foodTruck: boolean;
20
+ products?: {
21
+ active?: boolean | null;
22
+ productsList?: VendorProductListType[] | null;
23
+ } | null;
24
+ unregisteredVendorId?: string | null;
25
+ vendorType: VendorEnumType;
26
+ }
27
+ type CreateVendorFormData = CreateFormData<VendorFormData>;
28
+ type VendorAttributes = {
29
+ details?: string | null;
30
+ isRequired: boolean;
31
+ };
32
+ type VendorInfoFormData = {
33
+ _id?: string;
34
+ compliance?: {
35
+ liabilityInsurance: boolean;
36
+ foodBeverageLicense: boolean;
37
+ };
38
+ documents?: ResourceImageType[] | null;
39
+ documentsUpload?: ResourceImageType[] | null;
40
+ product: {
41
+ foodFlavors: FoodFlavorEnumType[];
42
+ packaging: string[];
43
+ priceRange: {
44
+ max: string;
45
+ min: string;
46
+ };
47
+ producedIn: string[];
48
+ };
49
+ requirements?: {
50
+ electricity: VendorAttributes;
51
+ gazebo: VendorAttributes;
52
+ table: VendorAttributes;
53
+ };
54
+ stallInfo: {
55
+ size: {
56
+ depth: string;
57
+ width: string;
58
+ };
59
+ };
60
+ vendorId: string;
61
+ };
62
+ type CreateVendorInfoFormData = CreateFormData<VendorInfoFormData>;
63
+ interface UnregisteredVendorFormData {
64
+ categoryIds: string[];
65
+ dateTime: DateTimeType[];
66
+ email?: string | null;
67
+ inviterId: string;
68
+ name: string;
69
+ region: string;
70
+ }
71
+ type CreateUnregisteredVendorFormData = CreateFormData<UnregisteredVendorFormData>;
72
+
73
+ export type { CreateUnregisteredVendorFormData as C, UnregisteredVendorFormData as U, VendorCalendarData as V, VendorInfoFormData as a, VendorFormData as b, CreateVendorFormData as c, CreateVendorInfoFormData as d, VendorAttributes as e };
@@ -0,0 +1,73 @@
1
+ import { D as DateTimeType, V as VendorProductListType, a as VendorEnumType, R as ResourceImageType, F as FoodFlavorEnumType } from './graphql-CDOfA79A.js';
2
+ import { B as BaseResourceTypeFormData, R as ResourceDetails, C as Category, a as CreateFormData } from './global-BbSFfYdd.js';
3
+
4
+ type VendorCalendarData = Omit<ResourceDetails, "dateTime" | "eventStatus"> & {
5
+ dateTime: DateTimeType;
6
+ };
7
+ interface VendorFormData extends BaseResourceTypeFormData {
8
+ availability?: {
9
+ school: boolean;
10
+ private: boolean;
11
+ corporate: boolean;
12
+ };
13
+ claimed?: boolean;
14
+ calendar?: {
15
+ active?: boolean | null;
16
+ calendarData?: VendorCalendarData[] | null;
17
+ } | null;
18
+ categories: Category[];
19
+ foodTruck: boolean;
20
+ products?: {
21
+ active?: boolean | null;
22
+ productsList?: VendorProductListType[] | null;
23
+ } | null;
24
+ unregisteredVendorId?: string | null;
25
+ vendorType: VendorEnumType;
26
+ }
27
+ type CreateVendorFormData = CreateFormData<VendorFormData>;
28
+ type VendorAttributes = {
29
+ details?: string | null;
30
+ isRequired: boolean;
31
+ };
32
+ type VendorInfoFormData = {
33
+ _id?: string;
34
+ compliance?: {
35
+ liabilityInsurance: boolean;
36
+ foodBeverageLicense: boolean;
37
+ };
38
+ documents?: ResourceImageType[] | null;
39
+ documentsUpload?: ResourceImageType[] | null;
40
+ product: {
41
+ foodFlavors: FoodFlavorEnumType[];
42
+ packaging: string[];
43
+ priceRange: {
44
+ max: string;
45
+ min: string;
46
+ };
47
+ producedIn: string[];
48
+ };
49
+ requirements?: {
50
+ electricity: VendorAttributes;
51
+ gazebo: VendorAttributes;
52
+ table: VendorAttributes;
53
+ };
54
+ stallInfo: {
55
+ size: {
56
+ depth: string;
57
+ width: string;
58
+ };
59
+ };
60
+ vendorId: string;
61
+ };
62
+ type CreateVendorInfoFormData = CreateFormData<VendorInfoFormData>;
63
+ interface UnregisteredVendorFormData {
64
+ categoryIds: string[];
65
+ dateTime: DateTimeType[];
66
+ email?: string | null;
67
+ inviterId: string;
68
+ name: string;
69
+ region: string;
70
+ }
71
+ type CreateUnregisteredVendorFormData = CreateFormData<UnregisteredVendorFormData>;
72
+
73
+ export type { CreateUnregisteredVendorFormData as C, UnregisteredVendorFormData as U, VendorCalendarData as V, VendorInfoFormData as a, VendorFormData as b, CreateVendorFormData as c, CreateVendorInfoFormData as d, VendorAttributes as e };
package/package.json CHANGED
@@ -1,15 +1,18 @@
1
1
  {
2
2
  "name": "@timardex/cluemart-shared",
3
- "version": "1.6.112",
3
+ "version": "1.6.130",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
9
- "build": "rimraf dist && tsup && node scripts/copy-images.mjs && npm pack",
9
+ "build": "npm run codegen && rimraf dist && tsup && node scripts/copy-images.mjs && npm pack",
10
10
  "lint": "eslint --ext .ts,.tsx,.mjs,.cjs src scripts",
11
11
  "lint:fix": "eslint --ext .ts,.tsx,.mjs,.cjs --fix src scripts",
12
- "typecheck": "tsc --noEmit",
12
+ "typecheck": "npm run codegen && tsc --noEmit",
13
+ "codegen": "node scripts/pre-codegen.mjs && graphql-codegen --config codegen.ts",
14
+ "codegen:check": "graphql-codegen --config codegen.ts",
15
+ "schema:check": "node scripts/check-schema-sync.mjs",
13
16
  "test": "vitest run",
14
17
  "test:coverage": "vitest run --coverage",
15
18
  "test:watch": "vitest",
@@ -116,6 +119,10 @@
116
119
  },
117
120
  "devDependencies": {
118
121
  "@apollo/client": "^3.14.1",
122
+ "@graphql-codegen/cli": "^7.2.0",
123
+ "@graphql-codegen/typescript": "^6.1.0",
124
+ "@graphql-codegen/typescript-operations": "^6.1.5",
125
+ "@graphql-codegen/typescript-react-apollo": "^4.4.2",
119
126
  "@types/node": "^22.13.4",
120
127
  "@types/react": "~19.2.10",
121
128
  "@typescript-eslint/eslint-plugin": "^8.20.0",
@@ -1,181 +0,0 @@
1
- import { EnumPartnerType, EnumResourceType, EnumOSPlatform } from './enums/index.js';
2
- import { D as BaseResourceType, L as LocationType, ax as SocialShareResourceType, B as BaseResourceTypeFormData, H as CreateFormData, at as ResourceContactDetailsType, av as ResourceImageType, aw as SocialMediaType, aA as TermsAgreement, a7 as OwnerType, ak as PromoCodeType, M as MutationResponse } from './global-CUYYxpy2.js';
3
- import { PosterAssetId } from './images/index.js';
4
- import { S as SafeUserType } from './user-D47MLFyH.js';
5
-
6
- interface PartnerFormData extends BaseResourceTypeFormData {
7
- location: LocationType;
8
- nzbn: string;
9
- partnerType: EnumPartnerType;
10
- }
11
- type CreatePartnerFormData = CreateFormData<PartnerFormData>;
12
- interface PartnerType extends BaseResourceType {
13
- location: LocationType;
14
- nzbn: string;
15
- partnerType: EnumPartnerType;
16
- sharePublic?: SocialShareResourceType | null;
17
- }
18
-
19
- interface AppSettingsFormData {
20
- appVersion: string;
21
- isOfflineMode: boolean;
22
- minimumRedeemableAffiliatePoints: number;
23
- }
24
- type CreateAppSettingsFormData = CreateFormData<AppSettingsFormData>;
25
- type AppSettingsType = AppSettingsFormData & {
26
- _id: string;
27
- activeSchoolsStudentCountTotal: number;
28
- activeSchoolsStudentCountUpdatedAt: Date;
29
- createdAt: Date;
30
- key: string;
31
- updatedAt: Date | null;
32
- };
33
-
34
- interface PosterInputType {
35
- description: string;
36
- posterName: PosterAssetId;
37
- resourceId: string;
38
- resourceType: EnumResourceType;
39
- }
40
-
41
- interface SchoolFormData {
42
- _id?: string;
43
- active: boolean;
44
- contactDetails: ResourceContactDetailsType | null;
45
- location: LocationType;
46
- logo?: ResourceImageType | null;
47
- logoUpload?: ResourceImageType | null;
48
- name: string;
49
- region: string;
50
- studentCount: number;
51
- socialMedia: SocialMediaType[] | null;
52
- termsAgreement?: TermsAgreement | null;
53
- }
54
- type CreateSchoolFormData = CreateFormData<SchoolFormData>;
55
- type SchoolCampaignType = {
56
- endDate: Date;
57
- name: string;
58
- startDate: Date;
59
- };
60
- type SchoolType = Omit<SchoolFormData, "logoUpload"> & {
61
- _id: string;
62
- approvedAt?: Date | null;
63
- campaigns: SchoolCampaignType[];
64
- createdAt: Date;
65
- deletedAt: Date | null;
66
- overallPoints: number | null;
67
- owner: OwnerType;
68
- ranking: number | null;
69
- schoolCode: PromoCodeType;
70
- updatedAt: Date | null;
71
- };
72
- type SchoolRegisteredUserType = Pick<SafeUserType, "_id" | "firstName" | "lastName" | "avatar" | "email" | "active">;
73
- type SchoolReturnType = {
74
- school: SchoolType;
75
- users: SchoolRegisteredUserType[];
76
- };
77
- type MarketingMaterialRequestInputType = Pick<PosterInputType, "resourceId" | "posterName">;
78
-
79
- declare enum EnumVerificationType {
80
- REGISTER = "register",
81
- RESET_PASSWORD = "resetPassword"
82
- }
83
- type LoginFormData = {
84
- email: string;
85
- isAdminPage?: boolean;
86
- password: string;
87
- platform?: EnumOSPlatform;
88
- };
89
- type CreateLoginFormData = CreateFormData<LoginFormData>;
90
- type RegisterFormData = {
91
- email: string;
92
- firstName: string;
93
- lastName: string;
94
- password: string;
95
- platform?: EnumOSPlatform;
96
- preferredRegion: string;
97
- promoCode?: PromoCodeType | null;
98
- termsAgreement?: TermsAgreement | null;
99
- };
100
- type CreateRegisterFormData = CreateFormData<RegisterFormData>;
101
- type RequestPasswordResetFormData = {
102
- email: string;
103
- };
104
- type CreateRequestPasswordResetFormData = CreateFormData<RequestPasswordResetFormData>;
105
- type ResetPasswordFormData = {
106
- confirmPassword: string;
107
- email: string;
108
- password: string;
109
- };
110
- type CreateResetPasswordFormData = CreateFormData<ResetPasswordFormData>;
111
- type ValidateVerificationTokenFormData = {
112
- email: string;
113
- verificationToken: string;
114
- verificationType?: EnumVerificationType;
115
- };
116
- type CreateValidateVerificationTokenFormData = CreateFormData<ValidateVerificationTokenFormData>;
117
- type AuthPayloadType = {
118
- refreshToken: string | null;
119
- token: string;
120
- user: SafeUserType;
121
- };
122
- type AuthMutationResponse = MutationResponse<AuthPayloadType>;
123
- type RefreshTokenPayloadType = {
124
- refreshToken: string;
125
- token: string;
126
- };
127
- type RefreshTokenMutationResponse = MutationResponse<RefreshTokenPayloadType>;
128
-
129
- declare enum EnumAdShowOn {
130
- EVENTS_PAGE = "Events_page",
131
- FRONT_PAGE = "Front_page",
132
- PARTNERS_PAGE = "Partners_page",
133
- VENDORS_PAGE = "Vendors_page"
134
- }
135
- declare enum EnumAdStatus {
136
- ACTIVE = "Active",
137
- PAUSED = "Paused",
138
- EXPIRED = "Expired"
139
- }
140
- declare enum EnumAdType {
141
- SPONSORED = "Sponsored",
142
- FREE = "Free"
143
- }
144
- declare enum EnumAdStyle {
145
- BLOOM = "Bloom",
146
- RISE = "Rise"
147
- }
148
- type AdResource = {
149
- adDescription: string;
150
- adImage: string;
151
- adStyle: EnumAdStyle;
152
- adTitle: string;
153
- adType: EnumAdType;
154
- resourceId: string;
155
- resourceName: string;
156
- resourceRegion: string;
157
- resourceType: EnumResourceType;
158
- resourceSlug: string;
159
- };
160
- interface AdFormData {
161
- active: boolean;
162
- end: Date;
163
- resource: AdResource;
164
- showOn: EnumAdShowOn[];
165
- start?: Date;
166
- status: EnumAdStatus;
167
- targetRegion: string[];
168
- }
169
- type AdFormState = AdFormData;
170
- type CreateAdFormData = CreateFormData<AdFormData>;
171
- type CreateAdFormState = CreateFormData<AdFormState>;
172
- interface AdType extends AdFormData {
173
- _id: string;
174
- clicks?: number;
175
- createdAt: Date;
176
- impressions?: number;
177
- start: Date;
178
- updatedAt: Date | null;
179
- }
180
-
181
- export { type AuthMutationResponse as A, type RequestPasswordResetFormData as B, type CreateLoginFormData as C, type ResetPasswordFormData as D, EnumAdStatus as E, type SchoolCampaignType as F, type SchoolRegisteredUserType as G, type LoginFormData as L, type MarketingMaterialRequestInputType as M, type PartnerType as P, type RefreshTokenMutationResponse as R, type SchoolType as S, type ValidateVerificationTokenFormData as V, type AdType as a, type AppSettingsType as b, type SchoolReturnType as c, type CreateRegisterFormData as d, type CreateRequestPasswordResetFormData as e, type CreateValidateVerificationTokenFormData as f, type CreateResetPasswordFormData as g, type PartnerFormData as h, type AdFormData as i, type CreateAdFormState as j, type CreatePartnerFormData as k, type AppSettingsFormData as l, type CreateAppSettingsFormData as m, type SchoolFormData as n, type CreateSchoolFormData as o, type AdFormState as p, type AdResource as q, type AuthPayloadType as r, type CreateAdFormData as s, EnumAdShowOn as t, EnumAdStyle as u, EnumAdType as v, EnumVerificationType as w, type PosterInputType as x, type RefreshTokenPayloadType as y, type RegisterFormData as z };