rategame-shared 1.1.456 → 1.1.457
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/helpers/fancyText.d.ts +5 -0
- package/dist/helpers/fancyText.js +29 -0
- package/dist/helpers/favoriteTeams.d.ts +26 -0
- package/dist/helpers/favoriteTeams.js +91 -0
- package/dist/schemas/achievementUnlockSource.d.ts +20 -0
- package/dist/schemas/achievementUnlockSource.js +23 -0
- package/dist/schemas/notification.d.ts +5 -0
- package/dist/schemas/rating.d.ts +6 -0
- package/dist/schemas/rating.js +1 -0
- package/dist/schemas/userEvent.d.ts +38 -0
- package/dist/schemas/userEvent.js +28 -0
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const FANCY_TEXT_ERROR_MESSAGE = "Fancy or styled characters are not allowed. Please use normal letters and numbers.";
|
|
2
|
+
/**
|
|
3
|
+
* Detects mathematical-alphanumeric, fullwidth, and similar disguised characters.
|
|
4
|
+
*/
|
|
5
|
+
export declare function containsFancyText(value: string | null | undefined): boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.containsFancyText = exports.FANCY_TEXT_ERROR_MESSAGE = void 0;
|
|
4
|
+
exports.FANCY_TEXT_ERROR_MESSAGE = 'Fancy or styled characters are not allowed. Please use normal letters and numbers.';
|
|
5
|
+
/** Unicode ranges used for disguised / styled text (not normal user input). */
|
|
6
|
+
const FANCY_CODE_POINT_RANGES = [
|
|
7
|
+
[0x1d400, 0x1d7ff],
|
|
8
|
+
[0x1d800, 0x1daff],
|
|
9
|
+
[0x1f100, 0x1f1ff],
|
|
10
|
+
[0x2100, 0x214f],
|
|
11
|
+
[0x2460, 0x24ff],
|
|
12
|
+
[0xff01, 0xff5e], // Fullwidth ASCII variants
|
|
13
|
+
];
|
|
14
|
+
const isFancyCodePoint = (code) => FANCY_CODE_POINT_RANGES.some(([start, end]) => code >= start && code <= end);
|
|
15
|
+
/**
|
|
16
|
+
* Detects mathematical-alphanumeric, fullwidth, and similar disguised characters.
|
|
17
|
+
*/
|
|
18
|
+
function containsFancyText(value) {
|
|
19
|
+
if (!value)
|
|
20
|
+
return false;
|
|
21
|
+
for (const char of value) {
|
|
22
|
+
const code = char.codePointAt(0);
|
|
23
|
+
if (code !== undefined && isFancyCodePoint(code)) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
exports.containsFancyText = containsFancyText;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const DEFAULT_FAVORITE_TEAM_LEAGUE_ORDER: readonly ["nba", "mlb", "wbc", "nfl", "nhl", "iho", "epl", "fifa", "cbb", "cfb", "mls", "wnba", "cwc"];
|
|
2
|
+
export type FavoriteTeamLookup = {
|
|
3
|
+
id?: string | number;
|
|
4
|
+
name?: string;
|
|
5
|
+
image?: string;
|
|
6
|
+
primaryColor?: string | null;
|
|
7
|
+
countryId?: string | number;
|
|
8
|
+
};
|
|
9
|
+
export type FavoriteTeamChip = {
|
|
10
|
+
key: string;
|
|
11
|
+
league: string;
|
|
12
|
+
teamImage: string;
|
|
13
|
+
teamId: string;
|
|
14
|
+
teamName: string;
|
|
15
|
+
primaryColor: string | null;
|
|
16
|
+
countryId?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function getFavoriteTeamChipKey({ league, teamId, countryId, }: {
|
|
19
|
+
league: string;
|
|
20
|
+
teamId: string;
|
|
21
|
+
countryId?: string;
|
|
22
|
+
}): string;
|
|
23
|
+
export declare function buildFavoriteTeamChips(favoriteTeamsPerLeague: Record<string, string> | undefined, allTeams: Record<string, FavoriteTeamLookup[] | undefined> | undefined): FavoriteTeamChip[];
|
|
24
|
+
export declare function sortFavoriteTeamChips(chips: FavoriteTeamChip[], favoriteTeamsOrder?: string[]): FavoriteTeamChip[];
|
|
25
|
+
export declare function buildFavoriteTeamsOrderFromChips(chips: FavoriteTeamChip[]): string[];
|
|
26
|
+
export declare function syncFavoriteTeamsOrder(favoriteTeamsOrder: string[] | undefined, chips: FavoriteTeamChip[]): string[];
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.syncFavoriteTeamsOrder = exports.buildFavoriteTeamsOrderFromChips = exports.sortFavoriteTeamChips = exports.buildFavoriteTeamChips = exports.getFavoriteTeamChipKey = exports.DEFAULT_FAVORITE_TEAM_LEAGUE_ORDER = void 0;
|
|
4
|
+
exports.DEFAULT_FAVORITE_TEAM_LEAGUE_ORDER = [
|
|
5
|
+
"nba",
|
|
6
|
+
"mlb",
|
|
7
|
+
"wbc",
|
|
8
|
+
"nfl",
|
|
9
|
+
"nhl",
|
|
10
|
+
"iho",
|
|
11
|
+
"epl",
|
|
12
|
+
"fifa",
|
|
13
|
+
"cbb",
|
|
14
|
+
"cfb",
|
|
15
|
+
"mls",
|
|
16
|
+
"wnba",
|
|
17
|
+
"cwc",
|
|
18
|
+
];
|
|
19
|
+
function getFavoriteTeamChipKey({ league, teamId, countryId, }) {
|
|
20
|
+
return countryId ? `country-${countryId}` : `${league}-${teamId}`;
|
|
21
|
+
}
|
|
22
|
+
exports.getFavoriteTeamChipKey = getFavoriteTeamChipKey;
|
|
23
|
+
function buildFavoriteTeamChips(favoriteTeamsPerLeague, allTeams) {
|
|
24
|
+
if (!favoriteTeamsPerLeague)
|
|
25
|
+
return [];
|
|
26
|
+
const chipsByKey = new Map();
|
|
27
|
+
Object.entries(favoriteTeamsPerLeague).forEach(([league, teamId]) => {
|
|
28
|
+
var _a, _b, _c;
|
|
29
|
+
const leagueKey = league === "ncaa" ? "cbb" : league;
|
|
30
|
+
const favoriteTeam = (_a = allTeams === null || allTeams === void 0 ? void 0 : allTeams[leagueKey]) === null || _a === void 0 ? void 0 : _a.find(item => { var _a; return ((_a = item === null || item === void 0 ? void 0 : item.id) === null || _a === void 0 ? void 0 : _a.toString()) === teamId; });
|
|
31
|
+
if (!(favoriteTeam === null || favoriteTeam === void 0 ? void 0 : favoriteTeam.image))
|
|
32
|
+
return;
|
|
33
|
+
const countryId = favoriteTeam.countryId
|
|
34
|
+
? String(favoriteTeam.countryId)
|
|
35
|
+
: undefined;
|
|
36
|
+
const key = getFavoriteTeamChipKey({
|
|
37
|
+
league: leagueKey,
|
|
38
|
+
teamId,
|
|
39
|
+
countryId,
|
|
40
|
+
});
|
|
41
|
+
if (chipsByKey.has(key))
|
|
42
|
+
return;
|
|
43
|
+
chipsByKey.set(key, {
|
|
44
|
+
key,
|
|
45
|
+
league: leagueKey,
|
|
46
|
+
teamImage: favoriteTeam.image,
|
|
47
|
+
teamId,
|
|
48
|
+
teamName: (_b = favoriteTeam.name) !== null && _b !== void 0 ? _b : "",
|
|
49
|
+
primaryColor: (_c = favoriteTeam.primaryColor) !== null && _c !== void 0 ? _c : null,
|
|
50
|
+
countryId,
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
return Array.from(chipsByKey.values());
|
|
54
|
+
}
|
|
55
|
+
exports.buildFavoriteTeamChips = buildFavoriteTeamChips;
|
|
56
|
+
function sortFavoriteTeamChips(chips, favoriteTeamsOrder) {
|
|
57
|
+
if (!chips.length)
|
|
58
|
+
return chips;
|
|
59
|
+
const orderIndex = new Map((favoriteTeamsOrder !== null && favoriteTeamsOrder !== void 0 ? favoriteTeamsOrder : []).map((key, index) => [key, index]));
|
|
60
|
+
return [...chips].sort((a, b) => {
|
|
61
|
+
const aOrder = orderIndex.get(a.key);
|
|
62
|
+
const bOrder = orderIndex.get(b.key);
|
|
63
|
+
if (aOrder !== undefined && bOrder !== undefined) {
|
|
64
|
+
return aOrder - bOrder;
|
|
65
|
+
}
|
|
66
|
+
if (aOrder !== undefined)
|
|
67
|
+
return -1;
|
|
68
|
+
if (bOrder !== undefined)
|
|
69
|
+
return 1;
|
|
70
|
+
const aIndex = exports.DEFAULT_FAVORITE_TEAM_LEAGUE_ORDER.indexOf(a.league);
|
|
71
|
+
const bIndex = exports.DEFAULT_FAVORITE_TEAM_LEAGUE_ORDER.indexOf(b.league);
|
|
72
|
+
return ((aIndex === -1 ? exports.DEFAULT_FAVORITE_TEAM_LEAGUE_ORDER.length : aIndex) -
|
|
73
|
+
(bIndex === -1 ? exports.DEFAULT_FAVORITE_TEAM_LEAGUE_ORDER.length : bIndex));
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
exports.sortFavoriteTeamChips = sortFavoriteTeamChips;
|
|
77
|
+
function buildFavoriteTeamsOrderFromChips(chips) {
|
|
78
|
+
return sortFavoriteTeamChips(chips).map(chip => chip.key);
|
|
79
|
+
}
|
|
80
|
+
exports.buildFavoriteTeamsOrderFromChips = buildFavoriteTeamsOrderFromChips;
|
|
81
|
+
function syncFavoriteTeamsOrder(favoriteTeamsOrder, chips) {
|
|
82
|
+
const chipKeys = new Set(chips.map(chip => chip.key));
|
|
83
|
+
const syncedOrder = (favoriteTeamsOrder !== null && favoriteTeamsOrder !== void 0 ? favoriteTeamsOrder : []).filter(key => chipKeys.has(key));
|
|
84
|
+
chips.forEach(chip => {
|
|
85
|
+
if (!syncedOrder.includes(chip.key)) {
|
|
86
|
+
syncedOrder.push(chip.key);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return syncedOrder;
|
|
90
|
+
}
|
|
91
|
+
exports.syncFavoriteTeamsOrder = syncFavoriteTeamsOrder;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const achievementUnlockSourceTypeSchema: z.ZodUnion<[z.ZodLiteral<"rating">, z.ZodLiteral<"stadium_rating">, z.ZodLiteral<"experience_rating">, z.ZodLiteral<"list">, z.ZodLiteral<"pick">, z.ZodLiteral<"player_vote">, z.ZodLiteral<"comment">, z.ZodLiteral<"profile">, z.ZodLiteral<"follower">, z.ZodLiteral<"games">, z.ZodLiteral<"none">]>;
|
|
3
|
+
export declare const achievementUnlockSourceSchema: z.ZodObject<{
|
|
4
|
+
type: z.ZodUnion<[z.ZodLiteral<"rating">, z.ZodLiteral<"stadium_rating">, z.ZodLiteral<"experience_rating">, z.ZodLiteral<"list">, z.ZodLiteral<"pick">, z.ZodLiteral<"player_vote">, z.ZodLiteral<"comment">, z.ZodLiteral<"profile">, z.ZodLiteral<"follower">, z.ZodLiteral<"games">, z.ZodLiteral<"none">]>;
|
|
5
|
+
id: z.ZodOptional<z.ZodString>;
|
|
6
|
+
gameId: z.ZodOptional<z.ZodString>;
|
|
7
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
type: "none" | "pick" | "rating" | "comment" | "games" | "profile" | "list" | "stadium_rating" | "experience_rating" | "player_vote" | "follower";
|
|
10
|
+
id?: string | undefined;
|
|
11
|
+
metadata?: Record<string, unknown> | undefined;
|
|
12
|
+
gameId?: string | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
type: "none" | "pick" | "rating" | "comment" | "games" | "profile" | "list" | "stadium_rating" | "experience_rating" | "player_vote" | "follower";
|
|
15
|
+
id?: string | undefined;
|
|
16
|
+
metadata?: Record<string, unknown> | undefined;
|
|
17
|
+
gameId?: string | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
export type AchievementUnlockSourceType = z.infer<typeof achievementUnlockSourceTypeSchema>;
|
|
20
|
+
export type AchievementUnlockSource = z.infer<typeof achievementUnlockSourceSchema>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.achievementUnlockSourceSchema = exports.achievementUnlockSourceTypeSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.achievementUnlockSourceTypeSchema = (0, zod_1.union)([
|
|
6
|
+
(0, zod_1.literal)("rating"),
|
|
7
|
+
(0, zod_1.literal)("stadium_rating"),
|
|
8
|
+
(0, zod_1.literal)("experience_rating"),
|
|
9
|
+
(0, zod_1.literal)("list"),
|
|
10
|
+
(0, zod_1.literal)("pick"),
|
|
11
|
+
(0, zod_1.literal)("player_vote"),
|
|
12
|
+
(0, zod_1.literal)("comment"),
|
|
13
|
+
(0, zod_1.literal)("profile"),
|
|
14
|
+
(0, zod_1.literal)("follower"),
|
|
15
|
+
(0, zod_1.literal)("games"),
|
|
16
|
+
(0, zod_1.literal)("none"),
|
|
17
|
+
]);
|
|
18
|
+
exports.achievementUnlockSourceSchema = (0, zod_1.object)({
|
|
19
|
+
type: exports.achievementUnlockSourceTypeSchema,
|
|
20
|
+
id: (0, zod_1.string)().optional(),
|
|
21
|
+
gameId: (0, zod_1.string)().optional(),
|
|
22
|
+
metadata: (0, zod_1.record)((0, zod_1.string)(), zod_1.z.unknown()).optional(),
|
|
23
|
+
});
|
|
@@ -290,6 +290,7 @@ export declare const internalNotification: z.ZodObject<{
|
|
|
290
290
|
edited: z.ZodOptional<z.ZodBoolean>;
|
|
291
291
|
category: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"watched">, z.ZodLiteral<"attended">, z.ZodLiteral<"highlights">, z.ZodLiteral<"listened">, z.ZodLiteral<"partiallyWatched">]>>;
|
|
292
292
|
userLocation: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
293
|
+
locationVerified: z.ZodOptional<z.ZodBoolean>;
|
|
293
294
|
pick: z.ZodOptional<z.ZodObject<{
|
|
294
295
|
id: z.ZodString;
|
|
295
296
|
team: z.ZodObject<{
|
|
@@ -521,6 +522,7 @@ export declare const internalNotification: z.ZodObject<{
|
|
|
521
522
|
edited?: boolean | undefined;
|
|
522
523
|
category?: "watched" | "attended" | "highlights" | "listened" | "partiallyWatched" | undefined;
|
|
523
524
|
userLocation?: string | null | undefined;
|
|
525
|
+
locationVerified?: boolean | undefined;
|
|
524
526
|
events?: {
|
|
525
527
|
id: string;
|
|
526
528
|
eventType: "streak" | "achievement" | "rating_milestone";
|
|
@@ -630,6 +632,7 @@ export declare const internalNotification: z.ZodObject<{
|
|
|
630
632
|
edited?: boolean | undefined;
|
|
631
633
|
category?: "watched" | "attended" | "highlights" | "listened" | "partiallyWatched" | undefined;
|
|
632
634
|
userLocation?: string | null | undefined;
|
|
635
|
+
locationVerified?: boolean | undefined;
|
|
633
636
|
events?: {
|
|
634
637
|
id: string;
|
|
635
638
|
eventType: "streak" | "achievement" | "rating_milestone";
|
|
@@ -756,6 +759,7 @@ export declare const internalNotification: z.ZodObject<{
|
|
|
756
759
|
edited?: boolean | undefined;
|
|
757
760
|
category?: "watched" | "attended" | "highlights" | "listened" | "partiallyWatched" | undefined;
|
|
758
761
|
userLocation?: string | null | undefined;
|
|
762
|
+
locationVerified?: boolean | undefined;
|
|
759
763
|
events?: {
|
|
760
764
|
id: string;
|
|
761
765
|
eventType: "streak" | "achievement" | "rating_milestone";
|
|
@@ -883,6 +887,7 @@ export declare const internalNotification: z.ZodObject<{
|
|
|
883
887
|
edited?: boolean | undefined;
|
|
884
888
|
category?: "watched" | "attended" | "highlights" | "listened" | "partiallyWatched" | undefined;
|
|
885
889
|
userLocation?: string | null | undefined;
|
|
890
|
+
locationVerified?: boolean | undefined;
|
|
886
891
|
events?: {
|
|
887
892
|
id: string;
|
|
888
893
|
eventType: "streak" | "achievement" | "rating_milestone";
|
package/dist/schemas/rating.d.ts
CHANGED
|
@@ -394,6 +394,7 @@ export declare const ratingSchema: import("zod").ZodObject<{
|
|
|
394
394
|
edited: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
395
395
|
category: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodLiteral<"watched">, import("zod").ZodLiteral<"attended">, import("zod").ZodLiteral<"highlights">, import("zod").ZodLiteral<"listened">, import("zod").ZodLiteral<"partiallyWatched">]>>;
|
|
396
396
|
userLocation: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
397
|
+
locationVerified: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
397
398
|
pick: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
398
399
|
id: import("zod").ZodString;
|
|
399
400
|
team: import("zod").ZodObject<{
|
|
@@ -625,6 +626,7 @@ export declare const ratingSchema: import("zod").ZodObject<{
|
|
|
625
626
|
edited?: boolean | undefined;
|
|
626
627
|
category?: "watched" | "attended" | "highlights" | "listened" | "partiallyWatched" | undefined;
|
|
627
628
|
userLocation?: string | null | undefined;
|
|
629
|
+
locationVerified?: boolean | undefined;
|
|
628
630
|
events?: {
|
|
629
631
|
id: string;
|
|
630
632
|
eventType: "streak" | "achievement" | "rating_milestone";
|
|
@@ -734,6 +736,7 @@ export declare const ratingSchema: import("zod").ZodObject<{
|
|
|
734
736
|
edited?: boolean | undefined;
|
|
735
737
|
category?: "watched" | "attended" | "highlights" | "listened" | "partiallyWatched" | undefined;
|
|
736
738
|
userLocation?: string | null | undefined;
|
|
739
|
+
locationVerified?: boolean | undefined;
|
|
737
740
|
events?: {
|
|
738
741
|
id: string;
|
|
739
742
|
eventType: "streak" | "achievement" | "rating_milestone";
|
|
@@ -1063,6 +1066,7 @@ export declare const createRatingSchema: import("zod").ZodObject<{
|
|
|
1063
1066
|
weight: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1064
1067
|
fanCategory: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodLiteral<"winningTeam">, import("zod").ZodLiteral<"losingTeam">, import("zod").ZodLiteral<"neutral">, import("zod").ZodLiteral<"homeTeam">, import("zod").ZodLiteral<"awayTeam">]>>;
|
|
1065
1068
|
edited: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
1069
|
+
locationVerified: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
1066
1070
|
events: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
1067
1071
|
id: import("zod").ZodString;
|
|
1068
1072
|
eventType: import("zod").ZodUnion<[import("zod").ZodLiteral<"achievement">, import("zod").ZodLiteral<"streak">, import("zod").ZodLiteral<"rating_milestone">]>;
|
|
@@ -1317,6 +1321,7 @@ export declare const createRatingSchema: import("zod").ZodObject<{
|
|
|
1317
1321
|
edited?: boolean | undefined;
|
|
1318
1322
|
category?: "" | "watched" | "attended" | "highlights" | "listened" | "partiallyWatched" | null | undefined;
|
|
1319
1323
|
userLocation?: string | null | undefined;
|
|
1324
|
+
locationVerified?: boolean | undefined;
|
|
1320
1325
|
events?: {
|
|
1321
1326
|
id: string;
|
|
1322
1327
|
eventType: "streak" | "achievement" | "rating_milestone";
|
|
@@ -1381,6 +1386,7 @@ export declare const createRatingSchema: import("zod").ZodObject<{
|
|
|
1381
1386
|
edited?: boolean | undefined;
|
|
1382
1387
|
category?: "" | "watched" | "attended" | "highlights" | "listened" | "partiallyWatched" | null | undefined;
|
|
1383
1388
|
userLocation?: string | null | undefined;
|
|
1389
|
+
locationVerified?: boolean | undefined;
|
|
1384
1390
|
events?: {
|
|
1385
1391
|
id: string;
|
|
1386
1392
|
eventType: "streak" | "achievement" | "rating_milestone";
|
package/dist/schemas/rating.js
CHANGED
|
@@ -80,6 +80,7 @@ exports.ratingSchema = (0, zod_1.object)({
|
|
|
80
80
|
edited: (0, zod_1.boolean)().optional(),
|
|
81
81
|
category: exports.ratingCategorySchema.optional(),
|
|
82
82
|
userLocation: (0, zod_1.string)().optional().nullable(),
|
|
83
|
+
locationVerified: (0, zod_1.boolean)().optional(),
|
|
83
84
|
pick: exports.ratingMiniPickSchema.optional(),
|
|
84
85
|
events: (0, zod_1.array)(exports.ratingMiniEventSchema).optional(),
|
|
85
86
|
deleted: (0, zod_1.boolean)().optional(),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export * from "./achievementUnlockSource";
|
|
2
3
|
export declare const userEventSchema: z.ZodObject<{
|
|
3
4
|
id: z.ZodString;
|
|
4
5
|
userId: z.ZodString;
|
|
@@ -61,6 +62,27 @@ export declare const userEventSchema: z.ZodObject<{
|
|
|
61
62
|
}>;
|
|
62
63
|
createdAt: z.ZodNumber;
|
|
63
64
|
likesCount: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
/** Canonical reference to what unlocked this event (achievement details). */
|
|
66
|
+
unlockSource: z.ZodOptional<z.ZodObject<{
|
|
67
|
+
type: z.ZodUnion<[z.ZodLiteral<"rating">, z.ZodLiteral<"stadium_rating">, z.ZodLiteral<"experience_rating">, z.ZodLiteral<"list">, z.ZodLiteral<"pick">, z.ZodLiteral<"player_vote">, z.ZodLiteral<"comment">, z.ZodLiteral<"profile">, z.ZodLiteral<"follower">, z.ZodLiteral<"games">, z.ZodLiteral<"none">]>;
|
|
68
|
+
id: z.ZodOptional<z.ZodString>;
|
|
69
|
+
gameId: z.ZodOptional<z.ZodString>;
|
|
70
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
type: "none" | "pick" | "rating" | "comment" | "games" | "profile" | "list" | "stadium_rating" | "experience_rating" | "player_vote" | "follower";
|
|
73
|
+
id?: string | undefined;
|
|
74
|
+
metadata?: Record<string, unknown> | undefined;
|
|
75
|
+
gameId?: string | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
type: "none" | "pick" | "rating" | "comment" | "games" | "profile" | "list" | "stadium_rating" | "experience_rating" | "player_vote" | "follower";
|
|
78
|
+
id?: string | undefined;
|
|
79
|
+
metadata?: Record<string, unknown> | undefined;
|
|
80
|
+
gameId?: string | undefined;
|
|
81
|
+
}>>;
|
|
82
|
+
/** @deprecated Prefer unlockSource. Kept for backward compatibility. */
|
|
83
|
+
ratingId: z.ZodOptional<z.ZodString>;
|
|
84
|
+
/** @deprecated Prefer unlockSource. Kept for backward compatibility. */
|
|
85
|
+
ratingType: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"rating">, z.ZodLiteral<"experience">, z.ZodLiteral<"stadium">]>>;
|
|
64
86
|
}, "strip", z.ZodTypeAny, {
|
|
65
87
|
id: string;
|
|
66
88
|
user: {
|
|
@@ -86,7 +108,15 @@ export declare const userEventSchema: z.ZodObject<{
|
|
|
86
108
|
} | {
|
|
87
109
|
ratingCount: number;
|
|
88
110
|
};
|
|
111
|
+
ratingId?: string | undefined;
|
|
89
112
|
likesCount?: number | undefined;
|
|
113
|
+
unlockSource?: {
|
|
114
|
+
type: "none" | "pick" | "rating" | "comment" | "games" | "profile" | "list" | "stadium_rating" | "experience_rating" | "player_vote" | "follower";
|
|
115
|
+
id?: string | undefined;
|
|
116
|
+
metadata?: Record<string, unknown> | undefined;
|
|
117
|
+
gameId?: string | undefined;
|
|
118
|
+
} | undefined;
|
|
119
|
+
ratingType?: "rating" | "stadium" | "experience" | undefined;
|
|
90
120
|
}, {
|
|
91
121
|
id: string;
|
|
92
122
|
user: {
|
|
@@ -112,7 +142,15 @@ export declare const userEventSchema: z.ZodObject<{
|
|
|
112
142
|
} | {
|
|
113
143
|
ratingCount: number;
|
|
114
144
|
};
|
|
145
|
+
ratingId?: string | undefined;
|
|
115
146
|
likesCount?: number | undefined;
|
|
147
|
+
unlockSource?: {
|
|
148
|
+
type: "none" | "pick" | "rating" | "comment" | "games" | "profile" | "list" | "stadium_rating" | "experience_rating" | "player_vote" | "follower";
|
|
149
|
+
id?: string | undefined;
|
|
150
|
+
metadata?: Record<string, unknown> | undefined;
|
|
151
|
+
gameId?: string | undefined;
|
|
152
|
+
} | undefined;
|
|
153
|
+
ratingType?: "rating" | "stadium" | "experience" | undefined;
|
|
116
154
|
}>;
|
|
117
155
|
export declare const userEventCommentSchema: z.ZodObject<{
|
|
118
156
|
id: z.ZodString;
|
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.userEventCommentLikeSchema = exports.userEventCommentSchema = exports.userEventSchema = void 0;
|
|
4
18
|
const zod_1 = require("zod");
|
|
5
19
|
const user_1 = require("./user");
|
|
20
|
+
const achievementUnlockSource_1 = require("./achievementUnlockSource");
|
|
21
|
+
__exportStar(require("./achievementUnlockSource"), exports);
|
|
6
22
|
exports.userEventSchema = zod_1.z.object({
|
|
7
23
|
id: zod_1.z.string(),
|
|
8
24
|
userId: zod_1.z.string(),
|
|
@@ -39,6 +55,18 @@ exports.userEventSchema = zod_1.z.object({
|
|
|
39
55
|
}),
|
|
40
56
|
createdAt: zod_1.z.number(),
|
|
41
57
|
likesCount: zod_1.z.number().optional(),
|
|
58
|
+
/** Canonical reference to what unlocked this event (achievement details). */
|
|
59
|
+
unlockSource: achievementUnlockSource_1.achievementUnlockSourceSchema.optional(),
|
|
60
|
+
/** @deprecated Prefer unlockSource. Kept for backward compatibility. */
|
|
61
|
+
ratingId: zod_1.z.string().optional(),
|
|
62
|
+
/** @deprecated Prefer unlockSource. Kept for backward compatibility. */
|
|
63
|
+
ratingType: zod_1.z
|
|
64
|
+
.union([
|
|
65
|
+
zod_1.z.literal("rating"),
|
|
66
|
+
zod_1.z.literal("experience"),
|
|
67
|
+
zod_1.z.literal("stadium"),
|
|
68
|
+
])
|
|
69
|
+
.optional(),
|
|
42
70
|
});
|
|
43
71
|
exports.userEventCommentSchema = zod_1.z.object({
|
|
44
72
|
id: zod_1.z.string(),
|