@timardex/cluemart-shared 1.5.832 → 1.5.833
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-Cu-M8Xzf.d.mts → ad-BPb9_tSM.d.mts} +2 -69
- package/dist/{ad-DfqgAPOk.d.ts → ad-_mwYq2Z9.d.ts} +2 -69
- package/dist/affiliate-Dn50VDpB.d.ts +72 -0
- package/dist/affiliate-XW8pxlOC.d.mts +72 -0
- package/dist/{chunk-YKJUZUAP.mjs → chunk-MLNJAQVM.mjs} +39 -1
- package/dist/{chunk-YKJUZUAP.mjs.map → chunk-MLNJAQVM.mjs.map} +1 -1
- package/dist/{chunk-G3CMTXQV.mjs → chunk-SP36N6U6.mjs} +64 -2
- package/dist/{chunk-G3CMTXQV.mjs.map → chunk-SP36N6U6.mjs.map} +1 -1
- package/dist/formFields/index.cjs +26 -0
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.mjs +1 -1
- package/dist/graphql/index.cjs +64 -0
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +13 -2
- package/dist/graphql/index.d.ts +13 -2
- package/dist/graphql/index.mjs +5 -1
- package/dist/hooks/index.cjs +58 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +2 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/index.cjs +104 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +47 -1
- package/dist/index.d.ts +47 -1
- package/dist/index.mjs +100 -0
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.mts +2 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/utils/index.cjs +40 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +39 -1
- package/dist/utils/index.d.ts +39 -1
- package/dist/utils/index.mjs +5 -1
- package/package.json +1 -1
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { I as DailyClueGameData, _ as GamePlacementClue, Z as GamePlacement, O as OptionItem, j as EnumPostType, av as SocialMediaType, au as ResourceImageType, J as DateTimeType, L as LocationType, V as VendorType, g as UnregisteredVendorType, c as EventListItemType } from '../global-BHwZPjT8.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-XW8pxlOC.mjs';
|
|
4
5
|
import 'react-hook-form';
|
|
6
|
+
import '../user-Bhkd3l06.mjs';
|
|
5
7
|
|
|
6
8
|
/** Seeded shuffle so all players see the same letter order / placements for a game. */
|
|
7
9
|
declare function seededShuffle<T>(array: readonly T[], seed: string): T[];
|
|
@@ -177,6 +179,42 @@ declare const AFFILIATE_PARTICIPANT_TYPE_LABELS: {
|
|
|
177
179
|
readonly SOLE_TRADER: "Sole Trader";
|
|
178
180
|
readonly COMPANY: "Company";
|
|
179
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;
|
|
180
218
|
|
|
181
219
|
/**
|
|
182
220
|
* NZ IRD number validation (Inland Revenue modulus-11 check digit).
|
|
@@ -211,4 +249,4 @@ declare function toUserFacingErrorMessage(error: string | null | undefined, fall
|
|
|
211
249
|
/** Extracts and sanitizes an unknown catch/Apollo error for toasts and alerts. */
|
|
212
250
|
declare function getErrorMessage(error: unknown, fallback?: string): string;
|
|
213
251
|
|
|
214
|
-
export { AFFILIATE_PARTICIPANT_TYPE_LABELS, 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, 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 };
|
|
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 };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { I as DailyClueGameData, _ as GamePlacementClue, Z as GamePlacement, O as OptionItem, j as EnumPostType, av as SocialMediaType, au as ResourceImageType, J as DateTimeType, L as LocationType, V as VendorType, g as UnregisteredVendorType, c as EventListItemType } from '../global--iSLy2cE.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-Dn50VDpB.js';
|
|
4
5
|
import 'react-hook-form';
|
|
6
|
+
import '../user-C_kCo0Fm.js';
|
|
5
7
|
|
|
6
8
|
/** Seeded shuffle so all players see the same letter order / placements for a game. */
|
|
7
9
|
declare function seededShuffle<T>(array: readonly T[], seed: string): T[];
|
|
@@ -177,6 +179,42 @@ declare const AFFILIATE_PARTICIPANT_TYPE_LABELS: {
|
|
|
177
179
|
readonly SOLE_TRADER: "Sole Trader";
|
|
178
180
|
readonly COMPANY: "Company";
|
|
179
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;
|
|
180
218
|
|
|
181
219
|
/**
|
|
182
220
|
* NZ IRD number validation (Inland Revenue modulus-11 check digit).
|
|
@@ -211,4 +249,4 @@ declare function toUserFacingErrorMessage(error: string | null | undefined, fall
|
|
|
211
249
|
/** Extracts and sanitizes an unknown catch/Apollo error for toasts and alerts. */
|
|
212
250
|
declare function getErrorMessage(error: unknown, fallback?: string): string;
|
|
213
251
|
|
|
214
|
-
export { AFFILIATE_PARTICIPANT_TYPE_LABELS, 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, 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 };
|
|
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 };
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AFFILIATE_PARTICIPANT_TYPE_LABELS,
|
|
3
|
+
AFFILIATE_REWARDS,
|
|
3
4
|
ANDROID_URL,
|
|
4
5
|
CLUEMART_MAIN_DOMAIN_URL,
|
|
5
6
|
CM_AFFILIATE_PROMO_CODE,
|
|
@@ -22,6 +23,7 @@ import {
|
|
|
22
23
|
collectStallholderStartDates,
|
|
23
24
|
collectVendorEventRelationDateTimes,
|
|
24
25
|
computeDailyClueState,
|
|
26
|
+
createAffiliateReward,
|
|
25
27
|
eventHasSelectedDate,
|
|
26
28
|
eventMatchesDateStatusPeriod,
|
|
27
29
|
eventStartDatesSet,
|
|
@@ -73,7 +75,7 @@ import {
|
|
|
73
75
|
toCalendarIsoDate,
|
|
74
76
|
toUserFacingErrorMessage,
|
|
75
77
|
truncateText
|
|
76
|
-
} from "../chunk-
|
|
78
|
+
} from "../chunk-MLNJAQVM.mjs";
|
|
77
79
|
import {
|
|
78
80
|
dateFormat,
|
|
79
81
|
formatDate,
|
|
@@ -96,6 +98,7 @@ import "../chunk-DQ7ZHIXW.mjs";
|
|
|
96
98
|
import "../chunk-X3OLM35T.mjs";
|
|
97
99
|
export {
|
|
98
100
|
AFFILIATE_PARTICIPANT_TYPE_LABELS,
|
|
101
|
+
AFFILIATE_REWARDS,
|
|
99
102
|
ANDROID_URL,
|
|
100
103
|
CLUEMART_MAIN_DOMAIN_URL,
|
|
101
104
|
CM_AFFILIATE_PROMO_CODE,
|
|
@@ -118,6 +121,7 @@ export {
|
|
|
118
121
|
collectStallholderStartDates,
|
|
119
122
|
collectVendorEventRelationDateTimes,
|
|
120
123
|
computeDailyClueState,
|
|
124
|
+
createAffiliateReward,
|
|
121
125
|
dateFormat,
|
|
122
126
|
eventHasSelectedDate,
|
|
123
127
|
eventMatchesDateStatusPeriod,
|