@ttt-productions/q-core 0.1.46 → 0.1.48

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.
@@ -143,31 +143,19 @@ export declare const BasketballHallOfFameSchema: z.ZodObject<{
143
143
  rebounds: z.ZodNumber;
144
144
  assists: z.ZodNumber;
145
145
  gamesPlayed: z.ZodNumber;
146
- }, z.core.$strip> | z.ZodNever>;
146
+ }, z.core.$strip>>;
147
147
  updatedAt: z.ZodNumber;
148
148
  }, z.core.$strip>;
149
149
  export type BasketballHallOfFame = z.infer<typeof BasketballHallOfFameSchema>;
150
150
  export declare const CurlingHallOfFameSchema: z.ZodObject<{
151
151
  leagueType: z.ZodLiteral<"Curling">;
152
- playerStats: z.ZodRecord<z.ZodString, z.ZodObject<{
153
- fantasyPoints: z.ZodNumber;
154
- points: z.ZodNumber;
155
- rebounds: z.ZodNumber;
156
- assists: z.ZodNumber;
157
- gamesPlayed: z.ZodNumber;
158
- }, z.core.$strip> | z.ZodNever>;
152
+ playerStats: z.ZodRecord<z.ZodString, z.ZodNever>;
159
153
  updatedAt: z.ZodNumber;
160
154
  }, z.core.$strip>;
161
155
  export type CurlingHallOfFame = z.infer<typeof CurlingHallOfFameSchema>;
162
156
  export declare const FootballHallOfFameSchema: z.ZodObject<{
163
157
  leagueType: z.ZodLiteral<"Football">;
164
- playerStats: z.ZodRecord<z.ZodString, z.ZodObject<{
165
- fantasyPoints: z.ZodNumber;
166
- points: z.ZodNumber;
167
- rebounds: z.ZodNumber;
168
- assists: z.ZodNumber;
169
- gamesPlayed: z.ZodNumber;
170
- }, z.core.$strip> | z.ZodNever>;
158
+ playerStats: z.ZodRecord<z.ZodString, z.ZodNever>;
171
159
  updatedAt: z.ZodNumber;
172
160
  }, z.core.$strip>;
173
161
  export type FootballHallOfFame = z.infer<typeof FootballHallOfFameSchema>;
@@ -179,27 +167,15 @@ export declare const SportHallOfFameSchema: z.ZodDiscriminatedUnion<[z.ZodObject
179
167
  rebounds: z.ZodNumber;
180
168
  assists: z.ZodNumber;
181
169
  gamesPlayed: z.ZodNumber;
182
- }, z.core.$strip> | z.ZodNever>;
170
+ }, z.core.$strip>>;
183
171
  updatedAt: z.ZodNumber;
184
172
  }, z.core.$strip>, z.ZodObject<{
185
173
  leagueType: z.ZodLiteral<"Curling">;
186
- playerStats: z.ZodRecord<z.ZodString, z.ZodObject<{
187
- fantasyPoints: z.ZodNumber;
188
- points: z.ZodNumber;
189
- rebounds: z.ZodNumber;
190
- assists: z.ZodNumber;
191
- gamesPlayed: z.ZodNumber;
192
- }, z.core.$strip> | z.ZodNever>;
174
+ playerStats: z.ZodRecord<z.ZodString, z.ZodNever>;
193
175
  updatedAt: z.ZodNumber;
194
176
  }, z.core.$strip>, z.ZodObject<{
195
177
  leagueType: z.ZodLiteral<"Football">;
196
- playerStats: z.ZodRecord<z.ZodString, z.ZodObject<{
197
- fantasyPoints: z.ZodNumber;
198
- points: z.ZodNumber;
199
- rebounds: z.ZodNumber;
200
- assists: z.ZodNumber;
201
- gamesPlayed: z.ZodNumber;
202
- }, z.core.$strip> | z.ZodNever>;
178
+ playerStats: z.ZodRecord<z.ZodString, z.ZodNever>;
203
179
  updatedAt: z.ZodNumber;
204
180
  }, z.core.$strip>], "leagueType">;
205
181
  export type SportHallOfFame = z.infer<typeof SportHallOfFameSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"aggregate-stats.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/aggregate-stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,eAAO,MAAM,yBAAyB;;;;;;;iBAAgC,CAAC;AACvE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,+BAA+B;;;;;;;;;iBAI1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,O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E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;iCAIhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -52,16 +52,18 @@ export const UserLifetimeStatsSchema = z.object(Object.fromEntries(LEAGUE_TYPE_K
52
52
  SPORT_KEY_BY_LEAGUE_TYPE[leagueType],
53
53
  SPORT_LINE_SCHEMAS[leagueType].lifetime.optional(),
54
54
  ])));
55
- function sportHallOfFameOf(leagueType) {
55
+ // The sport's hall-of-fame schema comes in as its own type parameter: indexing the line map by a
56
+ // generic sport would type every option's entries as the union of every sport's.
57
+ function sportHallOfFameOf(leagueType, lines) {
56
58
  return z.object({
57
59
  leagueType: z.literal(leagueType),
58
- playerStats: z.record(userIdSchema, SPORT_LINE_SCHEMAS[leagueType].hallOfFame),
60
+ playerStats: z.record(userIdSchema, lines.hallOfFame),
59
61
  updatedAt: epochMsSchema,
60
62
  });
61
63
  }
62
- export const BasketballHallOfFameSchema = sportHallOfFameOf('Basketball');
63
- export const CurlingHallOfFameSchema = sportHallOfFameOf('Curling');
64
- export const FootballHallOfFameSchema = sportHallOfFameOf('Football');
64
+ export const BasketballHallOfFameSchema = sportHallOfFameOf('Basketball', SPORT_LINE_SCHEMAS.Basketball);
65
+ export const CurlingHallOfFameSchema = sportHallOfFameOf('Curling', SPORT_LINE_SCHEMAS.Curling);
66
+ export const FootballHallOfFameSchema = sportHallOfFameOf('Football', SPORT_LINE_SCHEMAS.Football);
65
67
  export const SportHallOfFameSchema = z.discriminatedUnion('leagueType', [
66
68
  BasketballHallOfFameSchema,
67
69
  CurlingHallOfFameSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"aggregate-stats.js","sourceRoot":"","sources":["../../src/doc-schemas/aggregate-stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAA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UE_TYPE } from '../types/sports.js';\nimport type { LeagueType } from '../types/sports.js';\nimport type { StatLineKind } from '../types/stats.js';\nimport { countSchema, epochMsSchema, userIdSchema } from './atoms.js';\nimport {\n BasketballPlayerStatsSchema,\n BasketballTeamStatsSchema,\n CurlingTeamStatsSchema,\n FootballTeamStatsSchema,\n} from './game-stats.js';\n\nconst teamSeasonBaseShape = {\n gamesPlayed: countSchema,\n wins: countSchema,\n losses: countSchema,\n ties: countSchema,\n pointsFor: countSchema,\n pointsAgainst: countSchema,\n};\n\nexport const TeamSeasonBaseStatsSchema = z.object(teamSeasonBaseShape);\nexport type TeamSeasonBaseStats = z.infer<typeof TeamSeasonBaseStatsSchema>;\n\nexport const BasketballTeamSeasonStatsSchema = z.object({\n ...teamSeasonBaseShape,\n rebounds: countSchema,\n assists: countSchema,\n});\nexport type BasketballTeamSeasonStats = z.infer<typeof BasketballTeamSeasonStatsSchema>;\n\nexport const GamesPlayedStatsSchema = z.object({\n gamesPlayed: countSchema,\n});\nexport type GamesPlayedStats = z.infer<typeof GamesPlayedStatsSchema>;\n\nexport const BasketballPlayerTotalsSchema = BasketballPlayerStatsSchema.extend({\n gamesPlayed: countSchema,\n});\nexport type BasketballPlayerTotals = z.infer<typeof BasketballPlayerTotalsSchema>;\n\nexport const SPORT_LINE_SCHEMAS = {\n Basketball: {\n gamePlayer: BasketballPlayerStatsSchema,\n membershipRow: BasketballPlayerTotalsSchema,\n lifetime: BasketballPlayerTotalsSchema,\n hallOfFame: BasketballPlayerTotalsSchema,\n gameTeam: BasketballTeamStatsSchema,\n teamSeason: BasketballTeamSeasonStatsSchema,\n },\n Curling: {\n gamePlayer: z.never(),\n membershipRow: GamesPlayedStatsSchema,\n lifetime: GamesPlayedStatsSchema,\n hallOfFame: z.never(),\n gameTeam: CurlingTeamStatsSchema,\n teamSeason: TeamSeasonBaseStatsSchema,\n },\n Football: {\n gamePlayer: z.never(),\n membershipRow: GamesPlayedStatsSchema,\n lifetime: GamesPlayedStatsSchema,\n hallOfFame: z.never(),\n gameTeam: FootballTeamStatsSchema,\n teamSeason: TeamSeasonBaseStatsSchema,\n },\n} as const satisfies Record<LeagueType, Record<StatLineKind, z.ZodType>>;\n\ntype LifetimeLinesShape = {\n [L in LeagueType as (typeof SPORT_KEY_BY_LEAGUE_TYPE)[L]]: z.ZodOptional<\n (typeof SPORT_LINE_SCHEMAS)[L]['lifetime']\n >;\n};\n\nexport const UserLifetimeStatsSchema = z.object(\n Object.fromEntries(\n LEAGUE_TYPE_KEYS.map(\n (leagueType) =>\n [\n SPORT_KEY_BY_LEAGUE_TYPE[leagueType],\n SPORT_LINE_SCHEMAS[leagueType].lifetime.optional(),\n ] as const,\n ),\n ) as LifetimeLinesShape,\n);\nexport type UserLifetimeStats = z.infer<typeof UserLifetimeStatsSchema>;\n\nfunction sportHallOfFameOf<L extends LeagueType>(leagueType: L) {\n return z.object({\n leagueType: z.literal(leagueType),\n playerStats: z.record(userIdSchema, SPORT_LINE_SCHEMAS[leagueType].hallOfFame),\n updatedAt: epochMsSchema,\n });\n}\n\nexport const BasketballHallOfFameSchema = sportHallOfFameOf('Basketball');\nexport type BasketballHallOfFame = z.infer<typeof BasketballHallOfFameSchema>;\n\nexport const CurlingHallOfFameSchema = sportHallOfFameOf('Curling');\nexport type CurlingHallOfFame = z.infer<typeof CurlingHallOfFameSchema>;\n\nexport const FootballHallOfFameSchema = sportHallOfFameOf('Football');\nexport type FootballHallOfFame = z.infer<typeof FootballHallOfFameSchema>;\n\nexport const SportHallOfFameSchema = z.discriminatedUnion('leagueType', [\n BasketballHallOfFameSchema,\n CurlingHallOfFameSchema,\n FootballHallOfFameSchema,\n]);\nexport type SportHallOfFame = z.infer<typeof SportHallOfFameSchema>;\n"]}
1
+ {"version":3,"file":"aggregate-stats.js","sourceRoot":"","sources":["../../src/doc-schemas/aggregate-stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB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;IAC1B,uBAAuB;IACvB,wBAAwB;CACzB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { LEAGUE_TYPE_KEYS, SPORT_KEY_BY_LEAGUE_TYPE } from '../types/sports.js';\nimport type { LeagueType } from '../types/sports.js';\nimport type { StatLineKind } from '../types/stats.js';\nimport { countSchema, epochMsSchema, userIdSchema } from './atoms.js';\nimport {\n BasketballPlayerStatsSchema,\n BasketballTeamStatsSchema,\n CurlingTeamStatsSchema,\n FootballTeamStatsSchema,\n} from './game-stats.js';\n\nconst teamSeasonBaseShape = {\n gamesPlayed: countSchema,\n wins: countSchema,\n losses: countSchema,\n ties: countSchema,\n pointsFor: countSchema,\n pointsAgainst: countSchema,\n};\n\nexport const TeamSeasonBaseStatsSchema = z.object(teamSeasonBaseShape);\nexport type TeamSeasonBaseStats = z.infer<typeof TeamSeasonBaseStatsSchema>;\n\nexport const BasketballTeamSeasonStatsSchema = z.object({\n ...teamSeasonBaseShape,\n rebounds: countSchema,\n assists: countSchema,\n});\nexport type BasketballTeamSeasonStats = z.infer<typeof BasketballTeamSeasonStatsSchema>;\n\nexport const GamesPlayedStatsSchema = z.object({\n gamesPlayed: countSchema,\n});\nexport type GamesPlayedStats = z.infer<typeof GamesPlayedStatsSchema>;\n\nexport const BasketballPlayerTotalsSchema = BasketballPlayerStatsSchema.extend({\n gamesPlayed: countSchema,\n});\nexport type BasketballPlayerTotals = z.infer<typeof BasketballPlayerTotalsSchema>;\n\nexport const SPORT_LINE_SCHEMAS = {\n Basketball: {\n gamePlayer: BasketballPlayerStatsSchema,\n membershipRow: BasketballPlayerTotalsSchema,\n lifetime: BasketballPlayerTotalsSchema,\n hallOfFame: BasketballPlayerTotalsSchema,\n gameTeam: BasketballTeamStatsSchema,\n teamSeason: BasketballTeamSeasonStatsSchema,\n },\n Curling: {\n gamePlayer: z.never(),\n membershipRow: GamesPlayedStatsSchema,\n lifetime: GamesPlayedStatsSchema,\n hallOfFame: z.never(),\n gameTeam: CurlingTeamStatsSchema,\n teamSeason: TeamSeasonBaseStatsSchema,\n },\n Football: {\n gamePlayer: z.never(),\n membershipRow: GamesPlayedStatsSchema,\n lifetime: GamesPlayedStatsSchema,\n hallOfFame: z.never(),\n gameTeam: FootballTeamStatsSchema,\n teamSeason: TeamSeasonBaseStatsSchema,\n },\n} as const satisfies Record<LeagueType, Record<StatLineKind, z.ZodType>>;\n\ntype LifetimeLinesShape = {\n [L in LeagueType as (typeof SPORT_KEY_BY_LEAGUE_TYPE)[L]]: z.ZodOptional<\n (typeof SPORT_LINE_SCHEMAS)[L]['lifetime']\n >;\n};\n\nexport const UserLifetimeStatsSchema = z.object(\n Object.fromEntries(\n LEAGUE_TYPE_KEYS.map(\n (leagueType) =>\n [\n SPORT_KEY_BY_LEAGUE_TYPE[leagueType],\n SPORT_LINE_SCHEMAS[leagueType].lifetime.optional(),\n ] as const,\n ),\n ) as LifetimeLinesShape,\n);\nexport type UserLifetimeStats = z.infer<typeof UserLifetimeStatsSchema>;\n\n// The sport's hall-of-fame schema comes in as its own type parameter: indexing the line map by a\n// generic sport would type every option's entries as the union of every sport's.\nfunction sportHallOfFameOf<L extends LeagueType, H extends z.ZodType>(\n leagueType: L,\n lines: { hallOfFame: H },\n) {\n return z.object({\n leagueType: z.literal(leagueType),\n playerStats: z.record(userIdSchema, lines.hallOfFame),\n updatedAt: epochMsSchema,\n });\n}\n\nexport const BasketballHallOfFameSchema = sportHallOfFameOf(\n 'Basketball',\n SPORT_LINE_SCHEMAS.Basketball,\n);\nexport type BasketballHallOfFame = z.infer<typeof BasketballHallOfFameSchema>;\n\nexport const CurlingHallOfFameSchema = sportHallOfFameOf('Curling', SPORT_LINE_SCHEMAS.Curling);\nexport type CurlingHallOfFame = z.infer<typeof CurlingHallOfFameSchema>;\n\nexport const FootballHallOfFameSchema = sportHallOfFameOf('Football', SPORT_LINE_SCHEMAS.Football);\nexport type FootballHallOfFame = z.infer<typeof FootballHallOfFameSchema>;\n\nexport const SportHallOfFameSchema = z.discriminatedUnion('leagueType', [\n BasketballHallOfFameSchema,\n CurlingHallOfFameSchema,\n FootballHallOfFameSchema,\n]);\nexport type SportHallOfFame = z.infer<typeof SportHallOfFameSchema>;\n"]}
@@ -2,6 +2,8 @@ import { z } from 'zod';
2
2
  export declare const BasketballLeagueTeamSchema: z.ZodObject<{
3
3
  leagueType: z.ZodLiteral<"Basketball">;
4
4
  seasonStats: z.ZodOptional<z.ZodObject<{
5
+ rebounds: z.ZodNumber;
6
+ assists: z.ZodNumber;
5
7
  gamesPlayed: z.ZodNumber;
6
8
  wins: z.ZodNumber;
7
9
  losses: z.ZodNumber;
@@ -10,8 +12,6 @@ export declare const BasketballLeagueTeamSchema: z.ZodObject<{
10
12
  pointsAgainst: z.ZodNumber;
11
13
  }, z.core.$strip>>;
12
14
  playerSeasonStats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
13
- gamesPlayed: z.ZodNumber;
14
- }, z.core.$strip> | z.ZodObject<{
15
15
  fantasyPoints: z.ZodNumber;
16
16
  points: z.ZodNumber;
17
17
  rebounds: z.ZodNumber;
@@ -164,12 +164,6 @@ export declare const CurlingLeagueTeamSchema: z.ZodObject<{
164
164
  }, z.core.$strip>>;
165
165
  playerSeasonStats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
166
166
  gamesPlayed: z.ZodNumber;
167
- }, z.core.$strip> | z.ZodObject<{
168
- fantasyPoints: z.ZodNumber;
169
- points: z.ZodNumber;
170
- rebounds: z.ZodNumber;
171
- assists: z.ZodNumber;
172
- gamesPlayed: z.ZodNumber;
173
167
  }, z.core.$strip>>>;
174
168
  name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
175
169
  icon: z.ZodEnum<{
@@ -317,12 +311,6 @@ export declare const FootballLeagueTeamSchema: z.ZodObject<{
317
311
  }, z.core.$strip>>;
318
312
  playerSeasonStats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
319
313
  gamesPlayed: z.ZodNumber;
320
- }, z.core.$strip> | z.ZodObject<{
321
- fantasyPoints: z.ZodNumber;
322
- points: z.ZodNumber;
323
- rebounds: z.ZodNumber;
324
- assists: z.ZodNumber;
325
- gamesPlayed: z.ZodNumber;
326
314
  }, z.core.$strip>>>;
327
315
  name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
328
316
  icon: z.ZodEnum<{
@@ -461,6 +449,8 @@ export type FootballLeagueTeam = z.infer<typeof FootballLeagueTeamSchema>;
461
449
  export declare const LeagueTeamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
462
450
  leagueType: z.ZodLiteral<"Basketball">;
463
451
  seasonStats: z.ZodOptional<z.ZodObject<{
452
+ rebounds: z.ZodNumber;
453
+ assists: z.ZodNumber;
464
454
  gamesPlayed: z.ZodNumber;
465
455
  wins: z.ZodNumber;
466
456
  losses: z.ZodNumber;
@@ -469,8 +459,6 @@ export declare const LeagueTeamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
469
459
  pointsAgainst: z.ZodNumber;
470
460
  }, z.core.$strip>>;
471
461
  playerSeasonStats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
472
- gamesPlayed: z.ZodNumber;
473
- }, z.core.$strip> | z.ZodObject<{
474
462
  fantasyPoints: z.ZodNumber;
475
463
  points: z.ZodNumber;
476
464
  rebounds: z.ZodNumber;
@@ -621,12 +609,6 @@ export declare const LeagueTeamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
621
609
  }, z.core.$strip>>;
622
610
  playerSeasonStats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
623
611
  gamesPlayed: z.ZodNumber;
624
- }, z.core.$strip> | z.ZodObject<{
625
- fantasyPoints: z.ZodNumber;
626
- points: z.ZodNumber;
627
- rebounds: z.ZodNumber;
628
- assists: z.ZodNumber;
629
- gamesPlayed: z.ZodNumber;
630
612
  }, z.core.$strip>>>;
631
613
  name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
632
614
  icon: z.ZodEnum<{
@@ -772,12 +754,6 @@ export declare const LeagueTeamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
772
754
  }, z.core.$strip>>;
773
755
  playerSeasonStats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
774
756
  gamesPlayed: z.ZodNumber;
775
- }, z.core.$strip> | z.ZodObject<{
776
- fantasyPoints: z.ZodNumber;
777
- points: z.ZodNumber;
778
- rebounds: z.ZodNumber;
779
- assists: z.ZodNumber;
780
- gamesPlayed: z.ZodNumber;
781
757
  }, z.core.$strip>>>;
782
758
  name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
783
759
  icon: z.ZodEnum<{
@@ -1 +1 @@
1
- {"version":3,"file":"league-team.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/league-team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA8CxB,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA6B,CAAC;AACrE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA0B,CAAC;AAC/D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAI3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,uBAAuB;;;;iBAIlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -23,19 +23,19 @@ const leagueTeamBaseShape = {
23
23
  createdAt: epochMsSchema,
24
24
  updatedAt: epochMsSchema,
25
25
  };
26
- function leagueTeamOf(leagueType) {
26
+ // The sport's line schemas come in as their own type parameters: indexing the line map by a generic
27
+ // sport would type every option's lines as the union of every sport's.
28
+ function leagueTeamOf(leagueType, lines) {
27
29
  return z.object({
28
30
  ...leagueTeamBaseShape,
29
31
  leagueType: z.literal(leagueType),
30
- seasonStats: SPORT_LINE_SCHEMAS[leagueType].teamSeason.optional(),
31
- playerSeasonStats: z
32
- .record(userIdSchema, SPORT_LINE_SCHEMAS[leagueType].membershipRow)
33
- .optional(),
32
+ seasonStats: z.optional(lines.teamSeason),
33
+ playerSeasonStats: z.optional(z.record(userIdSchema, lines.membershipRow)),
34
34
  });
35
35
  }
36
- export const BasketballLeagueTeamSchema = leagueTeamOf('Basketball');
37
- export const CurlingLeagueTeamSchema = leagueTeamOf('Curling');
38
- export const FootballLeagueTeamSchema = leagueTeamOf('Football');
36
+ export const BasketballLeagueTeamSchema = leagueTeamOf('Basketball', SPORT_LINE_SCHEMAS.Basketball);
37
+ export const CurlingLeagueTeamSchema = leagueTeamOf('Curling', SPORT_LINE_SCHEMAS.Curling);
38
+ export const FootballLeagueTeamSchema = leagueTeamOf('Football', SPORT_LINE_SCHEMAS.Football);
39
39
  export const LeagueTeamSchema = z.discriminatedUnion('leagueType', [
40
40
  BasketballLeagueTeamSchema,
41
41
  CurlingLeagueTeamSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"league-team.js","sourceRoot":"","sources":["../../src/doc-schemas/league-team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,mBAAmB,GAAG;IAC1B,IAAI,EAAE,eAAe,CAAC,eAAe,CAAC;IACtC,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,cAAc;IACxB,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE;IACnC,eAAe,EAAE,YAAY;IAC7B,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IACzC,2FAA2F;IAC3F,0BAA0B;IAC1B,kBAAkB,EAAE,WAAW,CAAC,QAAQ,EAAE;IAC1C,+FAA+F;IAC/F,2CAA2C;IAC3C,YAAY,EAAE,WAAW,CAAC,QAAQ,EAAE;IACpC,2FAA2F;IAC3F,0BAA0B;IAC1B,gBAAgB,EAAE,WAAW,CAAC,QAAQ,EAAE;IACxC,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;CAChB,CAAC;AAEX,SAAS,YAAY,CAAuB,UAAa;IACvD,OAAO,CAAC,CAAC,MAAM,CAAC;QACd,GAAG,mBAAmB;QACtB,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;QACjC,WAAW,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE;QACjE,iBAAiB,EAAE,CAAC;aACjB,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC,aAAa,CAAC;aAClE,QAAQ,EAAE;KACd,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;AAGrE,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;AAG/D,MAAM,CAAC,MAAM,wBAAwB,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;AAGjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,kBAAkB,CAAC,YAAY,EAAE;IACjE,0BAA0B;IAC1B,uBAAuB;IACvB,wBAAwB;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,QAAQ,EAAE,cAAc;IACxB,YAAY,EAAE,eAAe,CAAC,mBAAmB,CAAC;IAClD,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { CONTACT_PHONE_INPUT, TEAM_NAME_INPUT } from '../constants/text-fields.js';\nimport {\n countSchema,\n epochMsSchema,\n leagueIdSchema,\n teamIconSchema,\n teamTypeSchema,\n userIdSchema,\n} from './atoms.js';\nimport { textFieldSchema } from '../schemas/text-field.js';\nimport type { LeagueType } from '../types/sports.js';\nimport { SPORT_LINE_SCHEMAS } from './aggregate-stats.js';\nimport { GallerySummarySchema } from './gallery.js';\n\nconst leagueTeamBaseShape = {\n name: textFieldSchema(TEAM_NAME_INPUT),\n icon: teamIconSchema,\n leagueId: leagueIdSchema,\n teamType: teamTypeSchema.optional(),\n createdByUserId: userIdSchema,\n pictures: GallerySummarySchema.optional(),\n // Only its changing matters: the write fence between membership changes and roster seeding\n // (RULE-STD-BACKEND-116).\n membershipRevision: countSchema.optional(),\n // Only its changing matters: the write fence between competing invitations, join requests, and\n // membership doors (RULE-STD-BACKEND-116).\n joinRevision: countSchema.optional(),\n // Only its changing matters: the write fence between game creation and the team's deletion\n // (RULE-STD-BACKEND-116).\n scheduleRevision: countSchema.optional(),\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n} as const;\n\nfunction leagueTeamOf<L extends LeagueType>(leagueType: L) {\n return z.object({\n ...leagueTeamBaseShape,\n leagueType: z.literal(leagueType),\n seasonStats: SPORT_LINE_SCHEMAS[leagueType].teamSeason.optional(),\n playerSeasonStats: z\n .record(userIdSchema, SPORT_LINE_SCHEMAS[leagueType].membershipRow)\n .optional(),\n });\n}\n\nexport const BasketballLeagueTeamSchema = leagueTeamOf('Basketball');\nexport type BasketballLeagueTeam = z.infer<typeof BasketballLeagueTeamSchema>;\n\nexport const CurlingLeagueTeamSchema = leagueTeamOf('Curling');\nexport type CurlingLeagueTeam = z.infer<typeof CurlingLeagueTeamSchema>;\n\nexport const FootballLeagueTeamSchema = leagueTeamOf('Football');\nexport type FootballLeagueTeam = z.infer<typeof FootballLeagueTeamSchema>;\n\nexport const LeagueTeamSchema = z.discriminatedUnion('leagueType', [\n BasketballLeagueTeamSchema,\n CurlingLeagueTeamSchema,\n FootballLeagueTeamSchema,\n]);\nexport type LeagueTeam = z.infer<typeof LeagueTeamSchema>;\n\nexport const LeagueTeamContactSchema = z.object({\n leagueId: leagueIdSchema,\n contactPhone: textFieldSchema(CONTACT_PHONE_INPUT),\n updatedAt: epochMsSchema,\n});\nexport type LeagueTeamContact = z.infer<typeof LeagueTeamContactSchema>;\n"]}
1
+ {"version":3,"file":"league-team.js","sourceRoot":"","sources":["../../src/doc-schemas/league-team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EACL,WAAW,EACX,aAAa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AC;AAGpG,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CAAC,SAAS,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAG3F,MAAM,CAAC,MAAM,wBAAwB,GAAG,YAAY,CAAC,UAAU,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AAG9F,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,kBAAkB,CAAC,YAAY,EAAE;IACjE,0BAA0B;IAC1B,uBAAuB;IACvB,wBAAwB;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,QAAQ,EAAE,cAAc;IACxB,YAAY,EAAE,eAAe,CAAC,mBAAmB,CAAC;IAClD,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { CONTACT_PHONE_INPUT, TEAM_NAME_INPUT } from '../constants/text-fields.js';\nimport {\n countSchema,\n epochMsSchema,\n leagueIdSchema,\n teamIconSchema,\n teamTypeSchema,\n userIdSchema,\n} from './atoms.js';\nimport { textFieldSchema } from '../schemas/text-field.js';\nimport type { LeagueType } from '../types/sports.js';\nimport { SPORT_LINE_SCHEMAS } from './aggregate-stats.js';\nimport { GallerySummarySchema } from './gallery.js';\n\nconst leagueTeamBaseShape = {\n name: textFieldSchema(TEAM_NAME_INPUT),\n icon: teamIconSchema,\n leagueId: leagueIdSchema,\n teamType: teamTypeSchema.optional(),\n createdByUserId: userIdSchema,\n pictures: GallerySummarySchema.optional(),\n // Only its changing matters: the write fence between membership changes and roster seeding\n // (RULE-STD-BACKEND-116).\n membershipRevision: countSchema.optional(),\n // Only its changing matters: the write fence between competing invitations, join requests, and\n // membership doors (RULE-STD-BACKEND-116).\n joinRevision: countSchema.optional(),\n // Only its changing matters: the write fence between game creation and the team's deletion\n // (RULE-STD-BACKEND-116).\n scheduleRevision: countSchema.optional(),\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n} as const;\n\n// The sport's line schemas come in as their own type parameters: indexing the line map by a generic\n// sport would type every option's lines as the union of every sport's.\nfunction leagueTeamOf<L extends LeagueType, S extends z.ZodType, R extends z.ZodType>(\n leagueType: L,\n lines: { teamSeason: S; membershipRow: R },\n) {\n return z.object({\n ...leagueTeamBaseShape,\n leagueType: z.literal(leagueType),\n seasonStats: z.optional(lines.teamSeason),\n playerSeasonStats: z.optional(z.record(userIdSchema, lines.membershipRow)),\n });\n}\n\nexport const BasketballLeagueTeamSchema = leagueTeamOf('Basketball', SPORT_LINE_SCHEMAS.Basketball);\nexport type BasketballLeagueTeam = z.infer<typeof BasketballLeagueTeamSchema>;\n\nexport const CurlingLeagueTeamSchema = leagueTeamOf('Curling', SPORT_LINE_SCHEMAS.Curling);\nexport type CurlingLeagueTeam = z.infer<typeof CurlingLeagueTeamSchema>;\n\nexport const FootballLeagueTeamSchema = leagueTeamOf('Football', SPORT_LINE_SCHEMAS.Football);\nexport type FootballLeagueTeam = z.infer<typeof FootballLeagueTeamSchema>;\n\nexport const LeagueTeamSchema = z.discriminatedUnion('leagueType', [\n BasketballLeagueTeamSchema,\n CurlingLeagueTeamSchema,\n FootballLeagueTeamSchema,\n]);\nexport type LeagueTeam = z.infer<typeof LeagueTeamSchema>;\n\nexport const LeagueTeamContactSchema = z.object({\n leagueId: leagueIdSchema,\n contactPhone: textFieldSchema(CONTACT_PHONE_INPUT),\n updatedAt: epochMsSchema,\n});\nexport type LeagueTeamContact = z.infer<typeof LeagueTeamContactSchema>;\n"]}
@@ -128,6 +128,8 @@ export declare const COLLECTION_SCHEMAS: {
128
128
  readonly 'leagueTeams/{teamId}': z.ZodDiscriminatedUnion<[z.ZodObject<{
129
129
  leagueType: z.ZodLiteral<"Basketball">;
130
130
  seasonStats: z.ZodOptional<z.ZodObject<{
131
+ rebounds: z.ZodNumber;
132
+ assists: z.ZodNumber;
131
133
  gamesPlayed: z.ZodNumber;
132
134
  wins: z.ZodNumber;
133
135
  losses: z.ZodNumber;
@@ -136,8 +138,6 @@ export declare const COLLECTION_SCHEMAS: {
136
138
  pointsAgainst: z.ZodNumber;
137
139
  }, z.core.$strip>>;
138
140
  playerSeasonStats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
139
- gamesPlayed: z.ZodNumber;
140
- }, z.core.$strip> | z.ZodObject<{
141
141
  fantasyPoints: z.ZodNumber;
142
142
  points: z.ZodNumber;
143
143
  rebounds: z.ZodNumber;
@@ -288,12 +288,6 @@ export declare const COLLECTION_SCHEMAS: {
288
288
  }, z.core.$strip>>;
289
289
  playerSeasonStats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
290
290
  gamesPlayed: z.ZodNumber;
291
- }, z.core.$strip> | z.ZodObject<{
292
- fantasyPoints: z.ZodNumber;
293
- points: z.ZodNumber;
294
- rebounds: z.ZodNumber;
295
- assists: z.ZodNumber;
296
- gamesPlayed: z.ZodNumber;
297
291
  }, z.core.$strip>>>;
298
292
  name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
299
293
  icon: z.ZodEnum<{
@@ -439,12 +433,6 @@ export declare const COLLECTION_SCHEMAS: {
439
433
  }, z.core.$strip>>;
440
434
  playerSeasonStats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
441
435
  gamesPlayed: z.ZodNumber;
442
- }, z.core.$strip> | z.ZodObject<{
443
- fantasyPoints: z.ZodNumber;
444
- points: z.ZodNumber;
445
- rebounds: z.ZodNumber;
446
- assists: z.ZodNumber;
447
- gamesPlayed: z.ZodNumber;
448
436
  }, z.core.$strip>>>;
449
437
  name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
450
438
  icon: z.ZodEnum<{
@@ -1344,27 +1332,15 @@ export declare const COLLECTION_SCHEMAS: {
1344
1332
  rebounds: z.ZodNumber;
1345
1333
  assists: z.ZodNumber;
1346
1334
  gamesPlayed: z.ZodNumber;
1347
- }, z.core.$strip> | z.ZodNever>;
1335
+ }, z.core.$strip>>;
1348
1336
  updatedAt: z.ZodNumber;
1349
1337
  }, z.core.$strip>, z.ZodObject<{
1350
1338
  leagueType: z.ZodLiteral<"Curling">;
1351
- playerStats: z.ZodRecord<z.ZodString, z.ZodObject<{
1352
- fantasyPoints: z.ZodNumber;
1353
- points: z.ZodNumber;
1354
- rebounds: z.ZodNumber;
1355
- assists: z.ZodNumber;
1356
- gamesPlayed: z.ZodNumber;
1357
- }, z.core.$strip> | z.ZodNever>;
1339
+ playerStats: z.ZodRecord<z.ZodString, z.ZodNever>;
1358
1340
  updatedAt: z.ZodNumber;
1359
1341
  }, z.core.$strip>, z.ZodObject<{
1360
1342
  leagueType: z.ZodLiteral<"Football">;
1361
- playerStats: z.ZodRecord<z.ZodString, z.ZodObject<{
1362
- fantasyPoints: z.ZodNumber;
1363
- points: z.ZodNumber;
1364
- rebounds: z.ZodNumber;
1365
- assists: z.ZodNumber;
1366
- gamesPlayed: z.ZodNumber;
1367
- }, z.core.$strip> | z.ZodNever>;
1343
+ playerStats: z.ZodRecord<z.ZodString, z.ZodNever>;
1368
1344
  updatedAt: z.ZodNumber;
1369
1345
  }, z.core.$strip>], "leagueType">;
1370
1346
  readonly 'statsValidationReports/{reportId}': z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiD7B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDkB,CAAC;AAElD,MAAM,MAAM,wBAAwB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAEvE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;CAciC,CAAC;AAEvE,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAAO,CAAC"}
@@ -191,10 +191,7 @@ export declare const GameRepairChangesSchema: z.ZodObject<{
191
191
  stored: z.ZodNumber;
192
192
  rebuilt: z.ZodNumber;
193
193
  }, z.core.$strict>>;
194
- recordRewritten: z.ZodOptional<z.ZodObject<{
195
- pagesBefore: z.ZodNumber;
196
- pagesAfter: z.ZodNumber;
197
- }, z.core.$strict>>;
194
+ recordRewritten: z.ZodOptional<z.ZodLiteral<true>>;
198
195
  }, z.core.$strict>;
199
196
  export type GameRepairChanges = z.infer<typeof GameRepairChangesSchema>;
200
197
  export declare const GameStatsRepairResultSchema: z.ZodObject<{
@@ -249,10 +246,7 @@ export declare const GameStatsRepairResultSchema: z.ZodObject<{
249
246
  stored: z.ZodNumber;
250
247
  rebuilt: z.ZodNumber;
251
248
  }, z.core.$strict>>;
252
- recordRewritten: z.ZodOptional<z.ZodObject<{
253
- pagesBefore: z.ZodNumber;
254
- pagesAfter: z.ZodNumber;
255
- }, z.core.$strict>>;
249
+ recordRewritten: z.ZodOptional<z.ZodLiteral<true>>;
256
250
  }, z.core.$strict>;
257
251
  destinationChanges: z.ZodArray<z.ZodObject<{
258
252
  ref: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../src/schemas/stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyCxB,eAAO,MAAM,uBAAuB;;kBAA8C,CAAC;AACnF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CA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AAO,MAAM,6BAA6B;;;;;;kBAE/B,CAAC;AACZ,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAOhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,2CAA2C;;kBAE7C,CAAC;AACZ,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,2CAA2C,CACnD,CAAC;AAEF,eAAO,MAAM,4CAA4C;;kBAE9C,CAAC;AACZ,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAC1D,OAAO,4CAA4C,CACpD,CAAC"}
@@ -159,10 +159,7 @@ export const GameRepairChangesSchema = z
159
159
  absentRosterPlayerIds: replacedEntryListSchema.optional(),
160
160
  nonScoringRosterPlayerIds: replacedEntryListSchema.optional(),
161
161
  statEventSequence: z.object({ stored: countSchema, rebuilt: countSchema }).strict().optional(),
162
- recordRewritten: z
163
- .object({ pagesBefore: countSchema, pagesAfter: countSchema })
164
- .strict()
165
- .optional(),
162
+ recordRewritten: z.literal(true).optional(),
166
163
  })
167
164
  .strict();
168
165
  export const GameStatsRepairResultSchema = z
@@ -1 +1 @@
1
- {"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/schemas/stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,iCAAiC,GAClC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,YAAY,EACZ,wBAAwB,EACxB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,6BAA6B,EAC7B,YAAY,EACZ,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KACnD,MAAM,EAAE,CAAC;AAKZ,MAAM,CAAC,MAAM,4CAA4C,GAAG,CAAC;KAC1D,MAAM,CAAC,EAAE,QAAQ,EAAE,6BAA6B,EAAE,CAAC;KACnD,MAAM,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n CURLING_ROUND_COUNT,\n MAX_CURLING_ROUND_POINTS,\n MAX_GAME_STATS_CORRECTION_TARGETS,\n} from '../constants/sports.js';\nimport {\n countSchema,\n enteredStatCountSchema,\n gameIdSchema,\n gameRosterPlayerIdSchema,\n leagueIdSchema,\n repairReasonSchema,\n sportKeySchema,\n statCounterKeySchema,\n statsOperationIdSchema,\n statsValidationReportIdSchema,\n teamIdSchema,\n userIdSchema,\n} from '../doc-schemas/atoms.js';\nimport {\n StatsDestinationChangeSchema,\n StatsOperationCountsSchema,\n} from '../doc-schemas/stats-operation.js';\nimport {\n StatsValidationReportSchema,\n StatsValidationScopeSchema,\n StatsValidationSummarySchema,\n} from '../doc-schemas/system.js';\nimport {\n HISTORICAL_STAT_KEYS,\n HistoricalStatsSchema,\n type HistoricalStats,\n} from '../doc-schemas/user-profile.js';\nimport {\n GAME_FINALIZE_OUTCOME_KEYS,\n GAME_REOPEN_OUTCOME_KEYS,\n GAME_STATS_REPAIR_OUTCOME_KEYS,\n UNROSTERED_STAT_LINE_RESOLUTION_OUTCOME_KEYS,\n} from '../types/stats.js';\n\nexport const FinalizeGameInputSchema = z.object({ gameId: gameIdSchema }).strict();\nexport type FinalizeGameInput = z.infer<typeof FinalizeGameInputSchema>;\n\nexport const FinalizeGameResultSchema = z\n .object({\n gameId: gameIdSchema,\n leagueId: leagueIdSchema,\n outcome: z.enum(GAME_FINALIZE_OUTCOME_KEYS),\n nonScoringRosterPlayerIds: z.array(gameRosterPlayerIdSchema),\n })\n .strict();\nexport type FinalizeGameResult = z.infer<typeof FinalizeGameResultSchema>;\n\nexport const ReopenGameInputSchema = z\n .object({ gameId: gameIdSchema, reason: repairReasonSchema })\n .strict();\nexport type ReopenGameInput = z.infer<typeof ReopenGameInputSchema>;\n\nexport const ReopenGameResultSchema = z\n .object({\n gameId: gameIdSchema,\n leagueId: leagueIdSchema,\n outcome: z.enum(GAME_REOPEN_OUTCOME_KEYS),\n })\n .strict();\nexport type ReopenGameResult = z.infer<typeof ReopenGameResultSchema>;\n\nexport const AdminResolveUnrosteredStatLineInputSchema = z\n .object({\n gameId: gameIdSchema,\n userId: userIdSchema,\n teamId: teamIdSchema,\n reason: repairReasonSchema,\n dryRun: z.boolean().optional(),\n })\n .strict();\nexport type AdminResolveUnrosteredStatLineInput = z.infer<\n typeof AdminResolveUnrosteredStatLineInputSchema\n>;\n\nexport const AdminResolveUnrosteredStatLineResultSchema = z\n .object({\n gameId: gameIdSchema,\n userId: userIdSchema,\n teamId: teamIdSchema,\n outcome: z.enum(UNROSTERED_STAT_LINE_RESOLUTION_OUTCOME_KEYS),\n gameConverts: z.boolean(),\n })\n .strict();\nexport type AdminResolveUnrosteredStatLineResult = z.infer<\n typeof AdminResolveUnrosteredStatLineResultSchema\n>;\n\nconst statsRepairFields = {\n reason: repairReasonSchema,\n operationId: statsOperationIdSchema,\n dryRun: z.boolean(),\n resumeAfter: z.string().min(1).optional(),\n};\n\nconst cursorOnlyOnDryRun = (input: { dryRun: boolean; resumeAfter?: string }): boolean =>\n input.dryRun || input.resumeAfter === undefined;\nconst CURSOR_ONLY_ON_DRY_RUN = {\n message: 'A real run resumes from its operation; only a dry run takes a cursor.',\n path: ['resumeAfter'],\n};\n\nexport const RecalculateLeagueStatsInputSchema = z\n .object({ leagueId: leagueIdSchema, ...statsRepairFields })\n .strict()\n .refine(cursorOnlyOnDryRun, CURSOR_ONLY_ON_DRY_RUN);\nexport type RecalculateLeagueStatsInput = z.infer<typeof RecalculateLeagueStatsInputSchema>;\n\nexport const RecalculateAllLeagueStatsInputSchema = z\n .object({ ...statsRepairFields })\n .strict()\n .refine(cursorOnlyOnDryRun, CURSOR_ONLY_ON_DRY_RUN);\nexport type RecalculateAllLeagueStatsInput = z.infer<typeof RecalculateAllLeagueStatsInputSchema>;\n\nexport const RecalculateUserStatsInputSchema = z\n .object({ userId: userIdSchema, ...statsRepairFields })\n .strict()\n .refine(cursorOnlyOnDryRun, CURSOR_ONLY_ON_DRY_RUN);\nexport type RecalculateUserStatsInput = z.infer<typeof RecalculateUserStatsInputSchema>;\n\nexport const RecalculateAllUserStatsInputSchema = z\n .object({ ...statsRepairFields })\n .strict()\n .refine(cursorOnlyOnDryRun, CURSOR_ONLY_ON_DRY_RUN);\nexport type RecalculateAllUserStatsInput = z.infer<typeof RecalculateAllUserStatsInputSchema>;\n\nexport const RecalculateHallOfFameInputSchema = z\n .object({ sportKey: sportKeySchema, userId: userIdSchema.optional(), ...statsRepairFields })\n .strict()\n .refine(cursorOnlyOnDryRun, CURSOR_ONLY_ON_DRY_RUN);\nexport type RecalculateHallOfFameInput = z.infer<typeof RecalculateHallOfFameInputSchema>;\n\nexport const StatsRebuildResultSchema = z\n .object({\n operationId: statsOperationIdSchema,\n dryRun: z.boolean(),\n complete: z.boolean(),\n nextResumeAfter: z.string().min(1).nullable(),\n counts: StatsOperationCountsSchema,\n changes: z.array(StatsDestinationChangeSchema),\n changesTruncated: z.boolean(),\n scopeChanged: z.boolean(),\n })\n .strict();\nexport type StatsRebuildResult = z.infer<typeof StatsRebuildResultSchema>;\n\nexport const GameStatsCorrectionTargetSchema = z\n .object({\n teamId: teamIdSchema,\n playerUserId: userIdSchema.optional(),\n stat: statCounterKeySchema,\n value: enteredStatCountSchema,\n })\n .strict();\nexport type GameStatsCorrectionTarget = z.infer<typeof GameStatsCorrectionTargetSchema>;\n\nexport const AdminCorrectGameStatsInputSchema = z\n .object({\n gameId: gameIdSchema,\n targets: z\n .array(GameStatsCorrectionTargetSchema)\n .min(1)\n .max(MAX_GAME_STATS_CORRECTION_TARGETS)\n .optional(),\n keepStored: z.literal(true).optional(),\n reason: repairReasonSchema,\n operationId: statsOperationIdSchema,\n dryRun: z.boolean(),\n })\n .strict()\n .refine((input) => (input.targets === undefined) !== (input.keepStored === undefined), {\n message: 'Give the values to set, or keep the stored numbers — one of the two.',\n path: ['targets'],\n });\nexport type AdminCorrectGameStatsInput = z.infer<typeof AdminCorrectGameStatsInputSchema>;\n\nexport const RecalculateGameStatsInputSchema = z\n .object({\n gameId: gameIdSchema,\n reason: repairReasonSchema,\n operationId: statsOperationIdSchema,\n dryRun: z.boolean(),\n })\n .strict();\nexport type RecalculateGameStatsInput = z.infer<typeof RecalculateGameStatsInputSchema>;\n\nexport const GameStatsCorrectionSchema = z\n .object({ lineKey: z.string().min(1), field: statCounterKeySchema, value: z.number().int() })\n .strict();\nexport type GameStatsCorrection = z.infer<typeof GameStatsCorrectionSchema>;\n\nconst roundSlotValueSchema = z.number().int().min(0).max(MAX_CURLING_ROUND_POINTS).nullable();\n\n// Two team lines of a game, each holding its sport's fixed round slots.\nconst MAX_ROUND_SLOT_CHANGES = 2 * CURLING_ROUND_COUNT;\n\nconst replacedEntryListSchema = z\n .object({ stored: z.array(gameRosterPlayerIdSchema), rebuilt: z.array(gameRosterPlayerIdSchema) })\n .strict();\n\nexport const GameRepairChangesSchema = z\n .object({\n lines: z.array(\n z\n .object({\n lineKey: z.string().min(1),\n field: z.string().min(1),\n stored: z.number(),\n rebuilt: z.number(),\n })\n .strict(),\n ),\n scores: z.array(\n z.object({ teamId: teamIdSchema, stored: z.number(), rebuilt: z.number() }).strict(),\n ),\n // Present when a round slot changed: each changed slot of a line, a null slot unplayed.\n roundSlots: z\n .array(\n z\n .object({\n lineKey: z.string().min(1),\n slotIndex: z\n .number()\n .int()\n .min(0)\n .max(CURLING_ROUND_COUNT - 1),\n stored: roundSlotValueSchema,\n rebuilt: roundSlotValueSchema,\n })\n .strict(),\n )\n .min(1)\n .max(MAX_ROUND_SLOT_CHANGES)\n .optional(),\n absentRosterPlayerIds: replacedEntryListSchema.optional(),\n nonScoringRosterPlayerIds: replacedEntryListSchema.optional(),\n statEventSequence: z.object({ stored: countSchema, rebuilt: countSchema }).strict().optional(),\n recordRewritten: z\n .object({ pagesBefore: countSchema, pagesAfter: countSchema })\n .strict()\n .optional(),\n })\n .strict();\nexport type GameRepairChanges = z.infer<typeof GameRepairChangesSchema>;\n\nexport const GameStatsRepairResultSchema = z\n .object({\n gameId: gameIdSchema,\n leagueId: leagueIdSchema,\n operationId: statsOperationIdSchema,\n dryRun: z.boolean(),\n outcome: z.enum(GAME_STATS_REPAIR_OUTCOME_KEYS),\n corrections: z.array(GameStatsCorrectionSchema),\n gameChanged: z.boolean(),\n gameChanges: GameRepairChangesSchema,\n destinationChanges: z.array(StatsDestinationChangeSchema),\n })\n .strict();\nexport type GameStatsRepairResult = z.infer<typeof GameStatsRepairResultSchema>;\n\nconst EnteredHistoricalStatsSchema = z\n .object(\n Object.fromEntries(HISTORICAL_STAT_KEYS.map((key) => [key, enteredStatCountSchema])) as Record<\n keyof HistoricalStats,\n typeof enteredStatCountSchema\n >,\n )\n .strict();\n\nexport const AdminUpdateHistoricalStatsInputSchema = z\n .object({\n userId: userIdSchema,\n sportKey: sportKeySchema,\n stats: EnteredHistoricalStatsSchema,\n reason: repairReasonSchema,\n operationId: statsOperationIdSchema,\n dryRun: z.boolean(),\n })\n .strict();\nexport type AdminUpdateHistoricalStatsInput = z.infer<typeof AdminUpdateHistoricalStatsInputSchema>;\n\nexport const AdminUpdateHistoricalStatsResultSchema = z\n .object({\n userId: userIdSchema,\n sportKey: sportKeySchema,\n operationId: statsOperationIdSchema,\n dryRun: z.boolean(),\n outcome: z.enum(GAME_STATS_REPAIR_OUTCOME_KEYS),\n baselineBefore: HistoricalStatsSchema.nullable(),\n changes: z.array(StatsDestinationChangeSchema),\n })\n .strict();\nexport type AdminUpdateHistoricalStatsResult = z.infer<\n typeof AdminUpdateHistoricalStatsResultSchema\n>;\n\nexport const RunStatsValidationInputSchema = z\n .object({ operationId: statsOperationIdSchema, scope: StatsValidationScopeSchema.strict() })\n .strict();\nexport type RunStatsValidationInput = z.infer<typeof RunStatsValidationInputSchema>;\n\nexport const RunStatsValidationResultSchema = z\n .object({\n reportId: z.string().min(1),\n complete: z.boolean(),\n summary: StatsValidationSummarySchema,\n discrepancyCounts: StatsValidationReportSchema.shape.discrepancyCounts,\n })\n .strict();\nexport type RunStatsValidationResult = z.infer<typeof RunStatsValidationResultSchema>;\n\nexport const AdminDeleteStatsValidationReportInputSchema = z\n .object({ reportId: statsValidationReportIdSchema })\n .strict();\nexport type AdminDeleteStatsValidationReportInput = z.infer<\n typeof AdminDeleteStatsValidationReportInputSchema\n>;\n\nexport const AdminDeleteStatsValidationReportResultSchema = z\n .object({ reportId: statsValidationReportIdSchema })\n .strict();\nexport type AdminDeleteStatsValidationReportResult = z.infer<\n typeof AdminDeleteStatsValidationReportResultSchema\n>;\n"]}
1
+ {"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/schemas/stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,iCAAiC,GAClC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,YAAY,EACZ,wBAAwB,EACxB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,6BAA6B,EAC7B,YAAY,EACZ,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GAEtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,8BAA8B,EAC9B,4CAA4C,GAC7C,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,uBAAuB,G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OAAO,EAAE;IACnB,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC;IAC/C,cAAc,EAAE,qBAAqB,CAAC,QAAQ,EAAE;IAChD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,4BAA4B,CAAC;CAC/C,CAAC;KACD,MAAM,EAAE,CAAC;AAKZ,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC;KAC3C,MAAM,CAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,KAAK,EAAE,0BAA0B,CAAC,MAAM,EAAE,EAAE,CAAC;KAC3F,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC;KAC5C,MAAM,CAAC;IACN,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,OAAO,EAAE,4BAA4B;IACrC,iBAAiB,EAAE,2BAA2B,CAAC,KAAK,CAAC,iBAAiB;CACvE,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,2CAA2C,GAAG,CAAC;KACzD,MAAM,CAAC,EAAE,QAAQ,EAAE,6BAA6B,EAAE,CAAC;KACnD,MAAM,EAAE,CAAC;AAKZ,MAAM,CAAC,MAAM,4CAA4C,GAAG,CAAC;KAC1D,MAAM,CAAC,EAAE,QAAQ,EAAE,6BAA6B,EAAE,CAAC;KACnD,MAAM,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n CURLING_ROUND_COUNT,\n MAX_CURLING_ROUND_POINTS,\n MAX_GAME_STATS_CORRECTION_TARGETS,\n} from '../constants/sports.js';\nimport {\n countSchema,\n enteredStatCountSchema,\n gameIdSchema,\n gameRosterPlayerIdSchema,\n leagueIdSchema,\n repairReasonSchema,\n sportKeySchema,\n statCounterKeySchema,\n statsOperationIdSchema,\n statsValidationReportIdSchema,\n teamIdSchema,\n userIdSchema,\n} from '../doc-schemas/atoms.js';\nimport {\n StatsDestinationChangeSchema,\n StatsOperationCountsSchema,\n} from '../doc-schemas/stats-operation.js';\nimport {\n StatsValidationReportSchema,\n StatsValidationScopeSchema,\n StatsValidationSummarySchema,\n} from '../doc-schemas/system.js';\nimport {\n HISTORICAL_STAT_KEYS,\n HistoricalStatsSchema,\n type HistoricalStats,\n} from '../doc-schemas/user-profile.js';\nimport {\n GAME_FINALIZE_OUTCOME_KEYS,\n GAME_REOPEN_OUTCOME_KEYS,\n GAME_STATS_REPAIR_OUTCOME_KEYS,\n UNROSTERED_STAT_LINE_RESOLUTION_OUTCOME_KEYS,\n} from '../types/stats.js';\n\nexport const FinalizeGameInputSchema = z.object({ gameId: gameIdSchema }).strict();\nexport type FinalizeGameInput = z.infer<typeof FinalizeGameInputSchema>;\n\nexport const FinalizeGameResultSchema = z\n .object({\n gameId: gameIdSchema,\n leagueId: leagueIdSchema,\n outcome: z.enum(GAME_FINALIZE_OUTCOME_KEYS),\n nonScoringRosterPlayerIds: z.array(gameRosterPlayerIdSchema),\n })\n .strict();\nexport type FinalizeGameResult = z.infer<typeof FinalizeGameResultSchema>;\n\nexport const ReopenGameInputSchema = z\n .object({ gameId: gameIdSchema, reason: repairReasonSchema })\n .strict();\nexport type ReopenGameInput = z.infer<typeof ReopenGameInputSchema>;\n\nexport const ReopenGameResultSchema = z\n .object({\n gameId: gameIdSchema,\n leagueId: leagueIdSchema,\n outcome: z.enum(GAME_REOPEN_OUTCOME_KEYS),\n })\n .strict();\nexport type ReopenGameResult = z.infer<typeof ReopenGameResultSchema>;\n\nexport const AdminResolveUnrosteredStatLineInputSchema = z\n .object({\n gameId: gameIdSchema,\n userId: userIdSchema,\n teamId: teamIdSchema,\n reason: repairReasonSchema,\n dryRun: z.boolean().optional(),\n })\n .strict();\nexport type AdminResolveUnrosteredStatLineInput = z.infer<\n typeof AdminResolveUnrosteredStatLineInputSchema\n>;\n\nexport const AdminResolveUnrosteredStatLineResultSchema = z\n .object({\n gameId: gameIdSchema,\n userId: userIdSchema,\n teamId: teamIdSchema,\n outcome: z.enum(UNROSTERED_STAT_LINE_RESOLUTION_OUTCOME_KEYS),\n gameConverts: z.boolean(),\n })\n .strict();\nexport type AdminResolveUnrosteredStatLineResult = z.infer<\n typeof AdminResolveUnrosteredStatLineResultSchema\n>;\n\nconst statsRepairFields = {\n reason: repairReasonSchema,\n operationId: statsOperationIdSchema,\n dryRun: z.boolean(),\n resumeAfter: z.string().min(1).optional(),\n};\n\nconst cursorOnlyOnDryRun = (input: { dryRun: boolean; resumeAfter?: string }): boolean =>\n input.dryRun || input.resumeAfter === undefined;\nconst CURSOR_ONLY_ON_DRY_RUN = {\n message: 'A real run resumes from its operation; only a dry run takes a cursor.',\n path: ['resumeAfter'],\n};\n\nexport const RecalculateLeagueStatsInputSchema = z\n .object({ leagueId: leagueIdSchema, ...statsRepairFields })\n .strict()\n .refine(cursorOnlyOnDryRun, CURSOR_ONLY_ON_DRY_RUN);\nexport type RecalculateLeagueStatsInput = z.infer<typeof RecalculateLeagueStatsInputSchema>;\n\nexport const RecalculateAllLeagueStatsInputSchema = z\n .object({ ...statsRepairFields })\n .strict()\n .refine(cursorOnlyOnDryRun, CURSOR_ONLY_ON_DRY_RUN);\nexport type RecalculateAllLeagueStatsInput = z.infer<typeof RecalculateAllLeagueStatsInputSchema>;\n\nexport const RecalculateUserStatsInputSchema = z\n .object({ userId: userIdSchema, ...statsRepairFields })\n .strict()\n .refine(cursorOnlyOnDryRun, CURSOR_ONLY_ON_DRY_RUN);\nexport type RecalculateUserStatsInput = z.infer<typeof RecalculateUserStatsInputSchema>;\n\nexport const RecalculateAllUserStatsInputSchema = z\n .object({ ...statsRepairFields })\n .strict()\n .refine(cursorOnlyOnDryRun, CURSOR_ONLY_ON_DRY_RUN);\nexport type RecalculateAllUserStatsInput = z.infer<typeof RecalculateAllUserStatsInputSchema>;\n\nexport const RecalculateHallOfFameInputSchema = z\n .object({ sportKey: sportKeySchema, userId: userIdSchema.optional(), ...statsRepairFields })\n .strict()\n .refine(cursorOnlyOnDryRun, CURSOR_ONLY_ON_DRY_RUN);\nexport type RecalculateHallOfFameInput = z.infer<typeof RecalculateHallOfFameInputSchema>;\n\nexport const StatsRebuildResultSchema = z\n .object({\n operationId: statsOperationIdSchema,\n dryRun: z.boolean(),\n complete: z.boolean(),\n nextResumeAfter: z.string().min(1).nullable(),\n counts: StatsOperationCountsSchema,\n changes: z.array(StatsDestinationChangeSchema),\n changesTruncated: z.boolean(),\n scopeChanged: z.boolean(),\n })\n .strict();\nexport type StatsRebuildResult = z.infer<typeof StatsRebuildResultSchema>;\n\nexport const GameStatsCorrectionTargetSchema = z\n .object({\n teamId: teamIdSchema,\n playerUserId: userIdSchema.optional(),\n stat: statCounterKeySchema,\n value: enteredStatCountSchema,\n })\n .strict();\nexport type GameStatsCorrectionTarget = z.infer<typeof GameStatsCorrectionTargetSchema>;\n\nexport const AdminCorrectGameStatsInputSchema = z\n .object({\n gameId: gameIdSchema,\n targets: z\n .array(GameStatsCorrectionTargetSchema)\n .min(1)\n .max(MAX_GAME_STATS_CORRECTION_TARGETS)\n .optional(),\n keepStored: z.literal(true).optional(),\n reason: repairReasonSchema,\n operationId: statsOperationIdSchema,\n dryRun: z.boolean(),\n })\n .strict()\n .refine((input) => (input.targets === undefined) !== (input.keepStored === undefined), {\n message: 'Give the values to set, or keep the stored numbers — one of the two.',\n path: ['targets'],\n });\nexport type AdminCorrectGameStatsInput = z.infer<typeof AdminCorrectGameStatsInputSchema>;\n\nexport const RecalculateGameStatsInputSchema = z\n .object({\n gameId: gameIdSchema,\n reason: repairReasonSchema,\n operationId: statsOperationIdSchema,\n dryRun: z.boolean(),\n })\n .strict();\nexport type RecalculateGameStatsInput = z.infer<typeof RecalculateGameStatsInputSchema>;\n\nexport const GameStatsCorrectionSchema = z\n .object({ lineKey: z.string().min(1), field: statCounterKeySchema, value: z.number().int() })\n .strict();\nexport type GameStatsCorrection = z.infer<typeof GameStatsCorrectionSchema>;\n\nconst roundSlotValueSchema = z.number().int().min(0).max(MAX_CURLING_ROUND_POINTS).nullable();\n\n// Two team lines of a game, each holding its sport's fixed round slots.\nconst MAX_ROUND_SLOT_CHANGES = 2 * CURLING_ROUND_COUNT;\n\nconst replacedEntryListSchema = z\n .object({ stored: z.array(gameRosterPlayerIdSchema), rebuilt: z.array(gameRosterPlayerIdSchema) })\n .strict();\n\nexport const GameRepairChangesSchema = z\n .object({\n lines: z.array(\n z\n .object({\n lineKey: z.string().min(1),\n field: z.string().min(1),\n stored: z.number(),\n rebuilt: z.number(),\n })\n .strict(),\n ),\n scores: z.array(\n z.object({ teamId: teamIdSchema, stored: z.number(), rebuilt: z.number() }).strict(),\n ),\n // Present when a round slot changed: each changed slot of a line, a null slot unplayed.\n roundSlots: z\n .array(\n z\n .object({\n lineKey: z.string().min(1),\n slotIndex: z\n .number()\n .int()\n .min(0)\n .max(CURLING_ROUND_COUNT - 1),\n stored: roundSlotValueSchema,\n rebuilt: roundSlotValueSchema,\n })\n .strict(),\n )\n .min(1)\n .max(MAX_ROUND_SLOT_CHANGES)\n .optional(),\n absentRosterPlayerIds: replacedEntryListSchema.optional(),\n nonScoringRosterPlayerIds: replacedEntryListSchema.optional(),\n statEventSequence: z.object({ stored: countSchema, rebuilt: countSchema }).strict().optional(),\n recordRewritten: z.literal(true).optional(),\n })\n .strict();\nexport type GameRepairChanges = z.infer<typeof GameRepairChangesSchema>;\n\nexport const GameStatsRepairResultSchema = z\n .object({\n gameId: gameIdSchema,\n leagueId: leagueIdSchema,\n operationId: statsOperationIdSchema,\n dryRun: z.boolean(),\n outcome: z.enum(GAME_STATS_REPAIR_OUTCOME_KEYS),\n corrections: z.array(GameStatsCorrectionSchema),\n gameChanged: z.boolean(),\n gameChanges: GameRepairChangesSchema,\n destinationChanges: z.array(StatsDestinationChangeSchema),\n })\n .strict();\nexport type GameStatsRepairResult = z.infer<typeof GameStatsRepairResultSchema>;\n\nconst EnteredHistoricalStatsSchema = z\n .object(\n Object.fromEntries(HISTORICAL_STAT_KEYS.map((key) => [key, enteredStatCountSchema])) as Record<\n keyof HistoricalStats,\n typeof enteredStatCountSchema\n >,\n )\n .strict();\n\nexport const AdminUpdateHistoricalStatsInputSchema = z\n .object({\n userId: userIdSchema,\n sportKey: sportKeySchema,\n stats: EnteredHistoricalStatsSchema,\n reason: repairReasonSchema,\n operationId: statsOperationIdSchema,\n dryRun: z.boolean(),\n })\n .strict();\nexport type AdminUpdateHistoricalStatsInput = z.infer<typeof AdminUpdateHistoricalStatsInputSchema>;\n\nexport const AdminUpdateHistoricalStatsResultSchema = z\n .object({\n userId: userIdSchema,\n sportKey: sportKeySchema,\n operationId: statsOperationIdSchema,\n dryRun: z.boolean(),\n outcome: z.enum(GAME_STATS_REPAIR_OUTCOME_KEYS),\n baselineBefore: HistoricalStatsSchema.nullable(),\n changes: z.array(StatsDestinationChangeSchema),\n })\n .strict();\nexport type AdminUpdateHistoricalStatsResult = z.infer<\n typeof AdminUpdateHistoricalStatsResultSchema\n>;\n\nexport const RunStatsValidationInputSchema = z\n .object({ operationId: statsOperationIdSchema, scope: StatsValidationScopeSchema.strict() })\n .strict();\nexport type RunStatsValidationInput = z.infer<typeof RunStatsValidationInputSchema>;\n\nexport const RunStatsValidationResultSchema = z\n .object({\n reportId: z.string().min(1),\n complete: z.boolean(),\n summary: StatsValidationSummarySchema,\n discrepancyCounts: StatsValidationReportSchema.shape.discrepancyCounts,\n })\n .strict();\nexport type RunStatsValidationResult = z.infer<typeof RunStatsValidationResultSchema>;\n\nexport const AdminDeleteStatsValidationReportInputSchema = z\n .object({ reportId: statsValidationReportIdSchema })\n .strict();\nexport type AdminDeleteStatsValidationReportInput = z.infer<\n typeof AdminDeleteStatsValidationReportInputSchema\n>;\n\nexport const AdminDeleteStatsValidationReportResultSchema = z\n .object({ reportId: statsValidationReportIdSchema })\n .strict();\nexport type AdminDeleteStatsValidationReportResult = z.infer<\n typeof AdminDeleteStatsValidationReportResultSchema\n>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttt-productions/q-core",
3
- "version": "0.1.46",
3
+ "version": "0.1.48",
4
4
  "description": "Core types, Firestore path constants, zod schemas, and shared constants for Q-Sports",
5
5
  "repository": {
6
6
  "type": "git",