rategame-shared 1.1.474 → 1.1.476
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/models/miniLeague.d.ts +2 -1
- package/dist/schemas/miniLeague.d.ts +378 -17
- package/dist/schemas/miniLeague.js +121 -5
- 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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { miniLeagueSchema, miniLeagueMemberSchema, miniLeagueInvitationSchema, createMiniLeagueDtoSchema, updateMiniLeagueDtoSchema, createMiniLeagueInvitationDtoSchema, miniLeagueJoinResponseDtoSchema, miniLeagueInvitationActionResponseDtoSchema, miniLeagueListResponseDtoSchema, miniLeagueMembersResponseDtoSchema, miniLeagueInvitationsResponseDtoSchema, miniLeagueLeaderboardResponseDtoSchema, miniLeagueUpcomingGamesResponseDtoSchema, miniLeagueVisibilitySchema, miniLeagueStatusSchema, miniLeagueMemberRoleSchema, miniLeagueInvitationStatusSchema } from "../schemas/miniLeague";
|
|
2
|
+
import { miniLeagueSchema, miniLeagueMemberSchema, miniLeagueInvitationSchema, createMiniLeagueDtoSchema, updateMiniLeagueDtoSchema, createMiniLeagueInvitationDtoSchema, miniLeagueJoinResponseDtoSchema, miniLeagueInvitationActionResponseDtoSchema, miniLeagueListResponseDtoSchema, miniLeagueMembersResponseDtoSchema, miniLeagueInvitationsResponseDtoSchema, miniLeagueLeaderboardResponseDtoSchema, miniLeagueUpcomingGamesResponseDtoSchema, miniLeagueRecapResponseDtoSchema, miniLeagueVisibilitySchema, miniLeagueStatusSchema, miniLeagueMemberRoleSchema, miniLeagueInvitationStatusSchema } from "../schemas/miniLeague";
|
|
3
3
|
export type MiniLeague = z.infer<typeof miniLeagueSchema>;
|
|
4
4
|
export type MiniLeagueMember = z.infer<typeof miniLeagueMemberSchema>;
|
|
5
5
|
export type MiniLeagueInvitation = z.infer<typeof miniLeagueInvitationSchema>;
|
|
@@ -13,6 +13,7 @@ export type MiniLeagueMembersResponseDto = z.infer<typeof miniLeagueMembersRespo
|
|
|
13
13
|
export type MiniLeagueInvitationsResponseDto = z.infer<typeof miniLeagueInvitationsResponseDtoSchema>;
|
|
14
14
|
export type MiniLeagueLeaderboardResponseDto = z.infer<typeof miniLeagueLeaderboardResponseDtoSchema>;
|
|
15
15
|
export type MiniLeagueUpcomingGamesResponseDto = z.infer<typeof miniLeagueUpcomingGamesResponseDtoSchema>;
|
|
16
|
+
export type MiniLeagueRecapResponseDto = z.infer<typeof miniLeagueRecapResponseDtoSchema>;
|
|
16
17
|
export type MiniLeagueVisibility = z.infer<typeof miniLeagueVisibilitySchema>;
|
|
17
18
|
export type MiniLeagueStatus = z.infer<typeof miniLeagueStatusSchema>;
|
|
18
19
|
export type MiniLeagueMemberRole = z.infer<typeof miniLeagueMemberRoleSchema>;
|
|
@@ -772,6 +772,7 @@ export declare const miniLeagueSchema: z.ZodObject<{
|
|
|
772
772
|
token: string;
|
|
773
773
|
usedAt: number;
|
|
774
774
|
}>>;
|
|
775
|
+
/** 1-based month index within the league window. */
|
|
775
776
|
askedForPushNotifications: z.ZodBoolean;
|
|
776
777
|
acceptedPushNotifications: z.ZodBoolean;
|
|
777
778
|
badge: z.ZodOptional<z.ZodString>;
|
|
@@ -808,7 +809,7 @@ export declare const miniLeagueSchema: z.ZodObject<{
|
|
|
808
809
|
allGames: z.ZodOptional<z.ZodBoolean>;
|
|
809
810
|
favoriteLeagues: z.ZodOptional<z.ZodBoolean>;
|
|
810
811
|
favoriteTeams: z.ZodOptional<z.ZodBoolean>;
|
|
811
|
-
lastWeekScoreLeaderboard: z.ZodOptional<z.ZodBoolean>;
|
|
812
|
+
lastWeekScoreLeaderboard: z.ZodOptional<z.ZodBoolean>; /** Month buckets — empty when the league does not span 2+ calendar months. */
|
|
812
813
|
leaderboardChanges: z.ZodOptional<z.ZodBoolean>;
|
|
813
814
|
chatReplies: z.ZodOptional<z.ZodBoolean>;
|
|
814
815
|
repliesToRatings: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1267,13 +1268,23 @@ export declare const miniLeagueSchema: z.ZodObject<{
|
|
|
1267
1268
|
avatarUrl?: string | null | undefined;
|
|
1268
1269
|
badge?: string | undefined;
|
|
1269
1270
|
}>;
|
|
1271
|
+
/**
|
|
1272
|
+
* All platform leagues in this challenge (1–2).
|
|
1273
|
+
* Older docs may omit this; fall back to `[platformLeague]`.
|
|
1274
|
+
*/
|
|
1275
|
+
platformLeagues: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"nba">, z.ZodLiteral<"ncaa">, z.ZodLiteral<"nfl">, z.ZodLiteral<"nhl">, z.ZodLiteral<"mlb">, z.ZodLiteral<"cbb">, z.ZodLiteral<"cfb">, z.ZodLiteral<"epl">, z.ZodLiteral<"mls">, z.ZodLiteral<"wnba">, z.ZodLiteral<"cwc">, z.ZodLiteral<"fifa">, z.ZodLiteral<"laliga">, z.ZodLiteral<"seriea">, z.ZodLiteral<"bundesliga">, z.ZodLiteral<"ligue1">, z.ZodLiteral<"ucl">, z.ZodUnion<[z.ZodLiteral<"global">, z.ZodString]>]>, "many">>;
|
|
1276
|
+
/** Primary / denormalized first league (always set; used by legacy queries). */
|
|
1270
1277
|
platformLeague: z.ZodUnion<[z.ZodLiteral<"nba">, z.ZodLiteral<"ncaa">, z.ZodLiteral<"nfl">, z.ZodLiteral<"nhl">, z.ZodLiteral<"mlb">, z.ZodLiteral<"cbb">, z.ZodLiteral<"cfb">, z.ZodLiteral<"epl">, z.ZodLiteral<"mls">, z.ZodLiteral<"wnba">, z.ZodLiteral<"cwc">, z.ZodLiteral<"fifa">, z.ZodLiteral<"laliga">, z.ZodLiteral<"seriea">, z.ZodLiteral<"bundesliga">, z.ZodLiteral<"ligue1">, z.ZodLiteral<"ucl">, z.ZodUnion<[z.ZodLiteral<"global">, z.ZodString]>]>;
|
|
1271
1278
|
sport: z.ZodUnion<[z.ZodLiteral<"basketball">, z.ZodLiteral<"football">, z.ZodLiteral<"soccer">, z.ZodLiteral<"baseball">, z.ZodLiteral<"hockey">]>;
|
|
1272
1279
|
seasonStart: z.ZodNumber;
|
|
1273
1280
|
seasonEnd: z.ZodNumber;
|
|
1274
1281
|
startAt: z.ZodNumber;
|
|
1275
1282
|
endAt: z.ZodNumber;
|
|
1276
|
-
/**
|
|
1283
|
+
/**
|
|
1284
|
+
* When true, league ends when every selected platform season is inactive
|
|
1285
|
+
* (or when calendar `endAt` passes). For multi-sport, `endAt` / `seasonEnd`
|
|
1286
|
+
* use the latest season end among selected sports.
|
|
1287
|
+
*/
|
|
1277
1288
|
endsWithSeason: z.ZodOptional<z.ZodBoolean>;
|
|
1278
1289
|
visibility: z.ZodUnion<[z.ZodLiteral<"public">, z.ZodLiteral<"private">]>;
|
|
1279
1290
|
status: z.ZodUnion<[z.ZodLiteral<"active">, z.ZodLiteral<"ended">]>;
|
|
@@ -1305,6 +1316,7 @@ export declare const miniLeagueSchema: z.ZodObject<{
|
|
|
1305
1316
|
endAt: number;
|
|
1306
1317
|
memberCount: number;
|
|
1307
1318
|
description?: string | undefined;
|
|
1319
|
+
platformLeagues?: string[] | undefined;
|
|
1308
1320
|
endsWithSeason?: boolean | undefined;
|
|
1309
1321
|
winnerIds?: string[] | undefined;
|
|
1310
1322
|
}, {
|
|
@@ -1330,6 +1342,7 @@ export declare const miniLeagueSchema: z.ZodObject<{
|
|
|
1330
1342
|
endAt: number;
|
|
1331
1343
|
memberCount: number;
|
|
1332
1344
|
description?: string | undefined;
|
|
1345
|
+
platformLeagues?: string[] | undefined;
|
|
1333
1346
|
endsWithSeason?: boolean | undefined;
|
|
1334
1347
|
winnerIds?: string[] | undefined;
|
|
1335
1348
|
}>;
|
|
@@ -2095,6 +2108,7 @@ export declare const miniLeagueMemberSchema: z.ZodObject<{
|
|
|
2095
2108
|
token: string;
|
|
2096
2109
|
usedAt: number;
|
|
2097
2110
|
}>>;
|
|
2111
|
+
/** 1-based month index within the league window. */
|
|
2098
2112
|
askedForPushNotifications: z.ZodBoolean;
|
|
2099
2113
|
acceptedPushNotifications: z.ZodBoolean;
|
|
2100
2114
|
badge: z.ZodOptional<z.ZodString>;
|
|
@@ -2131,7 +2145,7 @@ export declare const miniLeagueMemberSchema: z.ZodObject<{
|
|
|
2131
2145
|
allGames: z.ZodOptional<z.ZodBoolean>;
|
|
2132
2146
|
favoriteLeagues: z.ZodOptional<z.ZodBoolean>;
|
|
2133
2147
|
favoriteTeams: z.ZodOptional<z.ZodBoolean>;
|
|
2134
|
-
lastWeekScoreLeaderboard: z.ZodOptional<z.ZodBoolean>;
|
|
2148
|
+
lastWeekScoreLeaderboard: z.ZodOptional<z.ZodBoolean>; /** Month buckets — empty when the league does not span 2+ calendar months. */
|
|
2135
2149
|
leaderboardChanges: z.ZodOptional<z.ZodBoolean>;
|
|
2136
2150
|
chatReplies: z.ZodOptional<z.ZodBoolean>;
|
|
2137
2151
|
repliesToRatings: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -2623,6 +2637,7 @@ export declare const miniLeagueInvitationSchema: z.ZodObject<{
|
|
|
2623
2637
|
leagueId: z.ZodString;
|
|
2624
2638
|
leagueName: z.ZodString;
|
|
2625
2639
|
platformLeague: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"nba">, z.ZodLiteral<"ncaa">, z.ZodLiteral<"nfl">, z.ZodLiteral<"nhl">, z.ZodLiteral<"mlb">, z.ZodLiteral<"cbb">, z.ZodLiteral<"cfb">, z.ZodLiteral<"epl">, z.ZodLiteral<"mls">, z.ZodLiteral<"wnba">, z.ZodLiteral<"cwc">, z.ZodLiteral<"fifa">, z.ZodLiteral<"laliga">, z.ZodLiteral<"seriea">, z.ZodLiteral<"bundesliga">, z.ZodLiteral<"ligue1">, z.ZodLiteral<"ucl">, z.ZodUnion<[z.ZodLiteral<"global">, z.ZodString]>]>>;
|
|
2640
|
+
platformLeagues: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"nba">, z.ZodLiteral<"ncaa">, z.ZodLiteral<"nfl">, z.ZodLiteral<"nhl">, z.ZodLiteral<"mlb">, z.ZodLiteral<"cbb">, z.ZodLiteral<"cfb">, z.ZodLiteral<"epl">, z.ZodLiteral<"mls">, z.ZodLiteral<"wnba">, z.ZodLiteral<"cwc">, z.ZodLiteral<"fifa">, z.ZodLiteral<"laliga">, z.ZodLiteral<"seriea">, z.ZodLiteral<"bundesliga">, z.ZodLiteral<"ligue1">, z.ZodLiteral<"ucl">, z.ZodUnion<[z.ZodLiteral<"global">, z.ZodString]>]>, "many">>;
|
|
2626
2641
|
memberCount: z.ZodOptional<z.ZodNumber>;
|
|
2627
2642
|
endAt: z.ZodOptional<z.ZodNumber>;
|
|
2628
2643
|
endsWithSeason: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -3387,6 +3402,7 @@ export declare const miniLeagueInvitationSchema: z.ZodObject<{
|
|
|
3387
3402
|
token: string;
|
|
3388
3403
|
usedAt: number;
|
|
3389
3404
|
}>>;
|
|
3405
|
+
/** 1-based month index within the league window. */
|
|
3390
3406
|
askedForPushNotifications: z.ZodBoolean;
|
|
3391
3407
|
acceptedPushNotifications: z.ZodBoolean;
|
|
3392
3408
|
badge: z.ZodOptional<z.ZodString>;
|
|
@@ -3423,7 +3439,7 @@ export declare const miniLeagueInvitationSchema: z.ZodObject<{
|
|
|
3423
3439
|
allGames: z.ZodOptional<z.ZodBoolean>;
|
|
3424
3440
|
favoriteLeagues: z.ZodOptional<z.ZodBoolean>;
|
|
3425
3441
|
favoriteTeams: z.ZodOptional<z.ZodBoolean>;
|
|
3426
|
-
lastWeekScoreLeaderboard: z.ZodOptional<z.ZodBoolean>;
|
|
3442
|
+
lastWeekScoreLeaderboard: z.ZodOptional<z.ZodBoolean>; /** Month buckets — empty when the league does not span 2+ calendar months. */
|
|
3427
3443
|
leaderboardChanges: z.ZodOptional<z.ZodBoolean>;
|
|
3428
3444
|
chatReplies: z.ZodOptional<z.ZodBoolean>;
|
|
3429
3445
|
repliesToRatings: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -4643,6 +4659,7 @@ export declare const miniLeagueInvitationSchema: z.ZodObject<{
|
|
|
4643
4659
|
token: string;
|
|
4644
4660
|
usedAt: number;
|
|
4645
4661
|
}>>;
|
|
4662
|
+
/** 1-based month index within the league window. */
|
|
4646
4663
|
askedForPushNotifications: z.ZodBoolean;
|
|
4647
4664
|
acceptedPushNotifications: z.ZodBoolean;
|
|
4648
4665
|
badge: z.ZodOptional<z.ZodString>;
|
|
@@ -4679,7 +4696,7 @@ export declare const miniLeagueInvitationSchema: z.ZodObject<{
|
|
|
4679
4696
|
allGames: z.ZodOptional<z.ZodBoolean>;
|
|
4680
4697
|
favoriteLeagues: z.ZodOptional<z.ZodBoolean>;
|
|
4681
4698
|
favoriteTeams: z.ZodOptional<z.ZodBoolean>;
|
|
4682
|
-
lastWeekScoreLeaderboard: z.ZodOptional<z.ZodBoolean>;
|
|
4699
|
+
lastWeekScoreLeaderboard: z.ZodOptional<z.ZodBoolean>; /** Month buckets — empty when the league does not span 2+ calendar months. */
|
|
4683
4700
|
leaderboardChanges: z.ZodOptional<z.ZodBoolean>;
|
|
4684
4701
|
chatReplies: z.ZodOptional<z.ZodBoolean>;
|
|
4685
4702
|
repliesToRatings: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -5158,6 +5175,7 @@ export declare const miniLeagueInvitationSchema: z.ZodObject<{
|
|
|
5158
5175
|
badge?: string | undefined;
|
|
5159
5176
|
};
|
|
5160
5177
|
inviteeId: string;
|
|
5178
|
+
platformLeagues?: string[] | undefined;
|
|
5161
5179
|
platformLeague?: string | undefined;
|
|
5162
5180
|
endAt?: number | undefined;
|
|
5163
5181
|
endsWithSeason?: boolean | undefined;
|
|
@@ -5186,6 +5204,7 @@ export declare const miniLeagueInvitationSchema: z.ZodObject<{
|
|
|
5186
5204
|
badge?: string | undefined;
|
|
5187
5205
|
};
|
|
5188
5206
|
inviteeId: string;
|
|
5207
|
+
platformLeagues?: string[] | undefined;
|
|
5189
5208
|
platformLeague?: string | undefined;
|
|
5190
5209
|
endAt?: number | undefined;
|
|
5191
5210
|
endsWithSeason?: boolean | undefined;
|
|
@@ -5199,11 +5218,14 @@ export declare const miniLeagueInvitationSchema: z.ZodObject<{
|
|
|
5199
5218
|
} | undefined;
|
|
5200
5219
|
expiresAt?: number | undefined;
|
|
5201
5220
|
}>;
|
|
5202
|
-
export declare const createMiniLeagueDtoSchema: z.ZodObject<{
|
|
5221
|
+
export declare const createMiniLeagueDtoSchema: z.ZodEffects<z.ZodObject<{
|
|
5203
5222
|
name: z.ZodString;
|
|
5204
5223
|
description: z.ZodOptional<z.ZodString>;
|
|
5205
|
-
|
|
5206
|
-
|
|
5224
|
+
/** Preferred: one or more platform leagues (max 2). */
|
|
5225
|
+
platformLeagues: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"nba">, z.ZodLiteral<"ncaa">, z.ZodLiteral<"nfl">, z.ZodLiteral<"nhl">, z.ZodLiteral<"mlb">, z.ZodLiteral<"cbb">, z.ZodLiteral<"cfb">, z.ZodLiteral<"epl">, z.ZodLiteral<"mls">, z.ZodLiteral<"wnba">, z.ZodLiteral<"cwc">, z.ZodLiteral<"fifa">, z.ZodLiteral<"laliga">, z.ZodLiteral<"seriea">, z.ZodLiteral<"bundesliga">, z.ZodLiteral<"ligue1">, z.ZodLiteral<"ucl">, z.ZodUnion<[z.ZodLiteral<"global">, z.ZodString]>]>, "many">>;
|
|
5226
|
+
/** Legacy single-league create. */
|
|
5227
|
+
platformLeague: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"nba">, z.ZodLiteral<"ncaa">, z.ZodLiteral<"nfl">, z.ZodLiteral<"nhl">, z.ZodLiteral<"mlb">, z.ZodLiteral<"cbb">, z.ZodLiteral<"cfb">, z.ZodLiteral<"epl">, z.ZodLiteral<"mls">, z.ZodLiteral<"wnba">, z.ZodLiteral<"cwc">, z.ZodLiteral<"fifa">, z.ZodLiteral<"laliga">, z.ZodLiteral<"seriea">, z.ZodLiteral<"bundesliga">, z.ZodLiteral<"ligue1">, z.ZodLiteral<"ucl">, z.ZodUnion<[z.ZodLiteral<"global">, z.ZodString]>]>>;
|
|
5228
|
+
sport: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"basketball">, z.ZodLiteral<"football">, z.ZodLiteral<"soccer">, z.ZodLiteral<"baseball">, z.ZodLiteral<"hockey">]>>;
|
|
5207
5229
|
visibility: z.ZodUnion<[z.ZodLiteral<"public">, z.ZodLiteral<"private">]>;
|
|
5208
5230
|
startAt: z.ZodOptional<z.ZodNumber>;
|
|
5209
5231
|
endAt: z.ZodOptional<z.ZodNumber>;
|
|
@@ -5212,18 +5234,40 @@ export declare const createMiniLeagueDtoSchema: z.ZodObject<{
|
|
|
5212
5234
|
}, "strip", z.ZodTypeAny, {
|
|
5213
5235
|
name: string;
|
|
5214
5236
|
visibility: "private" | "public";
|
|
5215
|
-
sport: "basketball" | "football" | "soccer" | "baseball" | "hockey";
|
|
5216
|
-
platformLeague: string;
|
|
5217
5237
|
description?: string | undefined;
|
|
5238
|
+
sport?: "basketball" | "football" | "soccer" | "baseball" | "hockey" | undefined;
|
|
5239
|
+
platformLeagues?: string[] | undefined;
|
|
5240
|
+
platformLeague?: string | undefined;
|
|
5241
|
+
startAt?: number | undefined;
|
|
5242
|
+
endAt?: number | undefined;
|
|
5243
|
+
endsWithSeason?: boolean | undefined;
|
|
5244
|
+
}, {
|
|
5245
|
+
name: string;
|
|
5246
|
+
visibility: "private" | "public";
|
|
5247
|
+
description?: string | undefined;
|
|
5248
|
+
sport?: "basketball" | "football" | "soccer" | "baseball" | "hockey" | undefined;
|
|
5249
|
+
platformLeagues?: string[] | undefined;
|
|
5250
|
+
platformLeague?: string | undefined;
|
|
5251
|
+
startAt?: number | undefined;
|
|
5252
|
+
endAt?: number | undefined;
|
|
5253
|
+
endsWithSeason?: boolean | undefined;
|
|
5254
|
+
}>, {
|
|
5255
|
+
name: string;
|
|
5256
|
+
visibility: "private" | "public";
|
|
5257
|
+
description?: string | undefined;
|
|
5258
|
+
sport?: "basketball" | "football" | "soccer" | "baseball" | "hockey" | undefined;
|
|
5259
|
+
platformLeagues?: string[] | undefined;
|
|
5260
|
+
platformLeague?: string | undefined;
|
|
5218
5261
|
startAt?: number | undefined;
|
|
5219
5262
|
endAt?: number | undefined;
|
|
5220
5263
|
endsWithSeason?: boolean | undefined;
|
|
5221
5264
|
}, {
|
|
5222
5265
|
name: string;
|
|
5223
5266
|
visibility: "private" | "public";
|
|
5224
|
-
sport: "basketball" | "football" | "soccer" | "baseball" | "hockey";
|
|
5225
|
-
platformLeague: string;
|
|
5226
5267
|
description?: string | undefined;
|
|
5268
|
+
sport?: "basketball" | "football" | "soccer" | "baseball" | "hockey" | undefined;
|
|
5269
|
+
platformLeagues?: string[] | undefined;
|
|
5270
|
+
platformLeague?: string | undefined;
|
|
5227
5271
|
startAt?: number | undefined;
|
|
5228
5272
|
endAt?: number | undefined;
|
|
5229
5273
|
endsWithSeason?: boolean | undefined;
|
|
@@ -6037,6 +6081,7 @@ export declare const miniLeagueListResponseDtoSchema: z.ZodObject<{
|
|
|
6037
6081
|
token: string;
|
|
6038
6082
|
usedAt: number;
|
|
6039
6083
|
}>>;
|
|
6084
|
+
/** 1-based month index within the league window. */
|
|
6040
6085
|
askedForPushNotifications: z.ZodBoolean;
|
|
6041
6086
|
acceptedPushNotifications: z.ZodBoolean;
|
|
6042
6087
|
badge: z.ZodOptional<z.ZodString>;
|
|
@@ -6073,7 +6118,7 @@ export declare const miniLeagueListResponseDtoSchema: z.ZodObject<{
|
|
|
6073
6118
|
allGames: z.ZodOptional<z.ZodBoolean>;
|
|
6074
6119
|
favoriteLeagues: z.ZodOptional<z.ZodBoolean>;
|
|
6075
6120
|
favoriteTeams: z.ZodOptional<z.ZodBoolean>;
|
|
6076
|
-
lastWeekScoreLeaderboard: z.ZodOptional<z.ZodBoolean>;
|
|
6121
|
+
lastWeekScoreLeaderboard: z.ZodOptional<z.ZodBoolean>; /** Month buckets — empty when the league does not span 2+ calendar months. */
|
|
6077
6122
|
leaderboardChanges: z.ZodOptional<z.ZodBoolean>;
|
|
6078
6123
|
chatReplies: z.ZodOptional<z.ZodBoolean>;
|
|
6079
6124
|
repliesToRatings: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -6532,13 +6577,23 @@ export declare const miniLeagueListResponseDtoSchema: z.ZodObject<{
|
|
|
6532
6577
|
avatarUrl?: string | null | undefined;
|
|
6533
6578
|
badge?: string | undefined;
|
|
6534
6579
|
}>;
|
|
6580
|
+
/**
|
|
6581
|
+
* All platform leagues in this challenge (1–2).
|
|
6582
|
+
* Older docs may omit this; fall back to `[platformLeague]`.
|
|
6583
|
+
*/
|
|
6584
|
+
platformLeagues: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"nba">, z.ZodLiteral<"ncaa">, z.ZodLiteral<"nfl">, z.ZodLiteral<"nhl">, z.ZodLiteral<"mlb">, z.ZodLiteral<"cbb">, z.ZodLiteral<"cfb">, z.ZodLiteral<"epl">, z.ZodLiteral<"mls">, z.ZodLiteral<"wnba">, z.ZodLiteral<"cwc">, z.ZodLiteral<"fifa">, z.ZodLiteral<"laliga">, z.ZodLiteral<"seriea">, z.ZodLiteral<"bundesliga">, z.ZodLiteral<"ligue1">, z.ZodLiteral<"ucl">, z.ZodUnion<[z.ZodLiteral<"global">, z.ZodString]>]>, "many">>;
|
|
6585
|
+
/** Primary / denormalized first league (always set; used by legacy queries). */
|
|
6535
6586
|
platformLeague: z.ZodUnion<[z.ZodLiteral<"nba">, z.ZodLiteral<"ncaa">, z.ZodLiteral<"nfl">, z.ZodLiteral<"nhl">, z.ZodLiteral<"mlb">, z.ZodLiteral<"cbb">, z.ZodLiteral<"cfb">, z.ZodLiteral<"epl">, z.ZodLiteral<"mls">, z.ZodLiteral<"wnba">, z.ZodLiteral<"cwc">, z.ZodLiteral<"fifa">, z.ZodLiteral<"laliga">, z.ZodLiteral<"seriea">, z.ZodLiteral<"bundesliga">, z.ZodLiteral<"ligue1">, z.ZodLiteral<"ucl">, z.ZodUnion<[z.ZodLiteral<"global">, z.ZodString]>]>;
|
|
6536
6587
|
sport: z.ZodUnion<[z.ZodLiteral<"basketball">, z.ZodLiteral<"football">, z.ZodLiteral<"soccer">, z.ZodLiteral<"baseball">, z.ZodLiteral<"hockey">]>;
|
|
6537
6588
|
seasonStart: z.ZodNumber;
|
|
6538
6589
|
seasonEnd: z.ZodNumber;
|
|
6539
6590
|
startAt: z.ZodNumber;
|
|
6540
6591
|
endAt: z.ZodNumber;
|
|
6541
|
-
/**
|
|
6592
|
+
/**
|
|
6593
|
+
* When true, league ends when every selected platform season is inactive
|
|
6594
|
+
* (or when calendar `endAt` passes). For multi-sport, `endAt` / `seasonEnd`
|
|
6595
|
+
* use the latest season end among selected sports.
|
|
6596
|
+
*/
|
|
6542
6597
|
endsWithSeason: z.ZodOptional<z.ZodBoolean>;
|
|
6543
6598
|
visibility: z.ZodUnion<[z.ZodLiteral<"public">, z.ZodLiteral<"private">]>;
|
|
6544
6599
|
status: z.ZodUnion<[z.ZodLiteral<"active">, z.ZodLiteral<"ended">]>;
|
|
@@ -6570,6 +6625,7 @@ export declare const miniLeagueListResponseDtoSchema: z.ZodObject<{
|
|
|
6570
6625
|
endAt: number;
|
|
6571
6626
|
memberCount: number;
|
|
6572
6627
|
description?: string | undefined;
|
|
6628
|
+
platformLeagues?: string[] | undefined;
|
|
6573
6629
|
endsWithSeason?: boolean | undefined;
|
|
6574
6630
|
winnerIds?: string[] | undefined;
|
|
6575
6631
|
}, {
|
|
@@ -6595,6 +6651,7 @@ export declare const miniLeagueListResponseDtoSchema: z.ZodObject<{
|
|
|
6595
6651
|
endAt: number;
|
|
6596
6652
|
memberCount: number;
|
|
6597
6653
|
description?: string | undefined;
|
|
6654
|
+
platformLeagues?: string[] | undefined;
|
|
6598
6655
|
endsWithSeason?: boolean | undefined;
|
|
6599
6656
|
winnerIds?: string[] | undefined;
|
|
6600
6657
|
}>, "many">;
|
|
@@ -6623,6 +6680,7 @@ export declare const miniLeagueListResponseDtoSchema: z.ZodObject<{
|
|
|
6623
6680
|
endAt: number;
|
|
6624
6681
|
memberCount: number;
|
|
6625
6682
|
description?: string | undefined;
|
|
6683
|
+
platformLeagues?: string[] | undefined;
|
|
6626
6684
|
endsWithSeason?: boolean | undefined;
|
|
6627
6685
|
winnerIds?: string[] | undefined;
|
|
6628
6686
|
}[];
|
|
@@ -6651,6 +6709,7 @@ export declare const miniLeagueListResponseDtoSchema: z.ZodObject<{
|
|
|
6651
6709
|
endAt: number;
|
|
6652
6710
|
memberCount: number;
|
|
6653
6711
|
description?: string | undefined;
|
|
6712
|
+
platformLeagues?: string[] | undefined;
|
|
6654
6713
|
endsWithSeason?: boolean | undefined;
|
|
6655
6714
|
winnerIds?: string[] | undefined;
|
|
6656
6715
|
}[];
|
|
@@ -7420,6 +7479,7 @@ export declare const miniLeagueMembersResponseDtoSchema: z.ZodObject<{
|
|
|
7420
7479
|
token: string;
|
|
7421
7480
|
usedAt: number;
|
|
7422
7481
|
}>>;
|
|
7482
|
+
/** 1-based month index within the league window. */
|
|
7423
7483
|
askedForPushNotifications: z.ZodBoolean;
|
|
7424
7484
|
acceptedPushNotifications: z.ZodBoolean;
|
|
7425
7485
|
badge: z.ZodOptional<z.ZodString>;
|
|
@@ -7456,7 +7516,7 @@ export declare const miniLeagueMembersResponseDtoSchema: z.ZodObject<{
|
|
|
7456
7516
|
allGames: z.ZodOptional<z.ZodBoolean>;
|
|
7457
7517
|
favoriteLeagues: z.ZodOptional<z.ZodBoolean>;
|
|
7458
7518
|
favoriteTeams: z.ZodOptional<z.ZodBoolean>;
|
|
7459
|
-
lastWeekScoreLeaderboard: z.ZodOptional<z.ZodBoolean>;
|
|
7519
|
+
lastWeekScoreLeaderboard: z.ZodOptional<z.ZodBoolean>; /** Month buckets — empty when the league does not span 2+ calendar months. */
|
|
7460
7520
|
leaderboardChanges: z.ZodOptional<z.ZodBoolean>;
|
|
7461
7521
|
chatReplies: z.ZodOptional<z.ZodBoolean>;
|
|
7462
7522
|
repliesToRatings: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -7980,6 +8040,7 @@ export declare const miniLeagueInvitationsResponseDtoSchema: z.ZodObject<{
|
|
|
7980
8040
|
leagueId: z.ZodString;
|
|
7981
8041
|
leagueName: z.ZodString;
|
|
7982
8042
|
platformLeague: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"nba">, z.ZodLiteral<"ncaa">, z.ZodLiteral<"nfl">, z.ZodLiteral<"nhl">, z.ZodLiteral<"mlb">, z.ZodLiteral<"cbb">, z.ZodLiteral<"cfb">, z.ZodLiteral<"epl">, z.ZodLiteral<"mls">, z.ZodLiteral<"wnba">, z.ZodLiteral<"cwc">, z.ZodLiteral<"fifa">, z.ZodLiteral<"laliga">, z.ZodLiteral<"seriea">, z.ZodLiteral<"bundesliga">, z.ZodLiteral<"ligue1">, z.ZodLiteral<"ucl">, z.ZodUnion<[z.ZodLiteral<"global">, z.ZodString]>]>>;
|
|
8043
|
+
platformLeagues: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"nba">, z.ZodLiteral<"ncaa">, z.ZodLiteral<"nfl">, z.ZodLiteral<"nhl">, z.ZodLiteral<"mlb">, z.ZodLiteral<"cbb">, z.ZodLiteral<"cfb">, z.ZodLiteral<"epl">, z.ZodLiteral<"mls">, z.ZodLiteral<"wnba">, z.ZodLiteral<"cwc">, z.ZodLiteral<"fifa">, z.ZodLiteral<"laliga">, z.ZodLiteral<"seriea">, z.ZodLiteral<"bundesliga">, z.ZodLiteral<"ligue1">, z.ZodLiteral<"ucl">, z.ZodUnion<[z.ZodLiteral<"global">, z.ZodString]>]>, "many">>;
|
|
7983
8044
|
memberCount: z.ZodOptional<z.ZodNumber>;
|
|
7984
8045
|
endAt: z.ZodOptional<z.ZodNumber>;
|
|
7985
8046
|
endsWithSeason: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -8744,6 +8805,7 @@ export declare const miniLeagueInvitationsResponseDtoSchema: z.ZodObject<{
|
|
|
8744
8805
|
token: string;
|
|
8745
8806
|
usedAt: number;
|
|
8746
8807
|
}>>;
|
|
8808
|
+
/** 1-based month index within the league window. */
|
|
8747
8809
|
askedForPushNotifications: z.ZodBoolean;
|
|
8748
8810
|
acceptedPushNotifications: z.ZodBoolean;
|
|
8749
8811
|
badge: z.ZodOptional<z.ZodString>;
|
|
@@ -8780,7 +8842,7 @@ export declare const miniLeagueInvitationsResponseDtoSchema: z.ZodObject<{
|
|
|
8780
8842
|
allGames: z.ZodOptional<z.ZodBoolean>;
|
|
8781
8843
|
favoriteLeagues: z.ZodOptional<z.ZodBoolean>;
|
|
8782
8844
|
favoriteTeams: z.ZodOptional<z.ZodBoolean>;
|
|
8783
|
-
lastWeekScoreLeaderboard: z.ZodOptional<z.ZodBoolean>;
|
|
8845
|
+
lastWeekScoreLeaderboard: z.ZodOptional<z.ZodBoolean>; /** Month buckets — empty when the league does not span 2+ calendar months. */
|
|
8784
8846
|
leaderboardChanges: z.ZodOptional<z.ZodBoolean>;
|
|
8785
8847
|
chatReplies: z.ZodOptional<z.ZodBoolean>;
|
|
8786
8848
|
repliesToRatings: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -10000,6 +10062,7 @@ export declare const miniLeagueInvitationsResponseDtoSchema: z.ZodObject<{
|
|
|
10000
10062
|
token: string;
|
|
10001
10063
|
usedAt: number;
|
|
10002
10064
|
}>>;
|
|
10065
|
+
/** 1-based month index within the league window. */
|
|
10003
10066
|
askedForPushNotifications: z.ZodBoolean;
|
|
10004
10067
|
acceptedPushNotifications: z.ZodBoolean;
|
|
10005
10068
|
badge: z.ZodOptional<z.ZodString>;
|
|
@@ -10036,7 +10099,7 @@ export declare const miniLeagueInvitationsResponseDtoSchema: z.ZodObject<{
|
|
|
10036
10099
|
allGames: z.ZodOptional<z.ZodBoolean>;
|
|
10037
10100
|
favoriteLeagues: z.ZodOptional<z.ZodBoolean>;
|
|
10038
10101
|
favoriteTeams: z.ZodOptional<z.ZodBoolean>;
|
|
10039
|
-
lastWeekScoreLeaderboard: z.ZodOptional<z.ZodBoolean>;
|
|
10102
|
+
lastWeekScoreLeaderboard: z.ZodOptional<z.ZodBoolean>; /** Month buckets — empty when the league does not span 2+ calendar months. */
|
|
10040
10103
|
leaderboardChanges: z.ZodOptional<z.ZodBoolean>;
|
|
10041
10104
|
chatReplies: z.ZodOptional<z.ZodBoolean>;
|
|
10042
10105
|
repliesToRatings: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -10515,6 +10578,7 @@ export declare const miniLeagueInvitationsResponseDtoSchema: z.ZodObject<{
|
|
|
10515
10578
|
badge?: string | undefined;
|
|
10516
10579
|
};
|
|
10517
10580
|
inviteeId: string;
|
|
10581
|
+
platformLeagues?: string[] | undefined;
|
|
10518
10582
|
platformLeague?: string | undefined;
|
|
10519
10583
|
endAt?: number | undefined;
|
|
10520
10584
|
endsWithSeason?: boolean | undefined;
|
|
@@ -10543,6 +10607,7 @@ export declare const miniLeagueInvitationsResponseDtoSchema: z.ZodObject<{
|
|
|
10543
10607
|
badge?: string | undefined;
|
|
10544
10608
|
};
|
|
10545
10609
|
inviteeId: string;
|
|
10610
|
+
platformLeagues?: string[] | undefined;
|
|
10546
10611
|
platformLeague?: string | undefined;
|
|
10547
10612
|
endAt?: number | undefined;
|
|
10548
10613
|
endsWithSeason?: boolean | undefined;
|
|
@@ -10573,6 +10638,7 @@ export declare const miniLeagueInvitationsResponseDtoSchema: z.ZodObject<{
|
|
|
10573
10638
|
badge?: string | undefined;
|
|
10574
10639
|
};
|
|
10575
10640
|
inviteeId: string;
|
|
10641
|
+
platformLeagues?: string[] | undefined;
|
|
10576
10642
|
platformLeague?: string | undefined;
|
|
10577
10643
|
endAt?: number | undefined;
|
|
10578
10644
|
endsWithSeason?: boolean | undefined;
|
|
@@ -10603,6 +10669,7 @@ export declare const miniLeagueInvitationsResponseDtoSchema: z.ZodObject<{
|
|
|
10603
10669
|
badge?: string | undefined;
|
|
10604
10670
|
};
|
|
10605
10671
|
inviteeId: string;
|
|
10672
|
+
platformLeagues?: string[] | undefined;
|
|
10606
10673
|
platformLeague?: string | undefined;
|
|
10607
10674
|
endAt?: number | undefined;
|
|
10608
10675
|
endsWithSeason?: boolean | undefined;
|
|
@@ -10737,3 +10804,297 @@ export declare const miniLeagueUpcomingGamesResponseDtoSchema: z.ZodObject<{
|
|
|
10737
10804
|
games: any[];
|
|
10738
10805
|
pickedGameIds: string[];
|
|
10739
10806
|
}>;
|
|
10807
|
+
export declare const miniLeagueRecapWeeklySchema: z.ZodObject<{
|
|
10808
|
+
/** 1-based week index within the league window. */
|
|
10809
|
+
week: z.ZodNumber;
|
|
10810
|
+
correct: z.ZodNumber;
|
|
10811
|
+
total: z.ZodNumber;
|
|
10812
|
+
}, "strip", z.ZodTypeAny, {
|
|
10813
|
+
total: number;
|
|
10814
|
+
week: number;
|
|
10815
|
+
correct: number;
|
|
10816
|
+
}, {
|
|
10817
|
+
total: number;
|
|
10818
|
+
week: number;
|
|
10819
|
+
correct: number;
|
|
10820
|
+
}>;
|
|
10821
|
+
export declare const miniLeagueRecapPeriodBucketSchema: z.ZodObject<{
|
|
10822
|
+
/** 1-based index within the league window for this granularity. */
|
|
10823
|
+
index: z.ZodNumber;
|
|
10824
|
+
label: z.ZodString;
|
|
10825
|
+
correct: z.ZodNumber;
|
|
10826
|
+
total: z.ZodNumber;
|
|
10827
|
+
}, "strip", z.ZodTypeAny, {
|
|
10828
|
+
index: number;
|
|
10829
|
+
total: number;
|
|
10830
|
+
label: string;
|
|
10831
|
+
correct: number;
|
|
10832
|
+
}, {
|
|
10833
|
+
index: number;
|
|
10834
|
+
total: number;
|
|
10835
|
+
label: string;
|
|
10836
|
+
correct: number;
|
|
10837
|
+
}>;
|
|
10838
|
+
export declare const miniLeagueRecapChartPeriodSchema: z.ZodUnion<[z.ZodLiteral<"day">, z.ZodLiteral<"week">, z.ZodLiteral<"month">]>;
|
|
10839
|
+
export declare const miniLeagueRecapDefiningPickSchema: z.ZodObject<{
|
|
10840
|
+
outcome: z.ZodUnion<[z.ZodLiteral<"hit">, z.ZodLiteral<"miss">]>;
|
|
10841
|
+
label: z.ZodString;
|
|
10842
|
+
detail: z.ZodString;
|
|
10843
|
+
/** 1-based day index within the league window (for chart filtering). */
|
|
10844
|
+
dayIndex: z.ZodNumber;
|
|
10845
|
+
/** 1-based week index within the league window. */
|
|
10846
|
+
weekIndex: z.ZodNumber;
|
|
10847
|
+
/** 1-based month index within the league window. */
|
|
10848
|
+
monthIndex: z.ZodNumber;
|
|
10849
|
+
}, "strip", z.ZodTypeAny, {
|
|
10850
|
+
detail: string;
|
|
10851
|
+
label: string;
|
|
10852
|
+
outcome: "hit" | "miss";
|
|
10853
|
+
dayIndex: number;
|
|
10854
|
+
weekIndex: number;
|
|
10855
|
+
monthIndex: number;
|
|
10856
|
+
}, {
|
|
10857
|
+
detail: string;
|
|
10858
|
+
label: string;
|
|
10859
|
+
outcome: "hit" | "miss";
|
|
10860
|
+
dayIndex: number;
|
|
10861
|
+
weekIndex: number;
|
|
10862
|
+
monthIndex: number;
|
|
10863
|
+
}>;
|
|
10864
|
+
export declare const miniLeagueRecapAchievementSchema: z.ZodObject<{
|
|
10865
|
+
key: z.ZodString;
|
|
10866
|
+
title: z.ZodString;
|
|
10867
|
+
detail: z.ZodString;
|
|
10868
|
+
icon: z.ZodString;
|
|
10869
|
+
}, "strip", z.ZodTypeAny, {
|
|
10870
|
+
detail: string;
|
|
10871
|
+
key: string;
|
|
10872
|
+
title: string;
|
|
10873
|
+
icon: string;
|
|
10874
|
+
}, {
|
|
10875
|
+
detail: string;
|
|
10876
|
+
key: string;
|
|
10877
|
+
title: string;
|
|
10878
|
+
icon: string;
|
|
10879
|
+
}>;
|
|
10880
|
+
/** Personal season recap for a mini-league member (Your Stats / 3c). */
|
|
10881
|
+
export declare const miniLeagueRecapResponseDtoSchema: z.ZodObject<{
|
|
10882
|
+
leagueId: z.ZodString;
|
|
10883
|
+
leagueName: z.ZodString;
|
|
10884
|
+
correct: z.ZodNumber;
|
|
10885
|
+
total: z.ZodNumber;
|
|
10886
|
+
pct: z.ZodNumber;
|
|
10887
|
+
finalRank: z.ZodNullable<z.ZodNumber>;
|
|
10888
|
+
isTied: z.ZodOptional<z.ZodBoolean>;
|
|
10889
|
+
memberCount: z.ZodNumber;
|
|
10890
|
+
bestWeek: z.ZodNullable<z.ZodObject<{
|
|
10891
|
+
week: z.ZodNumber;
|
|
10892
|
+
correct: z.ZodNumber;
|
|
10893
|
+
total: z.ZodNumber;
|
|
10894
|
+
}, "strip", z.ZodTypeAny, {
|
|
10895
|
+
total: number;
|
|
10896
|
+
week: number;
|
|
10897
|
+
correct: number;
|
|
10898
|
+
}, {
|
|
10899
|
+
total: number;
|
|
10900
|
+
week: number;
|
|
10901
|
+
correct: number;
|
|
10902
|
+
}>>;
|
|
10903
|
+
longestStreak: z.ZodNumber;
|
|
10904
|
+
/** Day buckets — empty when the span is too short (<2 days) or too long (>14). */
|
|
10905
|
+
daily: z.ZodArray<z.ZodObject<{
|
|
10906
|
+
/** 1-based index within the league window for this granularity. */
|
|
10907
|
+
index: z.ZodNumber;
|
|
10908
|
+
label: z.ZodString;
|
|
10909
|
+
correct: z.ZodNumber;
|
|
10910
|
+
total: z.ZodNumber;
|
|
10911
|
+
}, "strip", z.ZodTypeAny, {
|
|
10912
|
+
index: number;
|
|
10913
|
+
total: number;
|
|
10914
|
+
label: string;
|
|
10915
|
+
correct: number;
|
|
10916
|
+
}, {
|
|
10917
|
+
index: number;
|
|
10918
|
+
total: number;
|
|
10919
|
+
label: string;
|
|
10920
|
+
correct: number;
|
|
10921
|
+
}>, "many">;
|
|
10922
|
+
/**
|
|
10923
|
+
* Week buckets — empty when the league does not span 2+ weeks.
|
|
10924
|
+
* Kept for chart + best-week; truncated to last 12 when longer.
|
|
10925
|
+
*/
|
|
10926
|
+
weekly: z.ZodArray<z.ZodObject<{
|
|
10927
|
+
/** 1-based week index within the league window. */
|
|
10928
|
+
week: z.ZodNumber;
|
|
10929
|
+
correct: z.ZodNumber;
|
|
10930
|
+
total: z.ZodNumber;
|
|
10931
|
+
}, "strip", z.ZodTypeAny, {
|
|
10932
|
+
total: number;
|
|
10933
|
+
week: number;
|
|
10934
|
+
correct: number;
|
|
10935
|
+
}, {
|
|
10936
|
+
total: number;
|
|
10937
|
+
week: number;
|
|
10938
|
+
correct: number;
|
|
10939
|
+
}>, "many">;
|
|
10940
|
+
/** Month buckets — empty when the league does not span 2+ calendar months. */
|
|
10941
|
+
monthly: z.ZodArray<z.ZodObject<{
|
|
10942
|
+
/** 1-based index within the league window for this granularity. */
|
|
10943
|
+
index: z.ZodNumber;
|
|
10944
|
+
label: z.ZodString;
|
|
10945
|
+
correct: z.ZodNumber;
|
|
10946
|
+
total: z.ZodNumber;
|
|
10947
|
+
}, "strip", z.ZodTypeAny, {
|
|
10948
|
+
index: number;
|
|
10949
|
+
total: number;
|
|
10950
|
+
label: string;
|
|
10951
|
+
correct: number;
|
|
10952
|
+
}, {
|
|
10953
|
+
index: number;
|
|
10954
|
+
total: number;
|
|
10955
|
+
label: string;
|
|
10956
|
+
correct: number;
|
|
10957
|
+
}>, "many">;
|
|
10958
|
+
/** Preferred chart filter given the league span. */
|
|
10959
|
+
defaultPeriod: z.ZodUnion<[z.ZodLiteral<"day">, z.ZodLiteral<"week">, z.ZodLiteral<"month">]>;
|
|
10960
|
+
definingPicks: z.ZodArray<z.ZodObject<{
|
|
10961
|
+
outcome: z.ZodUnion<[z.ZodLiteral<"hit">, z.ZodLiteral<"miss">]>;
|
|
10962
|
+
label: z.ZodString;
|
|
10963
|
+
detail: z.ZodString;
|
|
10964
|
+
/** 1-based day index within the league window (for chart filtering). */
|
|
10965
|
+
dayIndex: z.ZodNumber;
|
|
10966
|
+
/** 1-based week index within the league window. */
|
|
10967
|
+
weekIndex: z.ZodNumber;
|
|
10968
|
+
/** 1-based month index within the league window. */
|
|
10969
|
+
monthIndex: z.ZodNumber;
|
|
10970
|
+
}, "strip", z.ZodTypeAny, {
|
|
10971
|
+
detail: string;
|
|
10972
|
+
label: string;
|
|
10973
|
+
outcome: "hit" | "miss";
|
|
10974
|
+
dayIndex: number;
|
|
10975
|
+
weekIndex: number;
|
|
10976
|
+
monthIndex: number;
|
|
10977
|
+
}, {
|
|
10978
|
+
detail: string;
|
|
10979
|
+
label: string;
|
|
10980
|
+
outcome: "hit" | "miss";
|
|
10981
|
+
dayIndex: number;
|
|
10982
|
+
weekIndex: number;
|
|
10983
|
+
monthIndex: number;
|
|
10984
|
+
}>, "many">;
|
|
10985
|
+
achievements: z.ZodArray<z.ZodObject<{
|
|
10986
|
+
key: z.ZodString;
|
|
10987
|
+
title: z.ZodString;
|
|
10988
|
+
detail: z.ZodString;
|
|
10989
|
+
icon: z.ZodString;
|
|
10990
|
+
}, "strip", z.ZodTypeAny, {
|
|
10991
|
+
detail: string;
|
|
10992
|
+
key: string;
|
|
10993
|
+
title: string;
|
|
10994
|
+
icon: string;
|
|
10995
|
+
}, {
|
|
10996
|
+
detail: string;
|
|
10997
|
+
key: string;
|
|
10998
|
+
title: string;
|
|
10999
|
+
icon: string;
|
|
11000
|
+
}>, "many">;
|
|
11001
|
+
}, "strip", z.ZodTypeAny, {
|
|
11002
|
+
total: number;
|
|
11003
|
+
daily: {
|
|
11004
|
+
index: number;
|
|
11005
|
+
total: number;
|
|
11006
|
+
label: string;
|
|
11007
|
+
correct: number;
|
|
11008
|
+
}[];
|
|
11009
|
+
weekly: {
|
|
11010
|
+
total: number;
|
|
11011
|
+
week: number;
|
|
11012
|
+
correct: number;
|
|
11013
|
+
}[];
|
|
11014
|
+
monthly: {
|
|
11015
|
+
index: number;
|
|
11016
|
+
total: number;
|
|
11017
|
+
label: string;
|
|
11018
|
+
correct: number;
|
|
11019
|
+
}[];
|
|
11020
|
+
achievements: {
|
|
11021
|
+
detail: string;
|
|
11022
|
+
key: string;
|
|
11023
|
+
title: string;
|
|
11024
|
+
icon: string;
|
|
11025
|
+
}[];
|
|
11026
|
+
leagueId: string;
|
|
11027
|
+
memberCount: number;
|
|
11028
|
+
leagueName: string;
|
|
11029
|
+
correct: number;
|
|
11030
|
+
pct: number;
|
|
11031
|
+
finalRank: number | null;
|
|
11032
|
+
bestWeek: {
|
|
11033
|
+
total: number;
|
|
11034
|
+
week: number;
|
|
11035
|
+
correct: number;
|
|
11036
|
+
} | null;
|
|
11037
|
+
longestStreak: number;
|
|
11038
|
+
defaultPeriod: "day" | "month" | "week";
|
|
11039
|
+
definingPicks: {
|
|
11040
|
+
detail: string;
|
|
11041
|
+
label: string;
|
|
11042
|
+
outcome: "hit" | "miss";
|
|
11043
|
+
dayIndex: number;
|
|
11044
|
+
weekIndex: number;
|
|
11045
|
+
monthIndex: number;
|
|
11046
|
+
}[];
|
|
11047
|
+
isTied?: boolean | undefined;
|
|
11048
|
+
}, {
|
|
11049
|
+
total: number;
|
|
11050
|
+
daily: {
|
|
11051
|
+
index: number;
|
|
11052
|
+
total: number;
|
|
11053
|
+
label: string;
|
|
11054
|
+
correct: number;
|
|
11055
|
+
}[];
|
|
11056
|
+
weekly: {
|
|
11057
|
+
total: number;
|
|
11058
|
+
week: number;
|
|
11059
|
+
correct: number;
|
|
11060
|
+
}[];
|
|
11061
|
+
monthly: {
|
|
11062
|
+
index: number;
|
|
11063
|
+
total: number;
|
|
11064
|
+
label: string;
|
|
11065
|
+
correct: number;
|
|
11066
|
+
}[];
|
|
11067
|
+
achievements: {
|
|
11068
|
+
detail: string;
|
|
11069
|
+
key: string;
|
|
11070
|
+
title: string;
|
|
11071
|
+
icon: string;
|
|
11072
|
+
}[];
|
|
11073
|
+
leagueId: string;
|
|
11074
|
+
memberCount: number;
|
|
11075
|
+
leagueName: string;
|
|
11076
|
+
correct: number;
|
|
11077
|
+
pct: number;
|
|
11078
|
+
finalRank: number | null;
|
|
11079
|
+
bestWeek: {
|
|
11080
|
+
total: number;
|
|
11081
|
+
week: number;
|
|
11082
|
+
correct: number;
|
|
11083
|
+
} | null;
|
|
11084
|
+
longestStreak: number;
|
|
11085
|
+
defaultPeriod: "day" | "month" | "week";
|
|
11086
|
+
definingPicks: {
|
|
11087
|
+
detail: string;
|
|
11088
|
+
label: string;
|
|
11089
|
+
outcome: "hit" | "miss";
|
|
11090
|
+
dayIndex: number;
|
|
11091
|
+
weekIndex: number;
|
|
11092
|
+
monthIndex: number;
|
|
11093
|
+
}[];
|
|
11094
|
+
isTied?: boolean | undefined;
|
|
11095
|
+
}>;
|
|
11096
|
+
/** Resolve platform leagues for a mini league doc (legacy-safe). */
|
|
11097
|
+
export declare const getMiniLeaguePlatformLeagues: (league: {
|
|
11098
|
+
platformLeague?: string;
|
|
11099
|
+
platformLeagues?: string[] | null;
|
|
11100
|
+
}) => string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.miniLeagueUpcomingGamesResponseDtoSchema = exports.miniLeagueLeaderboardResponseDtoSchema = exports.miniLeagueInvitationsResponseDtoSchema = exports.miniLeagueMembersResponseDtoSchema = exports.miniLeagueListResponseDtoSchema = exports.miniLeagueInvitationActionResponseDtoSchema = exports.miniLeagueJoinResponseDtoSchema = exports.createMiniLeagueInvitationDtoSchema = exports.updateMiniLeagueDtoSchema = exports.createMiniLeagueDtoSchema = exports.miniLeagueInvitationSchema = exports.miniLeagueMemberSchema = exports.miniLeagueSchema = exports.miniLeagueInvitationStatusSchema = exports.miniLeagueMemberRoleSchema = exports.miniLeagueStatusSchema = exports.miniLeagueVisibilitySchema = exports.MINI_LEAGUE_MAX_MEMBERSHIPS_PER_USER = exports.MINI_LEAGUE_MAX_PLATFORM_LEAGUES = void 0;
|
|
3
|
+
exports.getMiniLeaguePlatformLeagues = exports.miniLeagueRecapResponseDtoSchema = exports.miniLeagueRecapAchievementSchema = exports.miniLeagueRecapDefiningPickSchema = exports.miniLeagueRecapChartPeriodSchema = exports.miniLeagueRecapPeriodBucketSchema = exports.miniLeagueRecapWeeklySchema = exports.miniLeagueUpcomingGamesResponseDtoSchema = exports.miniLeagueLeaderboardResponseDtoSchema = exports.miniLeagueInvitationsResponseDtoSchema = exports.miniLeagueMembersResponseDtoSchema = exports.miniLeagueListResponseDtoSchema = exports.miniLeagueInvitationActionResponseDtoSchema = exports.miniLeagueJoinResponseDtoSchema = exports.createMiniLeagueInvitationDtoSchema = exports.updateMiniLeagueDtoSchema = exports.createMiniLeagueDtoSchema = exports.miniLeagueInvitationSchema = exports.miniLeagueMemberSchema = exports.miniLeagueSchema = exports.miniLeagueInvitationStatusSchema = exports.miniLeagueMemberRoleSchema = exports.miniLeagueStatusSchema = exports.miniLeagueVisibilitySchema = exports.MINI_LEAGUE_MAX_MEMBERSHIPS_PER_USER = exports.MINI_LEAGUE_MAX_PLATFORM_LEAGUES = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const pick_1 = require("./pick");
|
|
6
6
|
const sharedTypes_1 = require("./sharedTypes");
|
|
@@ -35,13 +35,27 @@ exports.miniLeagueSchema = zod_1.z.object({
|
|
|
35
35
|
description: zod_1.z.string().max(500).optional(),
|
|
36
36
|
ownerId: zod_1.z.string(),
|
|
37
37
|
owner: user_1.reducedUserSchema,
|
|
38
|
+
/**
|
|
39
|
+
* All platform leagues in this challenge (1–2).
|
|
40
|
+
* Older docs may omit this; fall back to `[platformLeague]`.
|
|
41
|
+
*/
|
|
42
|
+
platformLeagues: zod_1.z
|
|
43
|
+
.array(sharedTypes_1.leagueSlug)
|
|
44
|
+
.min(1)
|
|
45
|
+
.max(exports.MINI_LEAGUE_MAX_PLATFORM_LEAGUES)
|
|
46
|
+
.optional(),
|
|
47
|
+
/** Primary / denormalized first league (always set; used by legacy queries). */
|
|
38
48
|
platformLeague: sharedTypes_1.leagueSlug,
|
|
39
49
|
sport: sharedTypes_1.sportType,
|
|
40
50
|
seasonStart: zod_1.z.number(),
|
|
41
51
|
seasonEnd: zod_1.z.number(),
|
|
42
52
|
startAt: zod_1.z.number(),
|
|
43
53
|
endAt: zod_1.z.number(),
|
|
44
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* When true, league ends when every selected platform season is inactive
|
|
56
|
+
* (or when calendar `endAt` passes). For multi-sport, `endAt` / `seasonEnd`
|
|
57
|
+
* use the latest season end among selected sports.
|
|
58
|
+
*/
|
|
45
59
|
endsWithSeason: zod_1.z.boolean().optional(),
|
|
46
60
|
visibility: exports.miniLeagueVisibilitySchema,
|
|
47
61
|
status: exports.miniLeagueStatusSchema,
|
|
@@ -63,6 +77,11 @@ exports.miniLeagueInvitationSchema = zod_1.z.object({
|
|
|
63
77
|
leagueId: zod_1.z.string(),
|
|
64
78
|
leagueName: zod_1.z.string(),
|
|
65
79
|
platformLeague: sharedTypes_1.leagueSlug.optional(),
|
|
80
|
+
platformLeagues: zod_1.z
|
|
81
|
+
.array(sharedTypes_1.leagueSlug)
|
|
82
|
+
.min(1)
|
|
83
|
+
.max(exports.MINI_LEAGUE_MAX_PLATFORM_LEAGUES)
|
|
84
|
+
.optional(),
|
|
66
85
|
memberCount: zod_1.z.number().int().nonnegative().optional(),
|
|
67
86
|
endAt: zod_1.z.number().optional(),
|
|
68
87
|
endsWithSeason: zod_1.z.boolean().optional(),
|
|
@@ -75,16 +94,38 @@ exports.miniLeagueInvitationSchema = zod_1.z.object({
|
|
|
75
94
|
updatedAt: zod_1.z.number(),
|
|
76
95
|
expiresAt: zod_1.z.number().optional(),
|
|
77
96
|
});
|
|
78
|
-
exports.createMiniLeagueDtoSchema = zod_1.z
|
|
97
|
+
exports.createMiniLeagueDtoSchema = zod_1.z
|
|
98
|
+
.object({
|
|
79
99
|
name: zod_1.z.string().min(1).max(80),
|
|
80
100
|
description: zod_1.z.string().max(500).optional(),
|
|
81
|
-
|
|
82
|
-
|
|
101
|
+
/** Preferred: one or more platform leagues (max 2). */
|
|
102
|
+
platformLeagues: zod_1.z
|
|
103
|
+
.array(sharedTypes_1.leagueSlug)
|
|
104
|
+
.min(1)
|
|
105
|
+
.max(exports.MINI_LEAGUE_MAX_PLATFORM_LEAGUES)
|
|
106
|
+
.optional(),
|
|
107
|
+
/** Legacy single-league create. */
|
|
108
|
+
platformLeague: sharedTypes_1.leagueSlug.optional(),
|
|
109
|
+
sport: sharedTypes_1.sportType.optional(),
|
|
83
110
|
visibility: exports.miniLeagueVisibilitySchema,
|
|
84
111
|
startAt: zod_1.z.number().optional(),
|
|
85
112
|
endAt: zod_1.z.number().optional(),
|
|
86
113
|
/** Defaults to true when endAt is omitted. */
|
|
87
114
|
endsWithSeason: zod_1.z.boolean().optional(),
|
|
115
|
+
})
|
|
116
|
+
.superRefine((data, ctx) => {
|
|
117
|
+
const leagues = data.platformLeagues && data.platformLeagues.length > 0
|
|
118
|
+
? data.platformLeagues
|
|
119
|
+
: data.platformLeague
|
|
120
|
+
? [data.platformLeague]
|
|
121
|
+
: [];
|
|
122
|
+
if (leagues.length === 0) {
|
|
123
|
+
ctx.addIssue({
|
|
124
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
125
|
+
message: "Select at least one league",
|
|
126
|
+
path: ["platformLeagues"],
|
|
127
|
+
});
|
|
128
|
+
}
|
|
88
129
|
});
|
|
89
130
|
exports.updateMiniLeagueDtoSchema = zod_1.z.object({
|
|
90
131
|
name: zod_1.z.string().min(1).max(80).optional(),
|
|
@@ -122,3 +163,78 @@ exports.miniLeagueUpcomingGamesResponseDtoSchema = zod_1.z.object({
|
|
|
122
163
|
games: zod_1.z.array(zod_1.z.any()),
|
|
123
164
|
pickedGameIds: zod_1.z.array(zod_1.z.string()),
|
|
124
165
|
});
|
|
166
|
+
exports.miniLeagueRecapWeeklySchema = zod_1.z.object({
|
|
167
|
+
/** 1-based week index within the league window. */
|
|
168
|
+
week: zod_1.z.number().int().positive(),
|
|
169
|
+
correct: zod_1.z.number().int().nonnegative(),
|
|
170
|
+
total: zod_1.z.number().int().nonnegative(),
|
|
171
|
+
});
|
|
172
|
+
exports.miniLeagueRecapPeriodBucketSchema = zod_1.z.object({
|
|
173
|
+
/** 1-based index within the league window for this granularity. */
|
|
174
|
+
index: zod_1.z.number().int().positive(),
|
|
175
|
+
label: zod_1.z.string(),
|
|
176
|
+
correct: zod_1.z.number().int().nonnegative(),
|
|
177
|
+
total: zod_1.z.number().int().nonnegative(),
|
|
178
|
+
});
|
|
179
|
+
exports.miniLeagueRecapChartPeriodSchema = zod_1.z.union([
|
|
180
|
+
zod_1.z.literal("day"),
|
|
181
|
+
zod_1.z.literal("week"),
|
|
182
|
+
zod_1.z.literal("month"),
|
|
183
|
+
]);
|
|
184
|
+
exports.miniLeagueRecapDefiningPickSchema = zod_1.z.object({
|
|
185
|
+
outcome: zod_1.z.union([zod_1.z.literal("hit"), zod_1.z.literal("miss")]),
|
|
186
|
+
label: zod_1.z.string(),
|
|
187
|
+
detail: zod_1.z.string(),
|
|
188
|
+
/** 1-based day index within the league window (for chart filtering). */
|
|
189
|
+
dayIndex: zod_1.z.number().int().positive(),
|
|
190
|
+
/** 1-based week index within the league window. */
|
|
191
|
+
weekIndex: zod_1.z.number().int().positive(),
|
|
192
|
+
/** 1-based month index within the league window. */
|
|
193
|
+
monthIndex: zod_1.z.number().int().positive(),
|
|
194
|
+
});
|
|
195
|
+
exports.miniLeagueRecapAchievementSchema = zod_1.z.object({
|
|
196
|
+
key: zod_1.z.string(),
|
|
197
|
+
title: zod_1.z.string(),
|
|
198
|
+
detail: zod_1.z.string(),
|
|
199
|
+
icon: zod_1.z.string(),
|
|
200
|
+
});
|
|
201
|
+
/** Personal season recap for a mini-league member (Your Stats / 3c). */
|
|
202
|
+
exports.miniLeagueRecapResponseDtoSchema = zod_1.z.object({
|
|
203
|
+
leagueId: zod_1.z.string(),
|
|
204
|
+
leagueName: zod_1.z.string(),
|
|
205
|
+
correct: zod_1.z.number().int().nonnegative(),
|
|
206
|
+
total: zod_1.z.number().int().nonnegative(),
|
|
207
|
+
pct: zod_1.z.number().nonnegative(),
|
|
208
|
+
finalRank: zod_1.z.number().int().positive().nullable(),
|
|
209
|
+
isTied: zod_1.z.boolean().optional(),
|
|
210
|
+
memberCount: zod_1.z.number().int().nonnegative(),
|
|
211
|
+
bestWeek: zod_1.z
|
|
212
|
+
.object({
|
|
213
|
+
week: zod_1.z.number().int().positive(),
|
|
214
|
+
correct: zod_1.z.number().int().nonnegative(),
|
|
215
|
+
total: zod_1.z.number().int().nonnegative(),
|
|
216
|
+
})
|
|
217
|
+
.nullable(),
|
|
218
|
+
longestStreak: zod_1.z.number().int().nonnegative(),
|
|
219
|
+
/** Day buckets — empty when the span is too short (<2 days) or too long (>14). */
|
|
220
|
+
daily: zod_1.z.array(exports.miniLeagueRecapPeriodBucketSchema),
|
|
221
|
+
/**
|
|
222
|
+
* Week buckets — empty when the league does not span 2+ weeks.
|
|
223
|
+
* Kept for chart + best-week; truncated to last 12 when longer.
|
|
224
|
+
*/
|
|
225
|
+
weekly: zod_1.z.array(exports.miniLeagueRecapWeeklySchema),
|
|
226
|
+
/** Month buckets — empty when the league does not span 2+ calendar months. */
|
|
227
|
+
monthly: zod_1.z.array(exports.miniLeagueRecapPeriodBucketSchema),
|
|
228
|
+
/** Preferred chart filter given the league span. */
|
|
229
|
+
defaultPeriod: exports.miniLeagueRecapChartPeriodSchema,
|
|
230
|
+
definingPicks: zod_1.z.array(exports.miniLeagueRecapDefiningPickSchema),
|
|
231
|
+
achievements: zod_1.z.array(exports.miniLeagueRecapAchievementSchema),
|
|
232
|
+
});
|
|
233
|
+
/** Resolve platform leagues for a mini league doc (legacy-safe). */
|
|
234
|
+
const getMiniLeaguePlatformLeagues = (league) => {
|
|
235
|
+
if (league.platformLeagues && league.platformLeagues.length > 0) {
|
|
236
|
+
return league.platformLeagues;
|
|
237
|
+
}
|
|
238
|
+
return league.platformLeague ? [league.platformLeague] : [];
|
|
239
|
+
};
|
|
240
|
+
exports.getMiniLeaguePlatformLeagues = getMiniLeaguePlatformLeagues;
|