@ttt-productions/q-core 0.1.45 → 0.1.47

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.
Files changed (45) hide show
  1. package/dist/constants/sports.d.ts +0 -2
  2. package/dist/constants/sports.d.ts.map +1 -1
  3. package/dist/constants/sports.js +0 -3
  4. package/dist/constants/sports.js.map +1 -1
  5. package/dist/doc-schemas/aggregate-stats.d.ts +60 -31
  6. package/dist/doc-schemas/aggregate-stats.d.ts.map +1 -1
  7. package/dist/doc-schemas/aggregate-stats.js +15 -11
  8. package/dist/doc-schemas/aggregate-stats.js.map +1 -1
  9. package/dist/doc-schemas/game-stat-history.d.ts +2 -660
  10. package/dist/doc-schemas/game-stat-history.d.ts.map +1 -1
  11. package/dist/doc-schemas/game-stat-history.js +6 -23
  12. package/dist/doc-schemas/game-stat-history.js.map +1 -1
  13. package/dist/doc-schemas/league-team.d.ts +767 -14
  14. package/dist/doc-schemas/league-team.d.ts.map +1 -1
  15. package/dist/doc-schemas/league-team.js +21 -5
  16. package/dist/doc-schemas/league-team.js.map +1 -1
  17. package/dist/doc-schemas/registry.d.ts +327 -227
  18. package/dist/doc-schemas/registry.d.ts.map +1 -1
  19. package/dist/doc-schemas/registry.js +2 -2
  20. package/dist/doc-schemas/registry.js.map +1 -1
  21. package/dist/ids/stat-event-ids.d.ts +0 -1
  22. package/dist/ids/stat-event-ids.d.ts.map +1 -1
  23. package/dist/ids/stat-event-ids.js +0 -8
  24. package/dist/ids/stat-event-ids.js.map +1 -1
  25. package/dist/paths/collections.d.ts +1 -0
  26. package/dist/paths/collections.d.ts.map +1 -1
  27. package/dist/paths/collections.js +1 -0
  28. package/dist/paths/collections.js.map +1 -1
  29. package/dist/paths/path-builders.d.ts +1 -2
  30. package/dist/paths/path-builders.d.ts.map +1 -1
  31. package/dist/paths/path-builders.js +2 -7
  32. package/dist/paths/path-builders.js.map +1 -1
  33. package/dist/schemas/stats.d.ts +2 -8
  34. package/dist/schemas/stats.d.ts.map +1 -1
  35. package/dist/schemas/stats.js +1 -4
  36. package/dist/schemas/stats.js.map +1 -1
  37. package/dist/schemas/uploads.js +1 -1
  38. package/dist/schemas/uploads.js.map +1 -1
  39. package/dist/sports/finalized-record.d.ts +4 -13
  40. package/dist/sports/finalized-record.d.ts.map +1 -1
  41. package/dist/sports/finalized-record.js +13 -66
  42. package/dist/sports/finalized-record.js.map +1 -1
  43. package/dist/upload-variables/picture-upload-variables.js +1 -1
  44. package/dist/upload-variables/picture-upload-variables.js.map +1 -1
  45. package/package.json +2 -2
@@ -1,33 +1,16 @@
1
1
  import { z } from 'zod';
2
- import { MAX_STAT_HISTORY_PAGES, STAT_HISTORY_PAGE_SIZE } from '../constants/sports.js';
3
- import { buildStatHistoryPageId } from '../ids/stat-event-ids.js';
2
+ import { MAX_STAT_EVENTS_PER_GAME } from '../constants/business.js';
4
3
  import { gameRosterPlayerIdSchema, leagueTypeSchema, teamIdSchema } from './atoms.js';
5
4
  import { GameStatEventSchema } from './game-stats.js';
6
- const pageEventsSchema = z
7
- .array(GameStatEventSchema)
8
- .max(STAT_HISTORY_PAGE_SIZE)
9
- .refine((events) => events.every((event, index) => index === 0 || events[index - 1].sequence < event.sequence), 'A page holds its events in sequence order.');
10
- export const GameStatHistoryFirstPageSchema = z.object({
11
- events: pageEventsSchema,
12
- pageCount: z.number().int().positive().max(MAX_STAT_HISTORY_PAGES),
5
+ export const GameStatHistoryRecordSchema = z.object({
6
+ events: z
7
+ .array(GameStatEventSchema)
8
+ .max(MAX_STAT_EVENTS_PER_GAME)
9
+ .refine((events) => events.every((event, index) => index === 0 || events[index - 1].sequence < event.sequence), 'A finalized record holds its events in sequence order.'),
13
10
  leagueType: leagueTypeSchema,
14
11
  teamIds: z.array(teamIdSchema).min(1).max(2),
15
12
  rosterPlayerIds: z.array(gameRosterPlayerIdSchema),
16
13
  absentRosterPlayerIds: z.array(gameRosterPlayerIdSchema),
17
14
  nonScoringRosterPlayerIds: z.array(gameRosterPlayerIdSchema),
18
15
  });
19
- export const GameStatHistoryContinuationPageSchema = z.object({
20
- events: pageEventsSchema.refine((events) => events.length > 0, 'A continuation page holds events.'),
21
- });
22
- export const GameStatHistoryPageSchema = z.union([
23
- GameStatHistoryFirstPageSchema,
24
- GameStatHistoryContinuationPageSchema,
25
- ]);
26
- // Both page shapes are plain, so a first page missing part of its snapshot still parses as a
27
- // continuation page under the union. A page's id says which shape it holds: parsing by id refuses it.
28
- export function statHistoryPageSchemaFor(pageId) {
29
- return pageId === buildStatHistoryPageId(0)
30
- ? GameStatHistoryFirstPageSchema
31
- : GameStatHistoryContinuationPageSchema;
32
- }
33
16
  //# sourceMappingURL=game-stat-history.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"game-stat-history.js","sourceRoot":"","sources":["../../src/doc-schemas/game-stat-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,gBAAgB,GAAG,CAAC;KACvB,KAAK,CAAC,mBAAmB,CAAC;KAC1B,GAAG,CAAC,sBAAsB,CAAC;KAC3B,MAAM,CACL,CAAC,MAAM,EAAE,EAAE,CACT,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,EAC5F,4CAA4C,CAC7C,CAAC;AAEJ,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,MAAM,EAAE,gBAAgB;IACxB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,sBAAsB,CAAC;IAClE,UAAU,EAAE,gBAAgB;IAC5B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5C,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;IAClD,qBAAqB,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;IACxD,yBAAyB,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;CAC7D,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5D,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAC7B,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAC7B,mCAAmC,CACpC;CACF,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC/C,8BAA8B;IAC9B,qCAAqC;CACtC,CAAC,CAAC;AAGH,6FAA6F;AAC7F,sGAAsG;AACtG,MAAM,UAAU,wBAAwB,CACtC,MAAc;IAEd,OAAO,MAAM,KAAK,sBAAsB,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC,8BAA8B;QAChC,CAAC,CAAC,qCAAqC,CAAC;AAC5C,CAAC","sourcesContent":["import { z } from 'zod';\nimport { MAX_STAT_HISTORY_PAGES, STAT_HISTORY_PAGE_SIZE } from '../constants/sports.js';\nimport { buildStatHistoryPageId } from '../ids/stat-event-ids.js';\nimport { gameRosterPlayerIdSchema, leagueTypeSchema, teamIdSchema } from './atoms.js';\nimport { GameStatEventSchema } from './game-stats.js';\n\nconst pageEventsSchema = z\n .array(GameStatEventSchema)\n .max(STAT_HISTORY_PAGE_SIZE)\n .refine(\n (events) =>\n events.every((event, index) => index === 0 || events[index - 1].sequence < event.sequence),\n 'A page holds its events in sequence order.',\n );\n\nexport const GameStatHistoryFirstPageSchema = z.object({\n events: pageEventsSchema,\n pageCount: z.number().int().positive().max(MAX_STAT_HISTORY_PAGES),\n leagueType: leagueTypeSchema,\n teamIds: z.array(teamIdSchema).min(1).max(2),\n rosterPlayerIds: z.array(gameRosterPlayerIdSchema),\n absentRosterPlayerIds: z.array(gameRosterPlayerIdSchema),\n nonScoringRosterPlayerIds: z.array(gameRosterPlayerIdSchema),\n});\nexport type GameStatHistoryFirstPage = z.infer<typeof GameStatHistoryFirstPageSchema>;\n\nexport const GameStatHistoryContinuationPageSchema = z.object({\n events: pageEventsSchema.refine(\n (events) => events.length > 0,\n 'A continuation page holds events.',\n ),\n});\nexport type GameStatHistoryContinuationPage = z.infer<typeof GameStatHistoryContinuationPageSchema>;\n\nexport const GameStatHistoryPageSchema = z.union([\n GameStatHistoryFirstPageSchema,\n GameStatHistoryContinuationPageSchema,\n]);\nexport type GameStatHistoryPage = z.infer<typeof GameStatHistoryPageSchema>;\n\n// Both page shapes are plain, so a first page missing part of its snapshot still parses as a\n// continuation page under the union. A page's id says which shape it holds: parsing by id refuses it.\nexport function statHistoryPageSchemaFor(\n pageId: string,\n): typeof GameStatHistoryFirstPageSchema | typeof GameStatHistoryContinuationPageSchema {\n return pageId === buildStatHistoryPageId(0)\n ? GameStatHistoryFirstPageSchema\n : GameStatHistoryContinuationPageSchema;\n}\n"]}
1
+ {"version":3,"file":"game-stat-history.js","sourceRoot":"","sources":["../../src/doc-schemas/game-stat-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,MAAM,EAAE,CAAC;SACN,KAAK,CAAC,mBAAmB,CAAC;SAC1B,GAAG,CAAC,wBAAwB,CAAC;SAC7B,MAAM,CACL,CAAC,MAAM,EAAE,EAAE,CACT,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,EAC5F,wDAAwD,CACzD;IACH,UAAU,EAAE,gBAAgB;IAC5B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5C,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;IAClD,qBAAqB,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;IACxD,yBAAyB,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;CAC7D,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { MAX_STAT_EVENTS_PER_GAME } from '../constants/business.js';\nimport { gameRosterPlayerIdSchema, leagueTypeSchema, teamIdSchema } from './atoms.js';\nimport { GameStatEventSchema } from './game-stats.js';\n\nexport const GameStatHistoryRecordSchema = z.object({\n events: z\n .array(GameStatEventSchema)\n .max(MAX_STAT_EVENTS_PER_GAME)\n .refine(\n (events) =>\n events.every((event, index) => index === 0 || events[index - 1].sequence < event.sequence),\n 'A finalized record holds its events in sequence order.',\n ),\n leagueType: leagueTypeSchema,\n teamIds: z.array(teamIdSchema).min(1).max(2),\n rosterPlayerIds: z.array(gameRosterPlayerIdSchema),\n absentRosterPlayerIds: z.array(gameRosterPlayerIdSchema),\n nonScoringRosterPlayerIds: z.array(gameRosterPlayerIdSchema),\n});\nexport type GameStatHistoryRecord = z.infer<typeof GameStatHistoryRecordSchema>;\n"]}