@timardex/cluemart-shared 1.5.509 → 1.5.511
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/{chunk-RQDZX76B.mjs → chunk-2GSMGPKT.mjs} +19 -8
- package/dist/{chunk-RQDZX76B.mjs.map → chunk-2GSMGPKT.mjs.map} +1 -1
- package/dist/{chunk-UOPC7KMU.mjs → chunk-FTEZFZZW.mjs} +10 -19
- package/dist/chunk-FTEZFZZW.mjs.map +1 -0
- package/dist/{chunk-7GWVTPXL.mjs → chunk-LJJCZVW4.mjs} +3 -2
- package/dist/{chunk-7GWVTPXL.mjs.map → chunk-LJJCZVW4.mjs.map} +1 -1
- package/dist/{chunk-EFNSI75F.mjs → chunk-OMXMDHJ3.mjs} +2 -2
- package/dist/formFields/index.mjs +3 -3
- package/dist/{game-CoVv7iyf.d.mts → game-65XFYqKi.d.mts} +18 -10
- package/dist/{game-BzOJ4f7U.d.ts → game-PMt_jT_7.d.ts} +18 -10
- package/dist/graphql/index.cjs +18 -7
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +2 -2
- package/dist/graphql/index.d.ts +2 -2
- package/dist/graphql/index.mjs +1 -1
- package/dist/hooks/index.cjs +18 -7
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.mjs +4 -4
- package/dist/index.cjs +32 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +18 -11
- package/dist/index.d.ts +18 -11
- package/dist/index.mjs +32 -29
- package/dist/index.mjs.map +1 -1
- package/dist/{post-CcJowEi5.d.mts → post-BJHPePwy.d.mts} +1 -1
- package/dist/{post-D9_1FbFI.d.ts → post-fnGzMU9c.d.ts} +1 -1
- package/dist/types/index.cjs +2 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.mjs +1 -1
- package/dist/utils/index.cjs +8 -17
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +1 -2
- package/dist/utils/index.d.ts +1 -2
- package/dist/utils/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-UOPC7KMU.mjs.map +0 -1
- /package/dist/{chunk-EFNSI75F.mjs.map → chunk-OMXMDHJ3.mjs.map} +0 -0
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-534WN2SR.mjs";
|
|
6
6
|
import {
|
|
7
7
|
gameScreenIdentifierList
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LJJCZVW4.mjs";
|
|
9
9
|
|
|
10
10
|
// src/utils/date.ts
|
|
11
11
|
import dayjs from "dayjs";
|
|
@@ -128,12 +128,6 @@ function computeDailyClueState(dailyClue) {
|
|
|
128
128
|
}
|
|
129
129
|
if (today.isAfter(end)) {
|
|
130
130
|
return {
|
|
131
|
-
gameHistory: {
|
|
132
|
-
gameDate: dailyClue.gameFields.gameDate,
|
|
133
|
-
gameStatus: "GAME_COMPLETED" /* GAME_COMPLETED */,
|
|
134
|
-
gameType: dailyClue.gameFields.gameType,
|
|
135
|
-
pointsEarned: dailyClue.points
|
|
136
|
-
},
|
|
137
131
|
todaysClue: null,
|
|
138
132
|
todaysLetter: null,
|
|
139
133
|
todaysPlacement: null
|
|
@@ -141,31 +135,28 @@ function computeDailyClueState(dailyClue) {
|
|
|
141
135
|
}
|
|
142
136
|
const index = getDayIndex(start, today);
|
|
143
137
|
console.log("DEBUG", {
|
|
138
|
+
collected,
|
|
144
139
|
end: end.format(),
|
|
145
140
|
index,
|
|
146
|
-
|
|
147
|
-
|
|
141
|
+
shuffled,
|
|
142
|
+
shuffledPlacements,
|
|
148
143
|
start: start.format(),
|
|
149
144
|
today: today.format()
|
|
150
145
|
});
|
|
151
146
|
if (index < 0 || index >= shuffled.length) return null;
|
|
152
|
-
const
|
|
153
|
-
if (
|
|
154
|
-
const alreadyHaveTodaysSlot = (collected ?? []).some(
|
|
155
|
-
(l) => l.trim().toLowerCase() === letterToday
|
|
156
|
-
);
|
|
157
|
-
if (alreadyHaveTodaysSlot) {
|
|
147
|
+
const collectedCount = (collected ?? []).length;
|
|
148
|
+
if (collectedCount > index) {
|
|
158
149
|
return {
|
|
159
|
-
gameHistory: null,
|
|
160
150
|
todaysClue: null,
|
|
161
151
|
todaysLetter: null,
|
|
162
152
|
todaysPlacement: null
|
|
163
153
|
};
|
|
164
154
|
}
|
|
155
|
+
const letterToday = shuffled[index];
|
|
156
|
+
if (!letterToday) return null;
|
|
165
157
|
return {
|
|
166
|
-
gameHistory: null,
|
|
167
158
|
todaysClue: shuffledPlacements[index].clue,
|
|
168
|
-
todaysLetter:
|
|
159
|
+
todaysLetter: letterToday,
|
|
169
160
|
todaysPlacement: shuffledPlacements[index].id
|
|
170
161
|
};
|
|
171
162
|
}
|
|
@@ -278,4 +269,4 @@ export {
|
|
|
278
269
|
IOS_URL,
|
|
279
270
|
ANDROID_URL
|
|
280
271
|
};
|
|
281
|
-
//# sourceMappingURL=chunk-
|
|
272
|
+
//# sourceMappingURL=chunk-FTEZFZZW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/date.ts","../src/utils/dailyClueGame.ts","../src/utils/utils.ts"],"sourcesContent":["import dayjs from \"dayjs\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat.js\";\nimport isSameOrAfter from \"dayjs/plugin/isSameOrAfter.js\";\nimport timezone from \"dayjs/plugin/timezone.js\";\nimport utc from \"dayjs/plugin/utc.js\";\n\nexport const dateFormat = \"DD-MM-YYYY\";\nexport const timeFormat = \"HH:mm\";\n\n// Enable custom format parsing\ndayjs.extend(customParseFormat);\ndayjs.extend(utc);\ndayjs.extend(timezone);\ndayjs.extend(isSameOrAfter);\n\nconst NZ_TZ = \"Pacific/Auckland\";\n\nexport function toNZTime(date?: Date | string) {\n return date ? dayjs(date).tz(NZ_TZ) : dayjs().tz(NZ_TZ);\n}\n\n/** Start of the calendar day in Pacific/Auckland (daily games, streaks, etc.). */\nexport function nzStartOfDay(\n input?: Date | string | number | null,\n): dayjs.Dayjs {\n if (input == null) {\n return dayjs().tz(NZ_TZ).startOf(\"day\");\n }\n return dayjs.tz(input, NZ_TZ).startOf(\"day\");\n}\n\ntype DateFormat = \"date\" | \"time\" | \"datetime\";\n\n/**\n * Format a date string to a more readable format.\n * @param dateStr - the date string\n * @param timeStr - optional time string\n * @param display - 'date' | 'time' | 'datetime'\n * @returns formatted string based on display option\n */\nexport const formatDate = (\n dateStr: string,\n display: DateFormat = \"datetime\",\n timeStr?: string,\n) => {\n // Combine date and time into a single string if time is provided\n const dateTimeStr = timeStr ? `${dateStr} ${timeStr}` : dateStr;\n\n // Parse with formats\n const dateTime = timeStr\n ? dayjs(dateTimeStr, `${dateFormat} ${timeFormat}`)\n : dayjs(dateStr, dateFormat);\n\n // Format parts\n const formattedDate = dateTime.format(\"dddd, D MMMM, YYYY\");\n const formattedTime = dateTime.format(\"h:mm a\");\n\n // Return based on display option\n switch (display) {\n case \"date\":\n return formattedDate;\n case \"time\":\n return formattedTime;\n case \"datetime\":\n return `${formattedDate} at ${formattedTime}`;\n default:\n return formattedDate;\n }\n};\n\nexport const getCurrentAndFutureDates = <\n T extends { startDate: string; startTime: string },\n>(\n dates: T[],\n): T[] => {\n const now = dayjs(); // current date and time\n\n return dates.filter((dateObj) => {\n const dateTime = dayjs(\n `${dateObj.startDate} ${dateObj.startTime}`,\n `${dateFormat} ${timeFormat}`,\n );\n return dateTime.isSameOrAfter(now);\n });\n};\n\nexport const isFutureDatesBeforeThreshold = (\n date: {\n startDate: string;\n startTime: string;\n },\n minHoursFromNow: number,\n): boolean => {\n const threshold = minHoursFromNow\n ? dayjs().add(minHoursFromNow, \"hour\")\n : dayjs().startOf(\"day\");\n\n const dateTime = dayjs(\n `${date.startDate} ${date.startTime}`,\n `${dateFormat} ${timeFormat}`,\n );\n\n return dateTime.isSameOrAfter(threshold);\n};\n\nexport const formatTimestamp = (timestamp: string) => {\n const formattedDate = toNZTime(timestamp).format(dateFormat);\n\n return formatDate(formattedDate, \"date\");\n};\n\nexport const isIsoDateString = (value: unknown): value is string => {\n return typeof value === \"string\" && !isNaN(Date.parse(value));\n};\n\n/**\n * Sort an array of date strings by their proximity to the current date.\n * @param dates - The array of date strings to sort.\n * @returns - The sorted array of date strings.\n */\nexport function sortDatesChronologically<\n T extends { startDate: string; startTime: string },\n>(dates: T[]): T[] {\n if (!dates || !dates.length) {\n return [];\n }\n\n return [...dates].sort((a, b) => {\n const dateTimeFormat = `${dateFormat} ${timeFormat}`;\n const dateA = dayjs(`${a.startDate} ${a.startTime}`, dateTimeFormat);\n const dateB = dayjs(`${b.startDate} ${b.startTime}`, dateTimeFormat);\n return dateA.valueOf() - dateB.valueOf(); // chronological order\n });\n}\n","import type { Dayjs } from \"dayjs\";\n\nimport {\n DailyClueGameData,\n EnumGameStatus,\n GameHistory,\n GamePlacement,\n GamePlacementClue,\n gameScreenIdentifierList,\n} from \"../types/game\";\n\nimport { nzStartOfDay } from \"./date\";\n\nfunction createSeededRng(seed: number) {\n let t = seed >>> 0;\n\n return function random() {\n t += 0x6d2b79f5;\n let x = t;\n\n x = Math.imul(x ^ (x >>> 15), x | 1);\n x ^= x + Math.imul(x ^ (x >>> 7), x | 61);\n\n return ((x ^ (x >>> 14)) >>> 0) / 4294967296;\n };\n}\n\nfunction hashStringToNumber(seed: string): number {\n let hash = 2166136261;\n\n for (let i = 0; i < seed.length; i++) {\n hash ^= seed.codePointAt(i) ?? 0;\n hash = Math.imul(hash, 16777619);\n }\n\n return hash >>> 0;\n}\n\n/** Seeded shuffle so all players see the same letter order / placements for a game. */\nexport function seededShuffle<T>(array: readonly T[], seed: string): T[] {\n const rng = createSeededRng(hashStringToNumber(seed));\n const result = [...array];\n\n for (let i = result.length - 1; i > 0; i--) {\n const j = Math.floor(rng() * (i + 1));\n [result[i], result[j]] = [result[j], result[i]];\n }\n\n return result;\n}\n\nfunction getDayIndex(start: Dayjs, today: Dayjs): number {\n return today.diff(start, \"day\");\n}\n\nexport function computeDailyClueState(dailyClue: DailyClueGameData): {\n todaysClue: GamePlacementClue | null;\n todaysLetter: string | null;\n todaysPlacement: GamePlacement | null;\n} | null {\n const { startDate, endDate } = dailyClue.gameFields.gameDate;\n const { shuffled, collected } = dailyClue.letterInfo;\n\n const today = nzStartOfDay();\n const start = nzStartOfDay(startDate);\n const end = nzStartOfDay(endDate);\n\n const shuffledPlacements = seededShuffle(\n gameScreenIdentifierList,\n start.toISOString(),\n );\n\n if (today.isBefore(start)) {\n return null;\n }\n\n if (today.isAfter(end)) {\n return {\n todaysClue: null,\n todaysLetter: null,\n todaysPlacement: null,\n };\n }\n\n const index = getDayIndex(start, today);\n\n console.log(\"DEBUG\", {\n collected,\n end: end.format(),\n index,\n shuffled,\n shuffledPlacements,\n start: start.format(),\n today: today.format(),\n });\n\n if (index < 0 || index >= shuffled.length) return null;\n\n const collectedCount = (collected ?? []).length;\n\n // 🔒 Already claimed today's letter\n if (collectedCount > index) {\n return {\n todaysClue: null,\n todaysLetter: null,\n todaysPlacement: null,\n };\n }\n\n // 🎯 Today's letter is strictly based on day index\n const letterToday = shuffled[index];\n if (!letterToday) return null;\n\n return {\n todaysClue: shuffledPlacements[index].clue,\n todaysLetter: letterToday,\n todaysPlacement: shuffledPlacements[index].id,\n };\n}\n","import {\n EnumInviteStatus,\n EnumPaymentMethod,\n EnumRegions,\n EnumSocialMedia,\n EnumUserLicence,\n} from \"src/enums\";\nimport { OptionItem, SocialMediaType } from \"src/types\";\n\nimport { isIsoDateString } from \"./date\";\n\nexport const removeTypename = (obj: any): any => {\n // Preserve Date objects\n if (obj instanceof Date) {\n return obj;\n }\n\n // Preserve File objects (for apollo-upload-client)\n if (obj instanceof File) {\n return obj;\n }\n\n // Preserve ISO date strings\n if (isIsoDateString(obj)) {\n return obj;\n }\n\n // Handle arrays\n if (Array.isArray(obj)) {\n return obj.map(removeTypename);\n }\n\n // Handle plain objects only\n if (obj !== null && typeof obj === \"object\") {\n const { __typename, ...cleanedObj } = obj;\n\n return Object.keys(cleanedObj).reduce((acc: any, key) => {\n acc[key] = removeTypename(cleanedObj[key]);\n return acc;\n }, {});\n }\n\n // Primitives\n return obj;\n};\n\n/**\n * Truncate text to a specified length and append ellipsis if necessary.\n * @param text\n * @param maxLength\n * @returns\n */\nexport const truncateText = (text: string, maxLength: number = 30): string => {\n return text.length > maxLength ? text.substring(0, maxLength) + \"...\" : text;\n};\n\n/**\n * Convert an array of strings to an array of objects with label and value properties.\n * @param items - The array of strings to convert.\n * @returns - The converted array of objects.\n */\nexport const mapArrayToOptions = (items: string[]): OptionItem[] =>\n items.map((item) => ({\n label: item,\n value: item,\n }));\n\nexport const capitalizeFirstLetter = (str: string): string => {\n return str\n .split(\" \")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(\" \");\n};\n\nexport const statusOptions = [\n ...Object.values(EnumInviteStatus)\n .map((status) => ({\n label: status,\n value: status,\n }))\n .sort((a, b) => a.label.localeCompare(b.label)), // Sort the options alphabetically\n];\n\nexport const availableRegionTypes = Object.values(EnumRegions);\nexport const availableRegionOptions: OptionItem[] =\n mapArrayToOptions(availableRegionTypes);\n\nexport const paymentMethodOptions: OptionItem[] = mapArrayToOptions(\n Object.values(EnumPaymentMethod),\n);\n\nexport function normalizeUrl(url: string): string {\n if (!url.startsWith(\"http://\") && !url.startsWith(\"https://\")) {\n return `https://${url}`;\n }\n return url;\n}\n\nexport const licenseNiceNames: Record<EnumUserLicence, string> = {\n [EnumUserLicence.PRO_EVENT]: \"Pro Event\",\n [EnumUserLicence.PRO_VENDOR]: \"Pro Stallholder\",\n [EnumUserLicence.STANDARD_EVENT]: \"Standard Event\",\n [EnumUserLicence.STANDARD_VENDOR]: \"Standard Stallholder\",\n [EnumUserLicence.PRO_PLUS_EVENT]: \"Pro+Ads Event\",\n [EnumUserLicence.PRO_PLUS_VENDOR]: \"Pro+Ads Stallholder\",\n [EnumUserLicence.STANDARD_PARTNER]: \"Partner\",\n};\n\nexport const cluemartSocialMedia: SocialMediaType[] = [\n {\n link: \"https://www.facebook.com/ClueMartApp\",\n name: EnumSocialMedia.FACEBOOK,\n },\n {\n link: \"https://www.instagram.com/cluemart_app\",\n name: EnumSocialMedia.INSTAGRAM,\n },\n {\n link: \"https://www.tiktok.com/@cluemart\",\n name: EnumSocialMedia.TIKTOK,\n },\n {\n link: \"https://www.youtube.com/@ClueMart-App-NZ\",\n name: EnumSocialMedia.YOUTUBE,\n },\n];\n\nexport const IOS_URL = \"https://apps.apple.com/nz/app/cluemart/id6747251008\";\nexport const ANDROID_URL =\n \"https://play.google.com/store/apps/details?id=com.timardex.cluemart\";\n"],"mappings":";;;;;;;;;;AAAA,OAAO,WAAW;AAClB,OAAO,uBAAuB;AAC9B,OAAO,mBAAmB;AAC1B,OAAO,cAAc;AACrB,OAAO,SAAS;AAET,IAAM,aAAa;AACnB,IAAM,aAAa;AAG1B,MAAM,OAAO,iBAAiB;AAC9B,MAAM,OAAO,GAAG;AAChB,MAAM,OAAO,QAAQ;AACrB,MAAM,OAAO,aAAa;AAE1B,IAAM,QAAQ;AAEP,SAAS,SAAS,MAAsB;AAC7C,SAAO,OAAO,MAAM,IAAI,EAAE,GAAG,KAAK,IAAI,MAAM,EAAE,GAAG,KAAK;AACxD;AAGO,SAAS,aACd,OACa;AACb,MAAI,SAAS,MAAM;AACjB,WAAO,MAAM,EAAE,GAAG,KAAK,EAAE,QAAQ,KAAK;AAAA,EACxC;AACA,SAAO,MAAM,GAAG,OAAO,KAAK,EAAE,QAAQ,KAAK;AAC7C;AAWO,IAAM,aAAa,CACxB,SACA,UAAsB,YACtB,YACG;AAEH,QAAM,cAAc,UAAU,GAAG,OAAO,IAAI,OAAO,KAAK;AAGxD,QAAM,WAAW,UACb,MAAM,aAAa,GAAG,UAAU,IAAI,UAAU,EAAE,IAChD,MAAM,SAAS,U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GAAG;AAAA,EAC9B,sCAA+B,GAAG;AAAA,EAClC,wCAAgC,GAAG;AAAA,EACnC,sCAA+B,GAAG;AAAA,EAClC,wCAAgC,GAAG;AAAA,EACnC,0CAAiC,GAAG;AACtC;AAEO,IAAM,sBAAyC;AAAA,EACpD;AAAA,IACE,MAAM;AAAA,IACN;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN;AAAA,EACF;AACF;AAEO,IAAM,UAAU;AAChB,IAAM,cACX;","names":[]}
|
|
@@ -105,8 +105,9 @@ var gameTypeToDisplayName = {
|
|
|
105
105
|
};
|
|
106
106
|
var EnumGameStatus = /* @__PURE__ */ ((EnumGameStatus2) => {
|
|
107
107
|
EnumGameStatus2["GAME_COMPLETED"] = "GAME_COMPLETED";
|
|
108
|
-
EnumGameStatus2["GAME_LEFT"] = "GAME_LEFT";
|
|
109
108
|
EnumGameStatus2["GAME_IN_PROGRESS"] = "GAME_IN_PROGRESS";
|
|
109
|
+
EnumGameStatus2["GAME_LEFT"] = "GAME_LEFT";
|
|
110
|
+
EnumGameStatus2["GAME_STARTED"] = "GAME_STARTED";
|
|
110
111
|
return EnumGameStatus2;
|
|
111
112
|
})(EnumGameStatus || {});
|
|
112
113
|
|
|
@@ -116,4 +117,4 @@ export {
|
|
|
116
117
|
gameTypeToDisplayName,
|
|
117
118
|
EnumGameStatus
|
|
118
119
|
};
|
|
119
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-LJJCZVW4.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/game.ts"],"sourcesContent":["import { OwnerType } from \"./global\";\n\nexport const gameScreenIdentifierList = [\n {\n clue: \"Where your actions turn into a timeline.\",\n id: \"activities\",\n match: \"/profile/activities\",\n },\n {\n clue: \"Where conversations happen without speaking.\",\n id: \"chat\",\n match: \"/profile/chat\",\n },\n {\n clue: \"The place to redefine who you are.\",\n id: \"edit-profile\",\n match: \"/profile/edit-profile\",\n },\n {\n clue: \"A single moment worth showing up for.\",\n id: \"single-event\",\n match: /^\\/events\\/[a-f0-9]{24}$/,\n },\n {\n clue: \"What’s happening around you, right now.\",\n id: \"events-near-me\",\n match: \"/events/events-near-me\",\n },\n {\n clue: \"A collection of things worth attending.\",\n id: \"events\",\n match: \"/events\",\n },\n {\n clue: \"What’s happening in a wider area—not just nearby.\",\n id: \"events-region\",\n match: /^\\/events\\/region\\/[^/]+$/,\n },\n {\n clue: \"Where you go to find something specific.\",\n id: \"events-search\",\n match: \"/events/search\",\n },\n {\n clue: \"Where fun becomes a challenge.\",\n id: \"games\",\n match: \"/games\",\n },\n {\n clue: \"Your starting point for everything.\",\n id: \"home\",\n match: \"/\",\n },\n {\n clue: \"Where the app taps you on the shoulder.\",\n id: \"notifications\",\n match: \"/notifications\",\n },\n {\n clue: \"Where you fine-tune your experience.\",\n id: \"options\",\n match: \"/options\",\n },\n {\n clue: \"A single collaborator in the ecosystem.\",\n id: \"single-partner\",\n match: /^\\/partners\\/[a-f0-9]{24}$/,\n },\n {\n clue: \"The network behind the scenes.\",\n id: \"partners\",\n match: \"/partners\",\n },\n {\n clue: \"Where you share something with everyone.\",\n id: \"single-visitor-post\",\n match: /^\\/visitors\\/posts\\/[a-f0-9]{24}$/,\n },\n {\n clue: \"Your identity, on display.\",\n id: \"profile\",\n match: \"/profile\",\n },\n {\n clue: \"One provider offering something valuable.\",\n id: \"single-vendor\",\n match: /^\\/vendors\\/[a-f0-9]{24}$/,\n },\n {\n clue: \"A marketplace of providers.\",\n id: \"vendors\",\n match: \"/vendors\",\n },\n {\n clue: \"People who stopped by to see you.\",\n id: \"visitors\",\n match: \"/visitors\",\n },\n] as const;\n\nexport type GamePlacement = (typeof gameScreenIdentifierList)[number][\"id\"];\nexport type GamePlacementClue =\n (typeof gameScreenIdentifierList)[number][\"clue\"];\n\nexport enum EnumGameType {\n DAILY_CLUE = \"dailyClue\",\n}\n\nexport const gameTypeToDisplayName: Record<EnumGameType, string> = {\n [EnumGameType.DAILY_CLUE]: \"Daily Clue\",\n};\n\nexport type GameDate = {\n startDate: Date;\n endDate: Date;\n};\n\nexport type BaseGame = {\n gameDate: GameDate;\n gameSolution: string;\n gameType: EnumGameType;\n};\n\nexport type DailyClueGameData = {\n gameFields: BaseGame;\n lastFoundDate: Date | null;\n points: number;\n letterInfo: {\n collected: string[] | null; // The letters the user has found, e.g. [\"C\", \"L\", \"U\"]\n shuffled: string[]; // The letters of the solution, but shuffled, e.g. [\"L\", \"C\", \"U\"]\n todaysLetter: string | null; // The letter the user has to find today, e.g. \"C\"\n todaysClue: GamePlacementClue | null; // The clue for user to find the letter, e.g. related to {todaysPlacement}\n todaysPlacement: GamePlacement | null; // The screen where the user has to find the clue, e.g. \"HomeScreen\"\n };\n // User has found the clue 3 days in a row, this is incrementing if the user finds the clue and decrements if user misses a day\n streak: number;\n};\n\ntype GameDataMap = {\n [EnumGameType.DAILY_CLUE]: DailyClueGameData;\n};\
|
|
1
|
+
{"version":3,"sources":["../src/types/game.ts"],"sourcesContent":["import { OwnerType } from \"./global\";\n\nexport const gameScreenIdentifierList = [\n {\n clue: \"Where your actions turn into a timeline.\",\n id: \"activities\",\n match: \"/profile/activities\",\n },\n {\n clue: \"Where conversations happen without speaking.\",\n id: \"chat\",\n match: \"/profile/chat\",\n },\n {\n clue: \"The place to redefine who you are.\",\n id: \"edit-profile\",\n match: \"/profile/edit-profile\",\n },\n {\n clue: \"A single moment worth showing up for.\",\n id: \"single-event\",\n match: /^\\/events\\/[a-f0-9]{24}$/,\n },\n {\n clue: \"What’s happening around you, right now.\",\n id: \"events-near-me\",\n match: \"/events/events-near-me\",\n },\n {\n clue: \"A collection of things worth attending.\",\n id: \"events\",\n match: \"/events\",\n },\n {\n clue: \"What’s happening in a wider area—not just nearby.\",\n id: \"events-region\",\n match: /^\\/events\\/region\\/[^/]+$/,\n },\n {\n clue: \"Where you go to find something specific.\",\n id: \"events-search\",\n match: \"/events/search\",\n },\n {\n clue: \"Where fun becomes a challenge.\",\n id: \"games\",\n match: \"/games\",\n },\n {\n clue: \"Your starting point for everything.\",\n id: \"home\",\n match: \"/\",\n },\n {\n clue: \"Where the app taps you on the shoulder.\",\n id: \"notifications\",\n match: \"/notifications\",\n },\n {\n clue: \"Where you fine-tune your experience.\",\n id: \"options\",\n match: \"/options\",\n },\n {\n clue: \"A single collaborator in the ecosystem.\",\n id: \"single-partner\",\n match: /^\\/partners\\/[a-f0-9]{24}$/,\n },\n {\n clue: \"The network behind the scenes.\",\n id: \"partners\",\n match: \"/partners\",\n },\n {\n clue: \"Where you share something with everyone.\",\n id: \"single-visitor-post\",\n match: /^\\/visitors\\/posts\\/[a-f0-9]{24}$/,\n },\n {\n clue: \"Your identity, on display.\",\n id: \"profile\",\n match: \"/profile\",\n },\n {\n clue: \"One provider offering something valuable.\",\n id: \"single-vendor\",\n match: /^\\/vendors\\/[a-f0-9]{24}$/,\n },\n {\n clue: \"A marketplace of providers.\",\n id: \"vendors\",\n match: \"/vendors\",\n },\n {\n clue: \"People who stopped by to see you.\",\n id: \"visitors\",\n match: \"/visitors\",\n },\n] as const;\n\nexport type GamePlacement = (typeof gameScreenIdentifierList)[number][\"id\"];\nexport type GamePlacementClue =\n (typeof gameScreenIdentifierList)[number][\"clue\"];\n\nexport enum EnumGameType {\n DAILY_CLUE = \"dailyClue\",\n}\n\nexport const gameTypeToDisplayName: Record<EnumGameType, string> = {\n [EnumGameType.DAILY_CLUE]: \"Daily Clue\",\n};\n\nexport type GameDate = {\n startDate: Date;\n endDate: Date;\n};\n\nexport type BaseGame = {\n gameDate: GameDate;\n gameSolution: string;\n gameType: EnumGameType;\n};\n\nexport type DailyClueGameData = {\n gameFields: BaseGame;\n lastFoundDate: Date | null;\n points: number;\n letterInfo: {\n collected: string[] | null; // The letters the user has found, e.g. [\"C\", \"L\", \"U\"]\n shuffled: string[]; // The letters of the solution, but shuffled, e.g. [\"L\", \"C\", \"U\"]\n todaysLetter: string | null; // The letter the user has to find today, e.g. \"C\"\n todaysClue: GamePlacementClue | null; // The clue for user to find the letter, e.g. related to {todaysPlacement}\n todaysPlacement: GamePlacement | null; // The screen where the user has to find the clue, e.g. \"HomeScreen\"\n };\n // User has found the clue 3 days in a row, this is incrementing if the user finds the clue and decrements if user misses a day\n streak: number;\n};\n\nexport enum EnumGameStatus {\n GAME_COMPLETED = \"GAME_COMPLETED\",\n GAME_IN_PROGRESS = \"GAME_IN_PROGRESS\",\n GAME_LEFT = \"GAME_LEFT\",\n GAME_STARTED = \"GAME_STARTED\",\n}\n\nexport type GameHistory = {\n gameDate: GameDate;\n gameStatus: EnumGameStatus;\n gameType: EnumGameType;\n pointsEarned: number;\n};\n\ntype GameDataMap = {\n [EnumGameType.DAILY_CLUE]: DailyClueGameData;\n};\ntype GameDataMapType = {\n [K in keyof GameDataMap]?: GameDataMap[K] | null;\n};\n\nexport type GameDataType = {\n active: boolean;\n createdAt: Date;\n gameData: GameDataMapType;\n gameHistory: GameHistory[] | null;\n gameType: EnumGameType;\n updatedAt: Date | null;\n};\n\nexport type GameType = {\n _id: string;\n active: boolean;\n createdAt: Date;\n deletedAt: Date | null;\n game: GameDataType[] | null;\n owner: OwnerType;\n points: number;\n updatedAt: Date | null;\n};\n\nexport type GameLeaderboard = {\n gameHistory: GameHistory[] | null;\n overallPoints: number;\n owner: OwnerType;\n};\n"],"mappings":";AAEO,IAAM,2BAA2B;AAAA,EACtC;AAAA,IACE,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,IAAI;AAAA,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AAAA,EACjE,CAAC,4BAAuB,GAAG;AAC7B;AA4BO,IAAK,iBAAL,kBAAKC,oBAAL;AACL,EAAAA,gBAAA,oBAAiB;AACjB,EAAAA,gBAAA,sBAAmB;AACnB,EAAAA,gBAAA,eAAY;AACZ,EAAAA,gBAAA,kBAAe;AAJL,SAAAA;AAAA,GAAA;","names":["EnumGameType","EnumGameStatus"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mapArrayToOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FTEZFZZW.mjs";
|
|
4
4
|
import {
|
|
5
5
|
EnumFoodFlavor
|
|
6
6
|
} from "./chunk-534WN2SR.mjs";
|
|
@@ -1952,4 +1952,4 @@ export {
|
|
|
1952
1952
|
contactUsFields,
|
|
1953
1953
|
partnerBasicInfoFields
|
|
1954
1954
|
};
|
|
1955
|
-
//# sourceMappingURL=chunk-
|
|
1955
|
+
//# sourceMappingURL=chunk-OMXMDHJ3.mjs.map
|
|
@@ -43,10 +43,10 @@ import {
|
|
|
43
43
|
vendorStallSize,
|
|
44
44
|
vendorStartDateFields,
|
|
45
45
|
vendorTable
|
|
46
|
-
} from "../chunk-
|
|
47
|
-
import "../chunk-
|
|
46
|
+
} from "../chunk-OMXMDHJ3.mjs";
|
|
47
|
+
import "../chunk-FTEZFZZW.mjs";
|
|
48
48
|
import "../chunk-534WN2SR.mjs";
|
|
49
|
-
import "../chunk-
|
|
49
|
+
import "../chunk-LJJCZVW4.mjs";
|
|
50
50
|
export {
|
|
51
51
|
availableCategories,
|
|
52
52
|
availableTagTypes,
|
|
@@ -105,16 +105,11 @@ type DailyClueGameData = {
|
|
|
105
105
|
};
|
|
106
106
|
streak: number;
|
|
107
107
|
};
|
|
108
|
-
type GameDataMap = {
|
|
109
|
-
[EnumGameType.DAILY_CLUE]: DailyClueGameData;
|
|
110
|
-
};
|
|
111
|
-
type GameData = {
|
|
112
|
-
[K in keyof GameDataMap]?: GameDataMap[K] | null;
|
|
113
|
-
};
|
|
114
108
|
declare enum EnumGameStatus {
|
|
115
109
|
GAME_COMPLETED = "GAME_COMPLETED",
|
|
110
|
+
GAME_IN_PROGRESS = "GAME_IN_PROGRESS",
|
|
116
111
|
GAME_LEFT = "GAME_LEFT",
|
|
117
|
-
|
|
112
|
+
GAME_STARTED = "GAME_STARTED"
|
|
118
113
|
}
|
|
119
114
|
type GameHistory = {
|
|
120
115
|
gameDate: GameDate;
|
|
@@ -122,13 +117,26 @@ type GameHistory = {
|
|
|
122
117
|
gameType: EnumGameType;
|
|
123
118
|
pointsEarned: number;
|
|
124
119
|
};
|
|
120
|
+
type GameDataMap = {
|
|
121
|
+
[EnumGameType.DAILY_CLUE]: DailyClueGameData;
|
|
122
|
+
};
|
|
123
|
+
type GameDataMapType = {
|
|
124
|
+
[K in keyof GameDataMap]?: GameDataMap[K] | null;
|
|
125
|
+
};
|
|
126
|
+
type GameDataType = {
|
|
127
|
+
active: boolean;
|
|
128
|
+
createdAt: Date;
|
|
129
|
+
gameData: GameDataMapType;
|
|
130
|
+
gameHistory: GameHistory[] | null;
|
|
131
|
+
gameType: EnumGameType;
|
|
132
|
+
updatedAt: Date | null;
|
|
133
|
+
};
|
|
125
134
|
type GameType = {
|
|
126
135
|
_id: string;
|
|
127
136
|
active: boolean;
|
|
128
137
|
createdAt: Date;
|
|
129
138
|
deletedAt: Date | null;
|
|
130
|
-
|
|
131
|
-
gameHistory: GameHistory[] | null;
|
|
139
|
+
game: GameDataType[] | null;
|
|
132
140
|
owner: OwnerType;
|
|
133
141
|
points: number;
|
|
134
142
|
updatedAt: Date | null;
|
|
@@ -139,4 +147,4 @@ type GameLeaderboard = {
|
|
|
139
147
|
owner: OwnerType;
|
|
140
148
|
};
|
|
141
149
|
|
|
142
|
-
export { type BaseGame as B, type DailyClueGameData as D, EnumGameStatus as E, type GameType as G, type GameLeaderboard as a, EnumGameType as b, type
|
|
150
|
+
export { type BaseGame as B, type DailyClueGameData as D, EnumGameStatus as E, type GameType as G, type GameLeaderboard as a, EnumGameType as b, type GameDataType as c, type GameDate as d, type GameHistory as e, type GamePlacement as f, type GamePlacementClue as g, gameScreenIdentifierList as h, gameTypeToDisplayName as i };
|
|
@@ -105,16 +105,11 @@ type DailyClueGameData = {
|
|
|
105
105
|
};
|
|
106
106
|
streak: number;
|
|
107
107
|
};
|
|
108
|
-
type GameDataMap = {
|
|
109
|
-
[EnumGameType.DAILY_CLUE]: DailyClueGameData;
|
|
110
|
-
};
|
|
111
|
-
type GameData = {
|
|
112
|
-
[K in keyof GameDataMap]?: GameDataMap[K] | null;
|
|
113
|
-
};
|
|
114
108
|
declare enum EnumGameStatus {
|
|
115
109
|
GAME_COMPLETED = "GAME_COMPLETED",
|
|
110
|
+
GAME_IN_PROGRESS = "GAME_IN_PROGRESS",
|
|
116
111
|
GAME_LEFT = "GAME_LEFT",
|
|
117
|
-
|
|
112
|
+
GAME_STARTED = "GAME_STARTED"
|
|
118
113
|
}
|
|
119
114
|
type GameHistory = {
|
|
120
115
|
gameDate: GameDate;
|
|
@@ -122,13 +117,26 @@ type GameHistory = {
|
|
|
122
117
|
gameType: EnumGameType;
|
|
123
118
|
pointsEarned: number;
|
|
124
119
|
};
|
|
120
|
+
type GameDataMap = {
|
|
121
|
+
[EnumGameType.DAILY_CLUE]: DailyClueGameData;
|
|
122
|
+
};
|
|
123
|
+
type GameDataMapType = {
|
|
124
|
+
[K in keyof GameDataMap]?: GameDataMap[K] | null;
|
|
125
|
+
};
|
|
126
|
+
type GameDataType = {
|
|
127
|
+
active: boolean;
|
|
128
|
+
createdAt: Date;
|
|
129
|
+
gameData: GameDataMapType;
|
|
130
|
+
gameHistory: GameHistory[] | null;
|
|
131
|
+
gameType: EnumGameType;
|
|
132
|
+
updatedAt: Date | null;
|
|
133
|
+
};
|
|
125
134
|
type GameType = {
|
|
126
135
|
_id: string;
|
|
127
136
|
active: boolean;
|
|
128
137
|
createdAt: Date;
|
|
129
138
|
deletedAt: Date | null;
|
|
130
|
-
|
|
131
|
-
gameHistory: GameHistory[] | null;
|
|
139
|
+
game: GameDataType[] | null;
|
|
132
140
|
owner: OwnerType;
|
|
133
141
|
points: number;
|
|
134
142
|
updatedAt: Date | null;
|
|
@@ -139,4 +147,4 @@ type GameLeaderboard = {
|
|
|
139
147
|
owner: OwnerType;
|
|
140
148
|
};
|
|
141
149
|
|
|
142
|
-
export { type BaseGame as B, type DailyClueGameData as D, EnumGameStatus as E, type GameType as G, type GameLeaderboard as a, EnumGameType as b, type
|
|
150
|
+
export { type BaseGame as B, type DailyClueGameData as D, EnumGameStatus as E, type GameType as G, type GameLeaderboard as a, EnumGameType as b, type GameDataType as c, type GameDate as d, type GameHistory as e, type GamePlacement as f, type GamePlacementClue as g, gameScreenIdentifierList as h, gameTypeToDisplayName as i };
|
package/dist/graphql/index.cjs
CHANGED
|
@@ -3391,12 +3391,10 @@ var GAME_HISTORY_FIELDS_FRAGMENT = import_client55.gql`
|
|
|
3391
3391
|
}
|
|
3392
3392
|
${GAME_DATE_FIELDS_FRAGMENT}
|
|
3393
3393
|
`;
|
|
3394
|
-
var
|
|
3395
|
-
fragment
|
|
3396
|
-
_id
|
|
3394
|
+
var GAME_DATA_FIELDS_FRAGMENT = import_client55.gql`
|
|
3395
|
+
fragment GameDataFields on GameDataType {
|
|
3397
3396
|
active
|
|
3398
3397
|
createdAt
|
|
3399
|
-
deletedAt
|
|
3400
3398
|
gameData {
|
|
3401
3399
|
dailyClue {
|
|
3402
3400
|
...DailyClueGameDataFields
|
|
@@ -3405,16 +3403,29 @@ var GAME_FIELDS_FRAGMENT = import_client55.gql`
|
|
|
3405
3403
|
gameHistory {
|
|
3406
3404
|
...GameHistoryFields
|
|
3407
3405
|
}
|
|
3406
|
+
gameType
|
|
3408
3407
|
updatedAt
|
|
3408
|
+
}
|
|
3409
|
+
${DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT}
|
|
3410
|
+
${GAME_HISTORY_FIELDS_FRAGMENT}
|
|
3411
|
+
`;
|
|
3412
|
+
var GAME_FIELDS_FRAGMENT = import_client55.gql`
|
|
3413
|
+
fragment GameFields on GameType {
|
|
3414
|
+
_id
|
|
3415
|
+
active
|
|
3416
|
+
createdAt
|
|
3417
|
+
deletedAt
|
|
3418
|
+
game {
|
|
3419
|
+
...GameDataFields
|
|
3420
|
+
}
|
|
3409
3421
|
owner {
|
|
3410
3422
|
...OwnerFields
|
|
3411
3423
|
}
|
|
3412
3424
|
points
|
|
3425
|
+
updatedAt
|
|
3413
3426
|
}
|
|
3414
|
-
${DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT}
|
|
3415
3427
|
${OWNER_FIELDS_FRAGMENT}
|
|
3416
|
-
${
|
|
3417
|
-
${GAME_HISTORY_FIELDS_FRAGMENT}
|
|
3428
|
+
${GAME_DATA_FIELDS_FRAGMENT}
|
|
3418
3429
|
`;
|
|
3419
3430
|
var GET_GAMES = import_client55.gql`
|
|
3420
3431
|
query getGames {
|