@ttt-productions/q-core 0.1.28 → 0.1.29

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 (472) hide show
  1. package/dist/constants/admin-views.d.ts.map +1 -1
  2. package/dist/constants/admin-views.js +0 -3
  3. package/dist/constants/admin-views.js.map +1 -1
  4. package/dist/constants/business.d.ts.map +1 -1
  5. package/dist/constants/business.js +0 -52
  6. package/dist/constants/business.js.map +1 -1
  7. package/dist/constants/deployment.d.ts +0 -2
  8. package/dist/constants/deployment.d.ts.map +1 -1
  9. package/dist/constants/deployment.js +0 -2
  10. package/dist/constants/deployment.js.map +1 -1
  11. package/dist/constants/media.d.ts.map +1 -1
  12. package/dist/constants/media.js +4 -30
  13. package/dist/constants/media.js.map +1 -1
  14. package/dist/constants/scheduled-jobs.d.ts +0 -25
  15. package/dist/constants/scheduled-jobs.d.ts.map +1 -1
  16. package/dist/constants/scheduled-jobs.js +0 -26
  17. package/dist/constants/scheduled-jobs.js.map +1 -1
  18. package/dist/constants/sports.d.ts.map +1 -1
  19. package/dist/constants/sports.js +2 -25
  20. package/dist/constants/sports.js.map +1 -1
  21. package/dist/constants/storage-keys.d.ts +0 -38
  22. package/dist/constants/storage-keys.d.ts.map +1 -1
  23. package/dist/constants/storage-keys.js +0 -41
  24. package/dist/constants/storage-keys.js.map +1 -1
  25. package/dist/constants/telemetry.d.ts +0 -3
  26. package/dist/constants/telemetry.d.ts.map +1 -1
  27. package/dist/constants/telemetry.js +2 -11
  28. package/dist/constants/telemetry.js.map +1 -1
  29. package/dist/doc-schemas/admin-notifications.d.ts +0 -1
  30. package/dist/doc-schemas/admin-notifications.d.ts.map +1 -1
  31. package/dist/doc-schemas/admin-notifications.js +0 -41
  32. package/dist/doc-schemas/admin-notifications.js.map +1 -1
  33. package/dist/doc-schemas/aggregate-stats.d.ts.map +1 -1
  34. package/dist/doc-schemas/aggregate-stats.js +0 -35
  35. package/dist/doc-schemas/aggregate-stats.js.map +1 -1
  36. package/dist/doc-schemas/atoms.d.ts +0 -17
  37. package/dist/doc-schemas/atoms.d.ts.map +1 -1
  38. package/dist/doc-schemas/atoms.js +0 -36
  39. package/dist/doc-schemas/atoms.js.map +1 -1
  40. package/dist/doc-schemas/audit-event.d.ts.map +1 -1
  41. package/dist/doc-schemas/audit-event.js +0 -8
  42. package/dist/doc-schemas/audit-event.js.map +1 -1
  43. package/dist/doc-schemas/award-group-grant.d.ts +0 -6
  44. package/dist/doc-schemas/award-group-grant.d.ts.map +1 -1
  45. package/dist/doc-schemas/award-group-grant.js +0 -25
  46. package/dist/doc-schemas/award-group-grant.js.map +1 -1
  47. package/dist/doc-schemas/catalogs.d.ts.map +1 -1
  48. package/dist/doc-schemas/catalogs.js +0 -12
  49. package/dist/doc-schemas/catalogs.js.map +1 -1
  50. package/dist/doc-schemas/firestore-primitives.d.ts.map +1 -1
  51. package/dist/doc-schemas/firestore-primitives.js +0 -5
  52. package/dist/doc-schemas/firestore-primitives.js.map +1 -1
  53. package/dist/doc-schemas/gallery.d.ts.map +1 -1
  54. package/dist/doc-schemas/gallery.js +0 -15
  55. package/dist/doc-schemas/gallery.js.map +1 -1
  56. package/dist/doc-schemas/game-location.d.ts.map +1 -1
  57. package/dist/doc-schemas/game-location.js +2 -11
  58. package/dist/doc-schemas/game-location.js.map +1 -1
  59. package/dist/doc-schemas/game-stat-history.d.ts.map +1 -1
  60. package/dist/doc-schemas/game-stat-history.js +0 -9
  61. package/dist/doc-schemas/game-stat-history.js.map +1 -1
  62. package/dist/doc-schemas/game-stats.d.ts.map +1 -1
  63. package/dist/doc-schemas/game-stats.js +0 -56
  64. package/dist/doc-schemas/game-stats.js.map +1 -1
  65. package/dist/doc-schemas/league-team.d.ts.map +1 -1
  66. package/dist/doc-schemas/league-team.js +6 -29
  67. package/dist/doc-schemas/league-team.js.map +1 -1
  68. package/dist/doc-schemas/membership-roster-sync.d.ts.map +1 -1
  69. package/dist/doc-schemas/membership-roster-sync.js +0 -17
  70. package/dist/doc-schemas/membership-roster-sync.js.map +1 -1
  71. package/dist/doc-schemas/migration-console.d.ts +0 -10
  72. package/dist/doc-schemas/migration-console.d.ts.map +1 -1
  73. package/dist/doc-schemas/migration-console.js +0 -32
  74. package/dist/doc-schemas/migration-console.js.map +1 -1
  75. package/dist/doc-schemas/pending-media.d.ts.map +1 -1
  76. package/dist/doc-schemas/pending-media.js +0 -17
  77. package/dist/doc-schemas/pending-media.js.map +1 -1
  78. package/dist/doc-schemas/picture-retirement.d.ts.map +1 -1
  79. package/dist/doc-schemas/picture-retirement.js +0 -10
  80. package/dist/doc-schemas/picture-retirement.js.map +1 -1
  81. package/dist/doc-schemas/publicUser.d.ts.map +1 -1
  82. package/dist/doc-schemas/publicUser.js +0 -5
  83. package/dist/doc-schemas/publicUser.js.map +1 -1
  84. package/dist/doc-schemas/registration-start.d.ts.map +1 -1
  85. package/dist/doc-schemas/registration-start.js +2 -5
  86. package/dist/doc-schemas/registration-start.js.map +1 -1
  87. package/dist/doc-schemas/registry.d.ts.map +1 -1
  88. package/dist/doc-schemas/registry.js +0 -10
  89. package/dist/doc-schemas/registry.js.map +1 -1
  90. package/dist/doc-schemas/reserved-display-name.d.ts.map +1 -1
  91. package/dist/doc-schemas/reserved-display-name.js +0 -5
  92. package/dist/doc-schemas/reserved-display-name.js.map +1 -1
  93. package/dist/doc-schemas/sport-game.d.ts.map +1 -1
  94. package/dist/doc-schemas/sport-game.js +1 -29
  95. package/dist/doc-schemas/sport-game.js.map +1 -1
  96. package/dist/doc-schemas/sport-league.d.ts +0 -9
  97. package/dist/doc-schemas/sport-league.d.ts.map +1 -1
  98. package/dist/doc-schemas/sport-league.js +4 -26
  99. package/dist/doc-schemas/sport-league.js.map +1 -1
  100. package/dist/doc-schemas/stats-operation.d.ts.map +1 -1
  101. package/dist/doc-schemas/stats-operation.js +2 -44
  102. package/dist/doc-schemas/stats-operation.js.map +1 -1
  103. package/dist/doc-schemas/status-reconcile-queue.d.ts +0 -6
  104. package/dist/doc-schemas/status-reconcile-queue.d.ts.map +1 -1
  105. package/dist/doc-schemas/status-reconcile-queue.js +0 -13
  106. package/dist/doc-schemas/status-reconcile-queue.js.map +1 -1
  107. package/dist/doc-schemas/sweep-state.d.ts.map +1 -1
  108. package/dist/doc-schemas/sweep-state.js +4 -20
  109. package/dist/doc-schemas/sweep-state.js.map +1 -1
  110. package/dist/doc-schemas/system.d.ts.map +1 -1
  111. package/dist/doc-schemas/system.js +1 -27
  112. package/dist/doc-schemas/system.js.map +1 -1
  113. package/dist/doc-schemas/team-membership.d.ts.map +1 -1
  114. package/dist/doc-schemas/team-membership.js +0 -10
  115. package/dist/doc-schemas/team-membership.js.map +1 -1
  116. package/dist/doc-schemas/user-profile.d.ts +0 -1
  117. package/dist/doc-schemas/user-profile.d.ts.map +1 -1
  118. package/dist/doc-schemas/user-profile.js +0 -28
  119. package/dist/doc-schemas/user-profile.js.map +1 -1
  120. package/dist/doc-schemas/waiver-template.d.ts.map +1 -1
  121. package/dist/doc-schemas/waiver-template.js +4 -25
  122. package/dist/doc-schemas/waiver-template.js.map +1 -1
  123. package/dist/doc-schemas/waivers-and-hardware.d.ts.map +1 -1
  124. package/dist/doc-schemas/waivers-and-hardware.js +0 -20
  125. package/dist/doc-schemas/waivers-and-hardware.js.map +1 -1
  126. package/dist/domain-events/domain-events.d.ts.map +1 -1
  127. package/dist/domain-events/domain-events.js +0 -67
  128. package/dist/domain-events/domain-events.js.map +1 -1
  129. package/dist/ids/award-grant-ids.d.ts.map +1 -1
  130. package/dist/ids/award-grant-ids.js +0 -7
  131. package/dist/ids/award-grant-ids.js.map +1 -1
  132. package/dist/ids/compound-ids.d.ts.map +1 -1
  133. package/dist/ids/compound-ids.js +0 -7
  134. package/dist/ids/compound-ids.js.map +1 -1
  135. package/dist/ids/minted-ids.d.ts.map +1 -1
  136. package/dist/ids/minted-ids.js +4 -14
  137. package/dist/ids/minted-ids.js.map +1 -1
  138. package/dist/ids/notification-ids.d.ts.map +1 -1
  139. package/dist/ids/notification-ids.js +0 -15
  140. package/dist/ids/notification-ids.js.map +1 -1
  141. package/dist/ids/picture-ids.d.ts +0 -5
  142. package/dist/ids/picture-ids.d.ts.map +1 -1
  143. package/dist/ids/picture-ids.js +0 -11
  144. package/dist/ids/picture-ids.js.map +1 -1
  145. package/dist/ids/stat-event-ids.d.ts +0 -6
  146. package/dist/ids/stat-event-ids.d.ts.map +1 -1
  147. package/dist/ids/stat-event-ids.js +0 -15
  148. package/dist/ids/stat-event-ids.js.map +1 -1
  149. package/dist/ids/stats-operation-ids.d.ts.map +1 -1
  150. package/dist/ids/stats-operation-ids.js +0 -7
  151. package/dist/ids/stats-operation-ids.js.map +1 -1
  152. package/dist/ids/waiver-template-ids.d.ts +0 -1
  153. package/dist/ids/waiver-template-ids.d.ts.map +1 -1
  154. package/dist/ids/waiver-template-ids.js +0 -2
  155. package/dist/ids/waiver-template-ids.js.map +1 -1
  156. package/dist/index.d.ts.map +1 -1
  157. package/dist/index.js +0 -2
  158. package/dist/index.js.map +1 -1
  159. package/dist/input-formats/input-formats.d.ts +0 -80
  160. package/dist/input-formats/input-formats.d.ts.map +1 -1
  161. package/dist/input-formats/input-formats.js +0 -86
  162. package/dist/input-formats/input-formats.js.map +1 -1
  163. package/dist/media/file-origins.d.ts +0 -3
  164. package/dist/media/file-origins.d.ts.map +1 -1
  165. package/dist/media/file-origins.js +0 -26
  166. package/dist/media/file-origins.js.map +1 -1
  167. package/dist/media/picture-aspects.d.ts +0 -2
  168. package/dist/media/picture-aspects.d.ts.map +1 -1
  169. package/dist/media/picture-aspects.js +0 -5
  170. package/dist/media/picture-aspects.js.map +1 -1
  171. package/dist/media/picture-url.d.ts +0 -6
  172. package/dist/media/picture-url.d.ts.map +1 -1
  173. package/dist/media/picture-url.js +0 -9
  174. package/dist/media/picture-url.js.map +1 -1
  175. package/dist/media/upload-tray-display.d.ts +0 -3
  176. package/dist/media/upload-tray-display.d.ts.map +1 -1
  177. package/dist/media/upload-tray-display.js +0 -6
  178. package/dist/media/upload-tray-display.js.map +1 -1
  179. package/dist/migration-console/action-ids.d.ts +0 -1
  180. package/dist/migration-console/action-ids.d.ts.map +1 -1
  181. package/dist/migration-console/action-ids.js +2 -45
  182. package/dist/migration-console/action-ids.js.map +1 -1
  183. package/dist/migration-console/manifest.d.ts +0 -24
  184. package/dist/migration-console/manifest.d.ts.map +1 -1
  185. package/dist/migration-console/manifest.js +1 -56
  186. package/dist/migration-console/manifest.js.map +1 -1
  187. package/dist/migration-console/run-state.d.ts +0 -14
  188. package/dist/migration-console/run-state.d.ts.map +1 -1
  189. package/dist/migration-console/run-state.js +0 -16
  190. package/dist/migration-console/run-state.js.map +1 -1
  191. package/dist/notifications/admin-notification-config.d.ts +0 -11
  192. package/dist/notifications/admin-notification-config.d.ts.map +1 -1
  193. package/dist/notifications/admin-notification-config.js +2 -13
  194. package/dist/notifications/admin-notification-config.js.map +1 -1
  195. package/dist/notifications/archive-all.d.ts.map +1 -1
  196. package/dist/notifications/archive-all.js +0 -2
  197. package/dist/notifications/archive-all.js.map +1 -1
  198. package/dist/notifications/occurrences.d.ts +0 -3
  199. package/dist/notifications/occurrences.d.ts.map +1 -1
  200. package/dist/notifications/occurrences.js +0 -7
  201. package/dist/notifications/occurrences.js.map +1 -1
  202. package/dist/paths/app-routes.d.ts +0 -12
  203. package/dist/paths/app-routes.d.ts.map +1 -1
  204. package/dist/paths/app-routes.js +0 -18
  205. package/dist/paths/app-routes.js.map +1 -1
  206. package/dist/paths/collection-groups.d.ts.map +1 -1
  207. package/dist/paths/collection-groups.js +0 -5
  208. package/dist/paths/collection-groups.js.map +1 -1
  209. package/dist/paths/collection-refs.d.ts.map +1 -1
  210. package/dist/paths/collection-refs.js +0 -4
  211. package/dist/paths/collection-refs.js.map +1 -1
  212. package/dist/paths/collections.d.ts +0 -5
  213. package/dist/paths/collections.d.ts.map +1 -1
  214. package/dist/paths/collections.js +0 -68
  215. package/dist/paths/collections.js.map +1 -1
  216. package/dist/paths/path-builders.d.ts.map +1 -1
  217. package/dist/paths/path-builders.js +0 -16
  218. package/dist/paths/path-builders.js.map +1 -1
  219. package/dist/paths/picture-owner-paths.d.ts +0 -4
  220. package/dist/paths/picture-owner-paths.d.ts.map +1 -1
  221. package/dist/paths/picture-owner-paths.js +0 -10
  222. package/dist/paths/picture-owner-paths.js.map +1 -1
  223. package/dist/paths/storage-paths.d.ts +0 -18
  224. package/dist/paths/storage-paths.d.ts.map +1 -1
  225. package/dist/paths/storage-paths.js +0 -23
  226. package/dist/paths/storage-paths.js.map +1 -1
  227. package/dist/paths/utils.d.ts +0 -6
  228. package/dist/paths/utils.d.ts.map +1 -1
  229. package/dist/paths/utils.js +0 -9
  230. package/dist/paths/utils.js.map +1 -1
  231. package/dist/schemas/account-settings.d.ts.map +1 -1
  232. package/dist/schemas/account-settings.js +0 -7
  233. package/dist/schemas/account-settings.js.map +1 -1
  234. package/dist/schemas/admin-notifications.d.ts.map +1 -1
  235. package/dist/schemas/admin-notifications.js +0 -17
  236. package/dist/schemas/admin-notifications.js.map +1 -1
  237. package/dist/schemas/admin-stats.d.ts.map +1 -1
  238. package/dist/schemas/admin-stats.js +0 -9
  239. package/dist/schemas/admin-stats.js.map +1 -1
  240. package/dist/schemas/app-config.d.ts.map +1 -1
  241. package/dist/schemas/app-config.js +0 -10
  242. package/dist/schemas/app-config.js.map +1 -1
  243. package/dist/schemas/atoms.d.ts.map +1 -1
  244. package/dist/schemas/atoms.js +0 -10
  245. package/dist/schemas/atoms.js.map +1 -1
  246. package/dist/schemas/awards.d.ts.map +1 -1
  247. package/dist/schemas/awards.js +0 -29
  248. package/dist/schemas/awards.js.map +1 -1
  249. package/dist/schemas/dead-letters.d.ts +0 -3
  250. package/dist/schemas/dead-letters.d.ts.map +1 -1
  251. package/dist/schemas/dead-letters.js +0 -15
  252. package/dist/schemas/dead-letters.js.map +1 -1
  253. package/dist/schemas/game-locations.d.ts.map +1 -1
  254. package/dist/schemas/game-locations.js +0 -6
  255. package/dist/schemas/game-locations.js.map +1 -1
  256. package/dist/schemas/hardware-loan-contracts.d.ts.map +1 -1
  257. package/dist/schemas/hardware-loan-contracts.js +0 -13
  258. package/dist/schemas/hardware-loan-contracts.js.map +1 -1
  259. package/dist/schemas/index.d.ts.map +1 -1
  260. package/dist/schemas/index.js +0 -2
  261. package/dist/schemas/index.js.map +1 -1
  262. package/dist/schemas/leagues.d.ts.map +1 -1
  263. package/dist/schemas/leagues.js +0 -24
  264. package/dist/schemas/leagues.js.map +1 -1
  265. package/dist/schemas/migration-console.d.ts +0 -7
  266. package/dist/schemas/migration-console.d.ts.map +1 -1
  267. package/dist/schemas/migration-console.js +0 -34
  268. package/dist/schemas/migration-console.js.map +1 -1
  269. package/dist/schemas/pictures.d.ts.map +1 -1
  270. package/dist/schemas/pictures.js +0 -10
  271. package/dist/schemas/pictures.js.map +1 -1
  272. package/dist/schemas/schedules.d.ts.map +1 -1
  273. package/dist/schemas/schedules.js +0 -26
  274. package/dist/schemas/schedules.js.map +1 -1
  275. package/dist/schemas/scoring.d.ts +0 -6
  276. package/dist/schemas/scoring.d.ts.map +1 -1
  277. package/dist/schemas/scoring.js +0 -33
  278. package/dist/schemas/scoring.js.map +1 -1
  279. package/dist/schemas/signed-waivers.d.ts.map +1 -1
  280. package/dist/schemas/signed-waivers.js +0 -22
  281. package/dist/schemas/signed-waivers.js.map +1 -1
  282. package/dist/schemas/stats.d.ts.map +1 -1
  283. package/dist/schemas/stats.js +0 -60
  284. package/dist/schemas/stats.js.map +1 -1
  285. package/dist/schemas/team-joining.d.ts.map +1 -1
  286. package/dist/schemas/team-joining.js +0 -30
  287. package/dist/schemas/team-joining.js.map +1 -1
  288. package/dist/schemas/teams.d.ts +0 -1
  289. package/dist/schemas/teams.d.ts.map +1 -1
  290. package/dist/schemas/teams.js +0 -83
  291. package/dist/schemas/teams.js.map +1 -1
  292. package/dist/schemas/uploads.d.ts +0 -8
  293. package/dist/schemas/uploads.d.ts.map +1 -1
  294. package/dist/schemas/uploads.js +0 -29
  295. package/dist/schemas/uploads.js.map +1 -1
  296. package/dist/schemas/users.d.ts +0 -1
  297. package/dist/schemas/users.d.ts.map +1 -1
  298. package/dist/schemas/users.js +0 -41
  299. package/dist/schemas/users.js.map +1 -1
  300. package/dist/schemas/waiver-templates.d.ts.map +1 -1
  301. package/dist/schemas/waiver-templates.js +0 -7
  302. package/dist/schemas/waiver-templates.js.map +1 -1
  303. package/dist/sports/basketball-scoring.d.ts +0 -4
  304. package/dist/sports/basketball-scoring.d.ts.map +1 -1
  305. package/dist/sports/basketball-scoring.js +0 -34
  306. package/dist/sports/basketball-scoring.js.map +1 -1
  307. package/dist/sports/basketball.d.ts.map +1 -1
  308. package/dist/sports/basketball.js +0 -5
  309. package/dist/sports/basketball.js.map +1 -1
  310. package/dist/sports/bulk-entry.d.ts +0 -22
  311. package/dist/sports/bulk-entry.d.ts.map +1 -1
  312. package/dist/sports/bulk-entry.js +0 -10
  313. package/dist/sports/bulk-entry.js.map +1 -1
  314. package/dist/sports/column-catalog.d.ts +0 -17
  315. package/dist/sports/column-catalog.d.ts.map +1 -1
  316. package/dist/sports/column-catalog.js +0 -10
  317. package/dist/sports/column-catalog.js.map +1 -1
  318. package/dist/sports/contribution.d.ts +2 -59
  319. package/dist/sports/contribution.d.ts.map +1 -1
  320. package/dist/sports/contribution.js +2 -45
  321. package/dist/sports/contribution.js.map +1 -1
  322. package/dist/sports/curling-scoring.d.ts +0 -1
  323. package/dist/sports/curling-scoring.d.ts.map +1 -1
  324. package/dist/sports/curling-scoring.js +0 -27
  325. package/dist/sports/curling-scoring.js.map +1 -1
  326. package/dist/sports/curling.d.ts.map +1 -1
  327. package/dist/sports/curling.js +0 -4
  328. package/dist/sports/curling.js.map +1 -1
  329. package/dist/sports/finalized-record.d.ts +0 -17
  330. package/dist/sports/finalized-record.d.ts.map +1 -1
  331. package/dist/sports/finalized-record.js +0 -20
  332. package/dist/sports/finalized-record.js.map +1 -1
  333. package/dist/sports/football-scoring.d.ts.map +1 -1
  334. package/dist/sports/football-scoring.js +0 -21
  335. package/dist/sports/football-scoring.js.map +1 -1
  336. package/dist/sports/football.d.ts.map +1 -1
  337. package/dist/sports/football.js +0 -4
  338. package/dist/sports/football.js.map +1 -1
  339. package/dist/sports/index.d.ts.map +1 -1
  340. package/dist/sports/index.js +0 -2
  341. package/dist/sports/index.js.map +1 -1
  342. package/dist/sports/ledger-continuity.d.ts +0 -2
  343. package/dist/sports/ledger-continuity.d.ts.map +1 -1
  344. package/dist/sports/ledger-continuity.js +0 -5
  345. package/dist/sports/ledger-continuity.js.map +1 -1
  346. package/dist/sports/lifetime-summary.d.ts +0 -6
  347. package/dist/sports/lifetime-summary.d.ts.map +1 -1
  348. package/dist/sports/lifetime-summary.js +0 -7
  349. package/dist/sports/lifetime-summary.js.map +1 -1
  350. package/dist/sports/rankings.d.ts +0 -12
  351. package/dist/sports/rankings.d.ts.map +1 -1
  352. package/dist/sports/rankings.js +0 -15
  353. package/dist/sports/rankings.js.map +1 -1
  354. package/dist/sports/registry.d.ts +0 -10
  355. package/dist/sports/registry.d.ts.map +1 -1
  356. package/dist/sports/registry.js +0 -9
  357. package/dist/sports/registry.js.map +1 -1
  358. package/dist/sports/replay.d.ts +0 -11
  359. package/dist/sports/replay.d.ts.map +1 -1
  360. package/dist/sports/replay.js +0 -16
  361. package/dist/sports/replay.js.map +1 -1
  362. package/dist/sports/rollup-check.d.ts +0 -7
  363. package/dist/sports/rollup-check.d.ts.map +1 -1
  364. package/dist/sports/rollup-check.js +0 -14
  365. package/dist/sports/rollup-check.js.map +1 -1
  366. package/dist/sports/score-mirror.d.ts +0 -1
  367. package/dist/sports/score-mirror.d.ts.map +1 -1
  368. package/dist/sports/score-mirror.js +0 -4
  369. package/dist/sports/score-mirror.js.map +1 -1
  370. package/dist/sports/scoring-display.d.ts +0 -30
  371. package/dist/sports/scoring-display.d.ts.map +1 -1
  372. package/dist/sports/scoring-display.js +0 -9
  373. package/dist/sports/scoring-display.js.map +1 -1
  374. package/dist/sports/scoring.d.ts +0 -36
  375. package/dist/sports/scoring.d.ts.map +1 -1
  376. package/dist/sports/scoring.js +0 -10
  377. package/dist/sports/scoring.js.map +1 -1
  378. package/dist/sports/shared-columns.d.ts +0 -1
  379. package/dist/sports/shared-columns.d.ts.map +1 -1
  380. package/dist/sports/shared-columns.js +0 -7
  381. package/dist/sports/shared-columns.js.map +1 -1
  382. package/dist/sports/sport-adapter.d.ts +0 -32
  383. package/dist/sports/sport-adapter.d.ts.map +1 -1
  384. package/dist/sports/sport-adapter.js +0 -7
  385. package/dist/sports/sport-adapter.js.map +1 -1
  386. package/dist/sports/store-driver.d.ts +0 -28
  387. package/dist/sports/store-driver.d.ts.map +1 -1
  388. package/dist/sports/store-driver.js +0 -38
  389. package/dist/sports/store-driver.js.map +1 -1
  390. package/dist/types/audit.d.ts.map +1 -1
  391. package/dist/types/audit.js +0 -67
  392. package/dist/types/audit.js.map +1 -1
  393. package/dist/types/claims.d.ts +0 -10
  394. package/dist/types/claims.d.ts.map +1 -1
  395. package/dist/types/claims.js +0 -16
  396. package/dist/types/claims.js.map +1 -1
  397. package/dist/types/notifications.d.ts.map +1 -1
  398. package/dist/types/notifications.js +7 -25
  399. package/dist/types/notifications.js.map +1 -1
  400. package/dist/types/picture-owners.d.ts +0 -1
  401. package/dist/types/picture-owners.d.ts.map +1 -1
  402. package/dist/types/picture-owners.js +0 -6
  403. package/dist/types/picture-owners.js.map +1 -1
  404. package/dist/types/schedules.d.ts.map +1 -1
  405. package/dist/types/schedules.js +0 -9
  406. package/dist/types/schedules.js.map +1 -1
  407. package/dist/types/sports.d.ts.map +1 -1
  408. package/dist/types/sports.js +0 -24
  409. package/dist/types/sports.js.map +1 -1
  410. package/dist/types/stats.d.ts.map +1 -1
  411. package/dist/types/stats.js +0 -65
  412. package/dist/types/stats.js.map +1 -1
  413. package/dist/types/unions.d.ts +0 -2
  414. package/dist/types/unions.d.ts.map +1 -1
  415. package/dist/types/unions.js +3 -91
  416. package/dist/types/unions.js.map +1 -1
  417. package/dist/types/uploads.d.ts.map +1 -1
  418. package/dist/types/uploads.js +0 -7
  419. package/dist/types/uploads.js.map +1 -1
  420. package/dist/upload-variables/on-progress.d.ts.map +1 -1
  421. package/dist/upload-variables/on-progress.js +2 -5
  422. package/dist/upload-variables/on-progress.js.map +1 -1
  423. package/dist/upload-variables/picture-upload-variables.d.ts +0 -1
  424. package/dist/upload-variables/picture-upload-variables.d.ts.map +1 -1
  425. package/dist/upload-variables/picture-upload-variables.js +0 -4
  426. package/dist/upload-variables/picture-upload-variables.js.map +1 -1
  427. package/dist/upload-variables/sign-hardware-contract-variables.d.ts.map +1 -1
  428. package/dist/upload-variables/sign-hardware-contract-variables.js +0 -2
  429. package/dist/upload-variables/sign-hardware-contract-variables.js.map +1 -1
  430. package/dist/upload-variables/sign-waiver-variables.d.ts.map +1 -1
  431. package/dist/upload-variables/sign-waiver-variables.js +0 -4
  432. package/dist/upload-variables/sign-waiver-variables.js.map +1 -1
  433. package/dist/utils/account-status.d.ts.map +1 -1
  434. package/dist/utils/account-status.js +0 -4
  435. package/dist/utils/account-status.js.map +1 -1
  436. package/dist/utils/app-config.d.ts +0 -53
  437. package/dist/utils/app-config.d.ts.map +1 -1
  438. package/dist/utils/app-config.js +0 -62
  439. package/dist/utils/app-config.js.map +1 -1
  440. package/dist/utils/display-name.d.ts +0 -7
  441. package/dist/utils/display-name.d.ts.map +1 -1
  442. package/dist/utils/display-name.js +0 -8
  443. package/dist/utils/display-name.js.map +1 -1
  444. package/dist/utils/league-calendar.d.ts +0 -11
  445. package/dist/utils/league-calendar.d.ts.map +1 -1
  446. package/dist/utils/league-calendar.js +1 -18
  447. package/dist/utils/league-calendar.js.map +1 -1
  448. package/dist/utils/league-join-warning.d.ts +0 -11
  449. package/dist/utils/league-join-warning.d.ts.map +1 -1
  450. package/dist/utils/league-join-warning.js +0 -28
  451. package/dist/utils/league-join-warning.js.map +1 -1
  452. package/dist/utils/league-joining.d.ts +0 -1
  453. package/dist/utils/league-joining.d.ts.map +1 -1
  454. package/dist/utils/league-joining.js +0 -7
  455. package/dist/utils/league-joining.js.map +1 -1
  456. package/dist/utils/league-mode.d.ts +0 -1
  457. package/dist/utils/league-mode.d.ts.map +1 -1
  458. package/dist/utils/league-mode.js +0 -4
  459. package/dist/utils/league-mode.js.map +1 -1
  460. package/dist/utils/schedules.d.ts +0 -15
  461. package/dist/utils/schedules.d.ts.map +1 -1
  462. package/dist/utils/schedules.js +0 -19
  463. package/dist/utils/schedules.js.map +1 -1
  464. package/dist/utils/team-creation.d.ts +0 -2
  465. package/dist/utils/team-creation.d.ts.map +1 -1
  466. package/dist/utils/team-creation.js +0 -6
  467. package/dist/utils/team-creation.js.map +1 -1
  468. package/dist/utils/team-member-actions.d.ts +0 -6
  469. package/dist/utils/team-member-actions.d.ts.map +1 -1
  470. package/dist/utils/team-member-actions.js +0 -12
  471. package/dist/utils/team-member-actions.js.map +1 -1
  472. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"scoring-display.d.ts","sourceRoot":"","sources":["../../src/sports/scoring-display.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjE;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;CAC3C;AAED,2FAA2F;AAC3F,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ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GAAG,IAAI,CAUf"}
@@ -1,17 +1,8 @@
1
- // What the scoring screen, the scoreboard, and the play-by-play render for a sport, declared by its
2
- // adapter so no shared surface branches on a sport (RULE-QS-SPORT-904, RULE-QS-SPORT-916). Every label lives here or
3
- // in the adapter, never in a component (RULE-STD-ENG-005).
4
1
  import { isStatCorrection, isStatVoid } from './scoring.js';
5
- /** A signed change as a play shows it: `+3`, `-2`. */
6
2
  export function formatSignedValue(value) {
7
3
  return value > 0 ? `+${value}` : String(value);
8
4
  }
9
5
  export const VOID_PLAY_DESCRIPTION = 'Undo of an earlier play';
10
- /**
11
- * The play-by-play line of a store-level event, the same for every sport: a correction names the
12
- * field it moved through the sport's field labels, and never reads as a play. `null` for a sport's
13
- * own event.
14
- */
15
6
  export function describeStoreEvent(event, resolve, fieldLabels) {
16
7
  if (isStatVoid(event))
17
8
  return VOID_PLAY_DESCRIPTION;
@@ -1 +1 @@
1
- {"version":3,"file":"scoring-display.js","sourceRoot":"","sources":["../../src/sports/scoring-display.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,qHAAqH;AACrH,2DAA2D;AAM3D,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAkF5D,sDAAsD;AACtD,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AAE/D;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAoB,EACpB,OAA8B,EAC9B,WAGC;IAED,IAAI,UAAU,CAAC,KAAK,CAAC;QAAE,OAAO,qBAAqB,CAAC;IACpD,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1C,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC;IACxF,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC;IAC/C,MAAM,IAAI,GACR,KAAK,CAAC,YAAY,KAAK,SAAS;QAC9B,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAC5B,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;IAC9E,OAAO,GAAG,KAAK,iBAAiB,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;AAC/E,CAAC","sourcesContent":["// What the scoring screen, the scoreboard, and the play-by-play render for a sport, declared by its\n// adapter so no shared surface branches on a sport (RULE-QS-SPORT-904, RULE-QS-SPORT-916). Every label lives here or\n// in the adapter, never in a component (RULE-STD-ENG-005).\n\nimport type { GameStatEvent, GameStatEventType } from '../doc-schemas/game-stats.js';\nimport type { StatCounterKey } from '../types/sports.js';\nimport type { ScoringPanelKind } from '../types/stats.js';\nimport type { GamePlayerLine, GameTeamLine } from './scoring.js';\nimport { isStatCorrection, isStatVoid } from './scoring.js';\n\n/**\n * Names read at render time (RULE-STD-ARCH-103, RULE-QS-SPORT-914): a person by user id — a removed ghost resolving to\n * \"removed player\" — and a team by team id. An event's stored name snapshot is never one of them.\n */\nexport interface StatEventNameResolver {\n readonly player: (userId: string) => string;\n readonly team: (teamId: string) => string;\n}\n\n/** An event type's button label on the scoring panel and its label in the play-by-play. */\nexport interface StatEventLabel {\n readonly button: string;\n readonly play: string;\n}\n\n/** Each field of a team line and of a player line, by label — what a correction row names. */\nexport interface StatFieldLabels<\n TeamField extends StatCounterKey,\n PlayerField extends StatCounterKey,\n> {\n readonly team: Readonly<Record<TeamField, string>>;\n readonly player: Readonly<Record<PlayerField, string>>;\n}\n\n/** One figure a team card shows: from the team's game line and the player lines keyed to its side. */\nexport interface ScoreboardFigure {\n readonly id: string;\n readonly label: string;\n readonly value: (teamLine: GameTeamLine, sideLines: readonly GamePlayerLine[]) => number;\n}\n\n/**\n * The one scoreboard every game screen renders: each team's figures, the jump-ball marker where the\n * sport has one, and — for a sport played in rounds — each team's round-by-round grid.\n */\nexport interface Scoreboard {\n readonly figures: readonly ScoreboardFigure[];\n /**\n * Whether the sport has a jump-ball possession marker: the team cards show it, and the game's\n * scorers set it through its own writer, never a stat event.\n */\n readonly jumpBall: boolean;\n /**\n * Present only for a sport played in rounds: a team line's slot per round, `null` where the round\n * is not recorded, so the grid tells an unplayed round from a scoreless one.\n */\n readonly roundSlots?: (teamLine: GameTeamLine) => readonly (number | null)[];\n}\n\n/** A sport played in rounds: how many, and what one is called (\"Round n / 14\"). */\nexport interface RoundsDisplay {\n readonly count: number;\n readonly label: string;\n}\n\n/** Pick a present player, then tap one of their events; the team row carries the team's own. */\nexport interface PlayerEventsScoringPanel {\n readonly kind: Extract<ScoringPanelKind, 'playerEvents'>;\n readonly playerEventTypes: readonly GameStatEventType[];\n /** The events that open the assist picker: the team's other present players, and \"No assist\". */\n readonly assistableEventTypes: readonly GameStatEventType[];\n readonly teamEventTypes: readonly GameStatEventType[];\n}\n\n/** One button per event for each team. */\nexport interface TeamPointsScoringPanel {\n readonly kind: Extract<ScoringPanelKind, 'teamPoints'>;\n readonly eventTypes: readonly GameStatEventType[];\n}\n\n/** Each team's +1 through +`maxPoints` for the next round, and one button for a blank round. */\nexport interface RoundsScoringPanel {\n readonly kind: Extract<ScoringPanelKind, 'rounds'>;\n readonly scoreEventType: GameStatEventType;\n readonly blankEventType: GameStatEventType;\n readonly maxPoints: number;\n}\n\nexport type ScoringPanel = PlayerEventsScoringPanel | TeamPointsScoringPanel | RoundsScoringPanel;\n\n/** A signed change as a play shows it: `+3`, `-2`. */\nexport function formatSignedValue(value: number): string {\n return value > 0 ? `+${value}` : String(value);\n}\n\nexport const VOID_PLAY_DESCRIPTION = 'Undo of an earlier play';\n\n/**\n * The play-by-play line of a store-level event, the same for every sport: a correction names the\n * field it moved through the sport's field labels, and never reads as a play. `null` for a sport's\n * own event.\n */\nexport function describeStoreEvent(\n event: GameStatEvent,\n resolve: StatEventNameResolver,\n fieldLabels: {\n readonly team: Partial<Record<StatCounterKey, string>>;\n readonly player: Partial<Record<StatCounterKey, string>>;\n },\n): string | null {\n if (isStatVoid(event)) return VOID_PLAY_DESCRIPTION;\n if (!isStatCorrection(event)) return null;\n const labels = event.playerUserId === undefined ? fieldLabels.team : fieldLabels.player;\n const field = labels[event.stat] ?? event.stat;\n const line =\n event.playerUserId === undefined\n ? resolve.team(event.teamId)\n : `${resolve.player(event.playerUserId)} (${resolve.team(event.teamId)})`;\n return `${field} corrected by ${formatSignedValue(event.value)} for ${line}`;\n}\n"]}
1
+ {"version":3,"file":"scoring-display.js","sourceRoot":"","sources":["../../src/sports/scoring-display.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA0D5D,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AAE/D,MAAM,UAAU,kBAAkB,CAChC,KAAoB,EACpB,OAA8B,EAC9B,WAGC;IAED,IAAI,UAAU,CAAC,KAAK,CAAC;QAAE,OAAO,qBAAqB,CAAC;IACpD,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1C,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC;IACxF,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC;IAC/C,MAAM,IAAI,GACR,KAAK,CAAC,YAAY,KAAK,SAAS;QAC9B,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAC5B,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;IAC9E,OAAO,GAAG,KAAK,iBAAiB,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;AAC/E,CAAC","sourcesContent":["import type { GameStatEvent, GameStatEventType } from '../doc-schemas/game-stats.js';\nimport type { StatCounterKey } from '../types/sports.js';\nimport type { ScoringPanelKind } from '../types/stats.js';\nimport type { GamePlayerLine, GameTeamLine } from './scoring.js';\nimport { isStatCorrection, isStatVoid } from './scoring.js';\n\nexport interface StatEventNameResolver {\n readonly player: (userId: string) => string;\n readonly team: (teamId: string) => string;\n}\n\nexport interface StatEventLabel {\n readonly button: string;\n readonly play: string;\n}\n\nexport interface StatFieldLabels<\n TeamField extends StatCounterKey,\n PlayerField extends StatCounterKey,\n> {\n readonly team: Readonly<Record<TeamField, string>>;\n readonly player: Readonly<Record<PlayerField, string>>;\n}\n\nexport interface ScoreboardFigure {\n readonly id: string;\n readonly label: string;\n readonly value: (teamLine: GameTeamLine, sideLines: readonly GamePlayerLine[]) => number;\n}\n\nexport interface Scoreboard {\n readonly figures: readonly ScoreboardFigure[];\n readonly jumpBall: boolean;\n readonly roundSlots?: (teamLine: GameTeamLine) => readonly (number | null)[];\n}\n\nexport interface RoundsDisplay {\n readonly count: number;\n readonly label: string;\n}\n\nexport interface PlayerEventsScoringPanel {\n readonly kind: Extract<ScoringPanelKind, 'playerEvents'>;\n readonly playerEventTypes: readonly GameStatEventType[];\n readonly assistableEventTypes: readonly GameStatEventType[];\n readonly teamEventTypes: readonly GameStatEventType[];\n}\n\nexport interface TeamPointsScoringPanel {\n readonly kind: Extract<ScoringPanelKind, 'teamPoints'>;\n readonly eventTypes: readonly GameStatEventType[];\n}\n\nexport interface RoundsScoringPanel {\n readonly kind: Extract<ScoringPanelKind, 'rounds'>;\n readonly scoreEventType: GameStatEventType;\n readonly blankEventType: GameStatEventType;\n readonly maxPoints: number;\n}\n\nexport type ScoringPanel = PlayerEventsScoringPanel | TeamPointsScoringPanel | RoundsScoringPanel;\n\nexport function formatSignedValue(value: number): string {\n return value > 0 ? `+${value}` : String(value);\n}\n\nexport const VOID_PLAY_DESCRIPTION = 'Undo of an earlier play';\n\nexport function describeStoreEvent(\n event: GameStatEvent,\n resolve: StatEventNameResolver,\n fieldLabels: {\n readonly team: Partial<Record<StatCounterKey, string>>;\n readonly player: Partial<Record<StatCounterKey, string>>;\n },\n): string | null {\n if (isStatVoid(event)) return VOID_PLAY_DESCRIPTION;\n if (!isStatCorrection(event)) return null;\n const labels = event.playerUserId === undefined ? fieldLabels.team : fieldLabels.player;\n const field = labels[event.stat] ?? event.stat;\n const line =\n event.playerUserId === undefined\n ? resolve.team(event.teamId)\n : `${resolve.player(event.playerUserId)} (${resolve.team(event.teamId)})`;\n return `${field} corrected by ${formatSignedValue(event.value)} for ${line}`;\n}\n"]}
@@ -6,11 +6,6 @@ import type { FinalizationNotReadyReason, StatEventRecorderField, StatEventRefus
6
6
  import type { FinalizedGame, GameContribution } from './contribution.js';
7
7
  import type { GameTeamIds } from './sport-adapter.js';
8
8
  type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
9
- /**
10
- * What an event says happened — its type and its payload. Its id, its `recordedAt`, and what the
11
- * writing core stamps on it are not part of it, so a stored event, a queued one, and a drafted one
12
- * are all bodies.
13
- */
14
9
  export type StatEventBody = DistributiveOmit<GameStatEvent, 'eventId' | 'recordedAt' | StatEventRecorderField | StatEventSnapshotField>;
15
10
  export type StatVoidBody = Extract<StatEventBody, {
16
11
  type: typeof STAT_VOID_EVENT_TYPE;
@@ -18,25 +13,17 @@ export type StatVoidBody = Extract<StatEventBody, {
18
13
  export type StatCorrectionBody = Extract<StatEventBody, {
19
14
  type: typeof STAT_CORRECTION_EVENT_TYPE;
20
15
  }>;
21
- /** One of a sport's own events, as opposed to the store-level void and correction. */
22
16
  export type SportStatEventBody = Exclude<StatEventBody, StatVoidBody | StatCorrectionBody>;
23
17
  export declare function isStatVoid(event: StatEventBody): event is StatVoidBody;
24
18
  export declare function isStatCorrection(event: StatEventBody): event is StatCorrectionBody;
25
- /** Whether `event` is one of the sport events `eventTypes` declares — never a void or a correction. */
26
19
  export declare function isSportStatEventIn(eventTypes: readonly string[], event: StatEventBody | undefined): event is SportStatEventBody;
27
- /** One team's line in a game's rollup, whichever sport it counts. */
28
20
  export type GameTeamLine = GameStats['teamStats'][string];
29
- /** One roster entry's line in a game's rollup, whichever sport it counts. */
30
21
  export type GamePlayerLine = GameStats['playerStats'][string];
31
- /** A stat line of any kind as `deriveLine` reads and returns it: its counters, derived fields, and ends. */
32
22
  export type StatLineValues = {
33
23
  readonly [field: string]: number | readonly (number | null)[];
34
24
  };
35
- /** The game an event is validated against: its teams, and the roster entries the batch names. */
36
25
  export interface StatEventRoster {
37
- /** A team of the game is one of these — never inferred from which team lines a rollup holds. */
38
26
  readonly teamIds: readonly string[];
39
- /** The roster entries the driver read for the batch — never the whole roster. */
40
27
  readonly rosterPlayerIds: ReadonlySet<string>;
41
28
  }
42
29
  export type StatEventVerdict = {
@@ -54,44 +41,21 @@ export type FinalizationReadiness = {
54
41
  readonly reason: FinalizationNotReadyReason;
55
42
  };
56
43
  export declare const FINALIZATION_READY: FinalizationReadiness;
57
- /** The fields a `STAT_CORRECTION` may change, on a team line and on a player line. */
58
44
  export interface CorrectableFields {
59
45
  readonly team: readonly StatCounterKey[];
60
46
  readonly player: readonly StatCounterKey[];
61
47
  }
62
48
  export interface SportScoring {
63
- /**
64
- * Whether a new event may be recorded against `state`: its type is the sport's, its team is one
65
- * of the game's, every person it names is a roster entry of that team, and its values are a real
66
- * result. Only the store driver calls it, and only for a new event — a replay never re-validates
67
- * what was already accepted.
68
- */
69
49
  readonly validate: (state: GameStats, event: StatEventBody, roster: StatEventRoster) => StatEventVerdict;
70
- /**
71
- * `state` with one sport event or one `STAT_CORRECTION` applied. A missing line is created from
72
- * the sport's empty line (RULE-QS-SPORT-915); a player line whose counters all return to zero is dropped;
73
- * a team line never is. Throws on a void, another sport's event, or a correction to a field not in
74
- * `correctableFields`.
75
- */
76
50
  readonly apply: (state: GameStats, event: StatEventBody) => GameStats;
77
- /** The exact inverse of `apply(target)` for one of the sport's own events (RULE-QS-SPORT-913). */
78
51
  readonly undo: (state: GameStats, target: StatEventBody) => GameStats;
79
- /** `line` with every derived field of its kind; the only caller of any derivation formula. */
80
52
  readonly deriveLine: (kind: StatLineKind, line: StatLineValues) => StatLineValues;
81
53
  readonly correctableFields: CorrectableFields;
82
- /** The next round to record for a sport played in rounds, `null` once all are or for any other sport. */
83
54
  readonly nextRound: (state: GameStats) => number | null;
84
- /** Whether the game may be finalized (RULE-QS-SPORT-922). */
85
55
  readonly finalizationReadiness: (state: GameStats, game: GameTeamIds) => FinalizationReadiness;
86
- /**
87
- * The games-played decision finalize stores: the roster entries credited no game played, from
88
- * each entry's own line and absence, in roster order (RULE-QS-SPORT-924).
89
- */
90
56
  readonly participation: (state: GameStats, rosterPlayerIds: readonly string[], absentRosterPlayerIds: readonly string[]) => string[];
91
- /** What a completed game adds to every derived destination (RULE-QS-SPORT-927). */
92
57
  readonly contribution: (game: FinalizedGame) => GameContribution;
93
58
  }
94
- /** Whether every counter of a line is zero — a player line the rollup then leaves out. */
95
59
  export declare function isAllZeroLine(line: StatLineValues, counterKeys: readonly string[]): boolean;
96
60
  export {};
97
61
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cAAc,EAAE,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAE3F"}
@@ -1,11 +1,3 @@
1
- // The scoring half of the sport adapter contract: the pure members the store driver, the replay, the
2
- // client's optimistic queue, and the aggregate cores call (RULE-QS-SPORT-903). None issues a Firestore
3
- // operation or an increment, reads a clock, or mints an id.
4
- //
5
- // Every member is typed over every sport's shapes, so any registered adapter is called the same way.
6
- // The registry chose the adapter by the game's `leagueType`, which is what makes the rollup it is
7
- // handed that sport's (RULE-QS-SPORT-902); an event of another sport is refused by `validate` and thrown on
8
- // by `apply` and `undo`, never guessed at.
9
1
  import { STAT_CORRECTION_EVENT_TYPE, STAT_VOID_EVENT_TYPE } from '../types/stats.js';
10
2
  export function isStatVoid(event) {
11
3
  return event.type === STAT_VOID_EVENT_TYPE;
@@ -13,7 +5,6 @@ export function isStatVoid(event) {
13
5
  export function isStatCorrection(event) {
14
6
  return event.type === STAT_CORRECTION_EVENT_TYPE;
15
7
  }
16
- /** Whether `event` is one of the sport events `eventTypes` declares — never a void or a correction. */
17
8
  export function isSportStatEventIn(eventTypes, event) {
18
9
  return event !== undefined && eventTypes.includes(event.type);
19
10
  }
@@ -22,7 +13,6 @@ export function refuseStatEvent(code) {
22
13
  return { ok: false, code };
23
14
  }
24
15
  export const FINALIZATION_READY = { ready: true };
25
- /** Whether every counter of a line is zero — a player line the rollup then leaves out. */
26
16
  export function isAllZeroLine(line, counterKeys) {
27
17
  return counterKeys.every((key) => line[key] === 0 || line[key] === undefined);
28
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"scoring.js","sourceRoot":"","sources":["../../src/sports/scoring.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,uGAAuG;AACvG,4DAA4D;AAC5D,EAAE;AACF,qGAAqG;AACrG,kGAAkG;AAClG,4GAA4G;AAC5G,2CAA2C;AAK3C,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AA8BrF,MAAM,UAAU,UAAU,CAAC,KAAoB;IAC7C,OAAO,KAAK,CAAC,IAAI,KAAK,oBAAoB,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAoB;IACnD,OAAO,KAAK,CAAC,IAAI,KAAK,0BAA0B,CAAC;AACnD,CAAC;AAED,uGAAuG;AACvG,MAAM,UAAU,kBAAkB,CAChC,UAA6B,EAC7B,KAAgC;IAEhC,OAAO,KAAK,KAAK,SAAS,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAChE,CAAC;AAqBD,MAAM,CAAC,MAAM,mBAAmB,GAAqB,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AAElE,MAAM,UAAU,eAAe,CAAC,IAA0B;IACxD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7B,CAAC;AAKD,MAAM,CAAC,MAAM,kBAAkB,GAA0B,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAiDzE,0FAA0F;AAC1F,MAAM,UAAU,aAAa,CAAC,IAAoB,EAAE,WAA8B;IAChF,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC;AAChF,CAAC","sourcesContent":["// The scoring half of the sport adapter contract: the pure members the store driver, the replay, the\n// client's optimistic queue, and the aggregate cores call (RULE-QS-SPORT-903). None issues a Firestore\n// operation or an increment, reads a clock, or mints an id.\n//\n// Every member is typed over every sport's shapes, so any registered adapter is called the same way.\n// The registry chose the adapter by the game's `leagueType`, which is what makes the rollup it is\n// handed that sport's (RULE-QS-SPORT-902); an event of another sport is refused by `validate` and thrown on\n// by `apply` and `undo`, never guessed at.\n\nimport type { GameStatEvent } from '../doc-schemas/game-stats.js';\nimport type { GameStats } from '../doc-schemas/sport-game.js';\nimport type { StatCounterKey } from '../types/sports.js';\nimport { STAT_CORRECTION_EVENT_TYPE, STAT_VOID_EVENT_TYPE } from '../types/stats.js';\nimport type {\n FinalizationNotReadyReason,\n StatEventRecorderField,\n StatEventRefusalCode,\n StatEventSnapshotField,\n StatLineKind,\n} from '../types/stats.js';\nimport type { FinalizedGame, GameContribution } from './contribution.js';\nimport type { GameTeamIds } from './sport-adapter.js';\n\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;\n\n/**\n * What an event says happened — its type and its payload. Its id, its `recordedAt`, and what the\n * writing core stamps on it are not part of it, so a stored event, a queued one, and a drafted one\n * are all bodies.\n */\nexport type StatEventBody = DistributiveOmit<\n GameStatEvent,\n 'eventId' | 'recordedAt' | StatEventRecorderField | StatEventSnapshotField\n>;\nexport type StatVoidBody = Extract<StatEventBody, { type: typeof STAT_VOID_EVENT_TYPE }>;\nexport type StatCorrectionBody = Extract<\n StatEventBody,\n { type: typeof STAT_CORRECTION_EVENT_TYPE }\n>;\n/** One of a sport's own events, as opposed to the store-level void and correction. */\nexport type SportStatEventBody = Exclude<StatEventBody, StatVoidBody | StatCorrectionBody>;\n\nexport function isStatVoid(event: StatEventBody): event is StatVoidBody {\n return event.type === STAT_VOID_EVENT_TYPE;\n}\n\nexport function isStatCorrection(event: StatEventBody): event is StatCorrectionBody {\n return event.type === STAT_CORRECTION_EVENT_TYPE;\n}\n\n/** Whether `event` is one of the sport events `eventTypes` declares — never a void or a correction. */\nexport function isSportStatEventIn(\n eventTypes: readonly string[],\n event: StatEventBody | undefined,\n): event is SportStatEventBody {\n return event !== undefined && eventTypes.includes(event.type);\n}\n\n/** One team's line in a game's rollup, whichever sport it counts. */\nexport type GameTeamLine = GameStats['teamStats'][string];\n/** One roster entry's line in a game's rollup, whichever sport it counts. */\nexport type GamePlayerLine = GameStats['playerStats'][string];\n\n/** A stat line of any kind as `deriveLine` reads and returns it: its counters, derived fields, and ends. */\nexport type StatLineValues = { readonly [field: string]: number | readonly (number | null)[] };\n\n/** The game an event is validated against: its teams, and the roster entries the batch names. */\nexport interface StatEventRoster {\n /** A team of the game is one of these — never inferred from which team lines a rollup holds. */\n readonly teamIds: readonly string[];\n /** The roster entries the driver read for the batch — never the whole roster. */\n readonly rosterPlayerIds: ReadonlySet<string>;\n}\n\nexport type StatEventVerdict =\n { readonly ok: true } | { readonly ok: false; readonly code: StatEventRefusalCode };\n\nexport const STAT_EVENT_ACCEPTED: StatEventVerdict = { ok: true };\n\nexport function refuseStatEvent(code: StatEventRefusalCode): StatEventVerdict {\n return { ok: false, code };\n}\n\nexport type FinalizationReadiness =\n { readonly ready: true } | { readonly ready: false; readonly reason: FinalizationNotReadyReason };\n\nexport const FINALIZATION_READY: FinalizationReadiness = { ready: true };\n\n/** The fields a `STAT_CORRECTION` may change, on a team line and on a player line. */\nexport interface CorrectableFields {\n readonly team: readonly StatCounterKey[];\n readonly player: readonly StatCounterKey[];\n}\n\nexport interface SportScoring {\n /**\n * Whether a new event may be recorded against `state`: its type is the sport's, its team is one\n * of the game's, every person it names is a roster entry of that team, and its values are a real\n * result. Only the store driver calls it, and only for a new event — a replay never re-validates\n * what was already accepted.\n */\n readonly validate: (\n state: GameStats,\n event: StatEventBody,\n roster: StatEventRoster,\n ) => StatEventVerdict;\n /**\n * `state` with one sport event or one `STAT_CORRECTION` applied. A missing line is created from\n * the sport's empty line (RULE-QS-SPORT-915); a player line whose counters all return to zero is dropped;\n * a team line never is. Throws on a void, another sport's event, or a correction to a field not in\n * `correctableFields`.\n */\n readonly apply: (state: GameStats, event: StatEventBody) => GameStats;\n /** The exact inverse of `apply(target)` for one of the sport's own events (RULE-QS-SPORT-913). */\n readonly undo: (state: GameStats, target: StatEventBody) => GameStats;\n /** `line` with every derived field of its kind; the only caller of any derivation formula. */\n readonly deriveLine: (kind: StatLineKind, line: StatLineValues) => StatLineValues;\n readonly correctableFields: CorrectableFields;\n /** The next round to record for a sport played in rounds, `null` once all are or for any other sport. */\n readonly nextRound: (state: GameStats) => number | null;\n /** Whether the game may be finalized (RULE-QS-SPORT-922). */\n readonly finalizationReadiness: (state: GameStats, game: GameTeamIds) => FinalizationReadiness;\n /**\n * The games-played decision finalize stores: the roster entries credited no game played, from\n * each entry's own line and absence, in roster order (RULE-QS-SPORT-924).\n */\n readonly participation: (\n state: GameStats,\n rosterPlayerIds: readonly string[],\n absentRosterPlayerIds: readonly string[],\n ) => string[];\n /** What a completed game adds to every derived destination (RULE-QS-SPORT-927). */\n readonly contribution: (game: FinalizedGame) => GameContribution;\n}\n\n/** Whether every counter of a line is zero — a player line the rollup then leaves out. */\nexport function isAllZeroLine(line: StatLineValues, counterKeys: readonly string[]): boolean {\n return counterKeys.every((key) => line[key] === 0 || line[key] === undefined);\n}\n"]}
1
+ {"version":3,"file":"scoring.js","sourceRoot":"","sources":["../../src/sports/scoring.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAwBrF,MAAM,UAAU,UAAU,CAAC,KAAoB;IAC7C,OAAO,KAAK,CAAC,IAAI,KAAK,oBAAoB,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAoB;IACnD,OAAO,KAAK,CAAC,IAAI,KAAK,0BAA0B,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,UAA6B,EAC7B,KAAgC;IAEhC,OAAO,KAAK,KAAK,SAAS,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAChE,CAAC;AAeD,MAAM,CAAC,MAAM,mBAAmB,GAAqB,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AAElE,MAAM,UAAU,eAAe,CAAC,IAA0B;IACxD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7B,CAAC;AAKD,MAAM,CAAC,MAAM,kBAAkB,GAA0B,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AA2BzE,MAAM,UAAU,aAAa,CAAC,IAAoB,EAAE,WAA8B;IAChF,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC;AAChF,CAAC","sourcesContent":["import type { GameStatEvent } from '../doc-schemas/game-stats.js';\nimport type { GameStats } from '../doc-schemas/sport-game.js';\nimport type { StatCounterKey } from '../types/sports.js';\nimport { STAT_CORRECTION_EVENT_TYPE, STAT_VOID_EVENT_TYPE } from '../types/stats.js';\nimport type {\n FinalizationNotReadyReason,\n StatEventRecorderField,\n StatEventRefusalCode,\n StatEventSnapshotField,\n StatLineKind,\n} from '../types/stats.js';\nimport type { FinalizedGame, GameContribution } from './contribution.js';\nimport type { GameTeamIds } from './sport-adapter.js';\n\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;\n\nexport type StatEventBody = DistributiveOmit<\n GameStatEvent,\n 'eventId' | 'recordedAt' | StatEventRecorderField | StatEventSnapshotField\n>;\nexport type StatVoidBody = Extract<StatEventBody, { type: typeof STAT_VOID_EVENT_TYPE }>;\nexport type StatCorrectionBody = Extract<\n StatEventBody,\n { type: typeof STAT_CORRECTION_EVENT_TYPE }\n>;\nexport type SportStatEventBody = Exclude<StatEventBody, StatVoidBody | StatCorrectionBody>;\n\nexport function isStatVoid(event: StatEventBody): event is StatVoidBody {\n return event.type === STAT_VOID_EVENT_TYPE;\n}\n\nexport function isStatCorrection(event: StatEventBody): event is StatCorrectionBody {\n return event.type === STAT_CORRECTION_EVENT_TYPE;\n}\n\nexport function isSportStatEventIn(\n eventTypes: readonly string[],\n event: StatEventBody | undefined,\n): event is SportStatEventBody {\n return event !== undefined && eventTypes.includes(event.type);\n}\n\nexport type GameTeamLine = GameStats['teamStats'][string];\nexport type GamePlayerLine = GameStats['playerStats'][string];\n\nexport type StatLineValues = { readonly [field: string]: number | readonly (number | null)[] };\n\nexport interface StatEventRoster {\n readonly teamIds: readonly string[];\n readonly rosterPlayerIds: ReadonlySet<string>;\n}\n\nexport type StatEventVerdict =\n { readonly ok: true } | { readonly ok: false; readonly code: StatEventRefusalCode };\n\nexport const STAT_EVENT_ACCEPTED: StatEventVerdict = { ok: true };\n\nexport function refuseStatEvent(code: StatEventRefusalCode): StatEventVerdict {\n return { ok: false, code };\n}\n\nexport type FinalizationReadiness =\n { readonly ready: true } | { readonly ready: false; readonly reason: FinalizationNotReadyReason };\n\nexport const FINALIZATION_READY: FinalizationReadiness = { ready: true };\n\nexport interface CorrectableFields {\n readonly team: readonly StatCounterKey[];\n readonly player: readonly StatCounterKey[];\n}\n\nexport interface SportScoring {\n readonly validate: (\n state: GameStats,\n event: StatEventBody,\n roster: StatEventRoster,\n ) => StatEventVerdict;\n readonly apply: (state: GameStats, event: StatEventBody) => GameStats;\n readonly undo: (state: GameStats, target: StatEventBody) => GameStats;\n readonly deriveLine: (kind: StatLineKind, line: StatLineValues) => StatLineValues;\n readonly correctableFields: CorrectableFields;\n readonly nextRound: (state: GameStats) => number | null;\n readonly finalizationReadiness: (state: GameStats, game: GameTeamIds) => FinalizationReadiness;\n readonly participation: (\n state: GameStats,\n rosterPlayerIds: readonly string[],\n absentRosterPlayerIds: readonly string[],\n ) => string[];\n readonly contribution: (game: FinalizedGame) => GameContribution;\n}\n\nexport function isAllZeroLine(line: StatLineValues, counterKeys: readonly string[]): boolean {\n return counterKeys.every((key) => line[key] === 0 || line[key] === undefined);\n}\n"]}
@@ -52,6 +52,5 @@ export declare const TEAM_SEASON_BASE_COLUMN: {
52
52
  pointsAgainst: number;
53
53
  }>;
54
54
  };
55
- /** The standings base in catalog order; each sport composes it with its own extras and layout. */
56
55
  export declare const TEAM_SEASON_BASE_COLUMNS: readonly StatColumn<TeamSeasonBaseStats>[];
57
56
  //# sourceMappingURL=shared-columns.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared-columns.d.ts","sourceRoot":"","sources":["../../src/sports/shared-columns.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtE,eAAO,MAAM,mBAAmB,EAAE,UAAU,CAAC,cAAc,CAM1D,CAAC;AAuDF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQ1B,CAAC;AAEX,kGAAkG;AAClG,eAAO,MAAM,wBAAwB,EAAE,SAAS,UAAU,CAAC,mBAAmB,CAAC,EAQ9E,CAAC"}
1
+ {"version":3,"file":"shared-columns.d.ts","sourceRoot":"","sources":["../../src/sports/shared-columns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtE,eAAO,MAAM,mBAAmB,EAAE,UAAU,CAAC,cAAc,CAM1D,CAAC;AAoDF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQ1B,CAAC;AAEX,eAAO,MAAM,wBAAwB,EAAE,SAAS,UAAU,CAAC,mBAAmB,CAAC,EAQ9E,CAAC"}
@@ -1,6 +1,3 @@
1
- // Columns every sport's catalogs share. A column's id is stable — a saved table layout stores it —
2
- // so an id never names a different figure later.
3
- // Games played (GP) is in every player-totals and standings catalog, and has no per-game variant.
4
1
  export const GAMES_PLAYED_COLUMN = {
5
2
  id: 'gamesPlayed',
6
3
  label: 'Games played',
@@ -45,7 +42,6 @@ const POINTS_AGAINST = {
45
42
  perGame: { id: 'pointsAgainstPerGame', label: 'Points against per game', shortLabel: 'PA/G' },
46
43
  sort: 'asc',
47
44
  };
48
- // Derived at read; no line stores a differential.
49
45
  const POINT_DIFFERENTIAL = {
50
46
  id: 'pointDifferential',
51
47
  label: 'Point differential',
@@ -53,8 +49,6 @@ const POINT_DIFFERENTIAL = {
53
49
  value: (line) => line.pointsFor - line.pointsAgainst,
54
50
  sort: 'desc',
55
51
  };
56
- // The standings base every sport's season line carries, by key so a sport's layout and standings
57
- // order name its columns. W, L, T, and the differential have no per-game variant.
58
52
  export const TEAM_SEASON_BASE_COLUMN = {
59
53
  gamesPlayed: GAMES_PLAYED_COLUMN,
60
54
  wins: WINS,
@@ -64,7 +58,6 @@ export const TEAM_SEASON_BASE_COLUMN = {
64
58
  pointsAgainst: POINTS_AGAINST,
65
59
  pointDifferential: POINT_DIFFERENTIAL,
66
60
  };
67
- /** The standings base in catalog order; each sport composes it with its own extras and layout. */
68
61
  export const TEAM_SEASON_BASE_COLUMNS = [
69
62
  GAMES_PLAYED_COLUMN,
70
63
  WINS,
@@ -1 +1 @@
1
- {"version":3,"file":"shared-columns.js","sourceRoot":"","sources":["../../src/sports/shared-columns.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,iDAAiD;AAKjD,kGAAkG;AAClG,MAAM,CAAC,MAAM,mBAAmB,GAA+B;IAC7D,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,cAAc;IACrB,UAAU,EAAE,IAAI;IAChB,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW;IACjC,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,IAAI,GAAoC;IAC5C,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,MAAM;IACb,UAAU,EAAE,GAAG;IACf,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI;IAC1B,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,MAAM,GAAoC;IAC9C,EAAE,EAAE,QAAQ;IACZ,KAAK,EAAE,QAAQ;IACf,UAAU,EAAE,GAAG;IACf,KAAK,EAAE,CAAC,I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EAAE,IAAI;IACV,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,UAAU;IACrB,aAAa,EAAE,cAAc;IAC7B,iBAAiB,EAAE,kBAAkB;CAC7B,CAAC;AAEX,kGAAkG;AAClG,MAAM,CAAC,MAAM,wBAAwB,GAA+C;IAClF,mBAAmB;IACnB,IAAI;IACJ,MAAM;IACN,IAAI;IACJ,UAAU;IACV,cAAc;IACd,kBAAkB;CACnB,CAAC","sourcesContent":["// Columns every sport's catalogs share. A column's id is stable — a saved table layout stores it —\n// so an id never names a different figure later.\n\nimport type { TeamSeasonBaseStats } from '../doc-schemas/aggregate-stats.js';\nimport type { GamesPlayedRow, StatColumn } from './column-catalog.js';\n\n// Games played (GP) is in every player-totals and standings catalog, and has no per-game variant.\nexport const GAMES_PLAYED_COLUMN: StatColumn<GamesPlayedRow> = {\n id: 'gamesPlayed',\n label: 'Games played',\n shortLabel: 'GP',\n value: (line) => line.gamesPlayed,\n sort: 'desc',\n};\n\nconst WINS: StatColumn<TeamSeasonBaseStats> = {\n id: 'wins',\n label: 'Wins',\n shortLabel: 'W',\n value: (line) => line.wins,\n sort: 'desc',\n};\n\nconst LOSSES: StatColumn<TeamSeasonBaseStats> = {\n id: 'losses',\n label: 'Losses',\n shortLabel: 'L',\n value: (line) => line.losses,\n sort: 'asc',\n};\n\nconst TIES: StatColumn<TeamSeasonBaseStats> = {\n id: 'ties',\n label: 'Ties',\n shortLabel: 'T',\n value: (line) => line.ties,\n sort: 'desc',\n};\n\nconst POINTS_FOR: StatColumn<TeamSeasonBaseStats> = {\n id: 'pointsFor',\n label: 'Points for',\n shortLabel: 'PF',\n value: (line) => line.pointsFor,\n perGame: { id: 'pointsForPerGame', label: 'Points for per game', shortLabel: 'PF/G' },\n sort: 'desc',\n};\n\nconst POINTS_AGAINST: StatColumn<TeamSeasonBaseStats> = {\n id: 'pointsAgainst',\n label: 'Points against',\n shortLabel: 'PA',\n value: (line) => line.pointsAgainst,\n perGame: { id: 'pointsAgainstPerGame', label: 'Points against per game', shortLabel: 'PA/G' },\n sort: 'asc',\n};\n\n// Derived at read; no line stores a differential.\nconst POINT_DIFFERENTIAL: StatColumn<TeamSeasonBaseStats> = {\n id: 'pointDifferential',\n label: 'Point differential',\n shortLabel: '+/-',\n value: (line) => line.pointsFor - line.pointsAgainst,\n sort: 'desc',\n};\n\n// The standings base every sport's season line carries, by key so a sport's layout and standings\n// order name its columns. W, L, T, and the differential have no per-game variant.\nexport const TEAM_SEASON_BASE_COLUMN = {\n gamesPlayed: GAMES_PLAYED_COLUMN,\n wins: WINS,\n losses: LOSSES,\n ties: TIES,\n pointsFor: POINTS_FOR,\n pointsAgainst: POINTS_AGAINST,\n pointDifferential: POINT_DIFFERENTIAL,\n} as const;\n\n/** The standings base in catalog order; each sport composes it with its own extras and layout. */\nexport const TEAM_SEASON_BASE_COLUMNS: readonly StatColumn<TeamSeasonBaseStats>[] = [\n GAMES_PLAYED_COLUMN,\n WINS,\n LOSSES,\n TIES,\n POINTS_FOR,\n POINTS_AGAINST,\n POINT_DIFFERENTIAL,\n];\n"]}
1
+ {"version":3,"file":"shared-columns.js","sourceRoot":"","sources":["../../src/sports/shared-columns.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,mBAAmB,GAA+B;IAC7D,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,cAAc;IACrB,UAAU,EAAE,IAAI;IAChB,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW;IACjC,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,IAAI,GAAoC;IAC5C,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,MAAM;IACb,UAAU,EAAE,GAAG;IACf,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI;IAC1B,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,MAAM,GAAoC;IAC9C,EAAE,EAAE,QAAQ;IACZ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AAE,mBAAmB;IAChC,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,UAAU;IACrB,aAAa,EAAE,cAAc;IAC7B,iBAAiB,EAAE,kBAAkB;CAC7B,CAAC;AAEX,MAAM,CAAC,MAAM,wBAAwB,GAA+C;IAClF,mBAAmB;IACnB,IAAI;IACJ,MAAM;IACN,IAAI;IACJ,UAAU;IACV,cAAc;IACd,kBAAkB;CACnB,CAAC","sourcesContent":["import type { TeamSeasonBaseStats } from '../doc-schemas/aggregate-stats.js';\nimport type { GamesPlayedRow, StatColumn } from './column-catalog.js';\n\nexport const GAMES_PLAYED_COLUMN: StatColumn<GamesPlayedRow> = {\n id: 'gamesPlayed',\n label: 'Games played',\n shortLabel: 'GP',\n value: (line) => line.gamesPlayed,\n sort: 'desc',\n};\n\nconst WINS: StatColumn<TeamSeasonBaseStats> = {\n id: 'wins',\n label: 'Wins',\n shortLabel: 'W',\n value: (line) => line.wins,\n sort: 'desc',\n};\n\nconst LOSSES: StatColumn<TeamSeasonBaseStats> = {\n id: 'losses',\n label: 'Losses',\n shortLabel: 'L',\n value: (line) => line.losses,\n sort: 'asc',\n};\n\nconst TIES: StatColumn<TeamSeasonBaseStats> = {\n id: 'ties',\n label: 'Ties',\n shortLabel: 'T',\n value: (line) => line.ties,\n sort: 'desc',\n};\n\nconst POINTS_FOR: StatColumn<TeamSeasonBaseStats> = {\n id: 'pointsFor',\n label: 'Points for',\n shortLabel: 'PF',\n value: (line) => line.pointsFor,\n perGame: { id: 'pointsForPerGame', label: 'Points for per game', shortLabel: 'PF/G' },\n sort: 'desc',\n};\n\nconst POINTS_AGAINST: StatColumn<TeamSeasonBaseStats> = {\n id: 'pointsAgainst',\n label: 'Points against',\n shortLabel: 'PA',\n value: (line) => line.pointsAgainst,\n perGame: { id: 'pointsAgainstPerGame', label: 'Points against per game', shortLabel: 'PA/G' },\n sort: 'asc',\n};\n\nconst POINT_DIFFERENTIAL: StatColumn<TeamSeasonBaseStats> = {\n id: 'pointDifferential',\n label: 'Point differential',\n shortLabel: '+/-',\n value: (line) => line.pointsFor - line.pointsAgainst,\n sort: 'desc',\n};\n\nexport const TEAM_SEASON_BASE_COLUMN = {\n gamesPlayed: GAMES_PLAYED_COLUMN,\n wins: WINS,\n losses: LOSSES,\n ties: TIES,\n pointsFor: POINTS_FOR,\n pointsAgainst: POINTS_AGAINST,\n pointDifferential: POINT_DIFFERENTIAL,\n} as const;\n\nexport const TEAM_SEASON_BASE_COLUMNS: readonly StatColumn<TeamSeasonBaseStats>[] = [\n GAMES_PLAYED_COLUMN,\n WINS,\n LOSSES,\n TIES,\n POINTS_FOR,\n POINTS_AGAINST,\n POINT_DIFFERENTIAL,\n];\n"]}
@@ -26,15 +26,8 @@ export interface SportTypeMap {
26
26
  readonly playerStatKey: never;
27
27
  };
28
28
  }
29
- /**
30
- * The schema of each of the sport's stat lines, by kind. A stored line is read as this sport's line
31
- * through its schema — chosen by the adapter `leagueType` selected, never inferred from the line's
32
- * shape (RULE-QS-SPORT-902).
33
- */
34
29
  export type SportLineSchemas<L extends LeagueType> = (typeof SPORT_LINE_SCHEMAS)[L];
35
- /** `never` for a kind the sport keeps no line of. */
36
30
  export type SportLine<L extends LeagueType, K extends StatLineKind> = z.infer<SportLineSchemas<L>[K]>;
37
- /** The game `stats` payload of one sport: its team lines and roster-entry lines. */
38
31
  export type SportGameStats<L extends LeagueType> = z.infer<(typeof SPORT_GAME_STATS_SCHEMAS)[L]>;
39
32
  export declare const COLUMN_CATALOG_LINE_KINDS: {
40
33
  readonly playerTotals: "membershipRow";
@@ -42,62 +35,37 @@ export declare const COLUMN_CATALOG_LINE_KINDS: {
42
35
  readonly teamSeason: "teamSeason";
43
36
  };
44
37
  export type ColumnCatalogRow<L extends LeagueType, K extends ColumnCatalogKey> = SportLine<L, (typeof COLUMN_CATALOG_LINE_KINDS)[K]>;
45
- /** A sport's three column catalogs, each over its own row type; a sport missing one does not compile. */
46
38
  export type SportColumnCatalogs<L extends LeagueType> = {
47
39
  readonly [K in ColumnCatalogKey]: ColumnCatalog<ColumnCatalogRow<L, K>>;
48
40
  };
49
- /** What shared surfaces render for the sport instead of branching on it (RULE-QS-SPORT-904, RULE-QS-SPORT-929). */
50
41
  export interface SportDisplay<L extends LeagueType> {
51
42
  readonly label: string;
52
43
  readonly iconKey: SportIconKey;
53
- /** The profile's lifetime summary for the sport: its totals, and its per-game averages beneath. */
54
44
  readonly lifetimeSummary: LifetimeSummary<SportLine<L, 'lifetime'>>;
55
- /** Each of the sport's event types: its scoring-panel button and its play-by-play label. */
56
45
  readonly eventLabels: Readonly<Record<SportTypeMap[L]['eventType'], StatEventLabel>>;
57
- /** Each counter of a team line and of a player line — what a correction row and the Correct a game form name. */
58
46
  readonly fieldLabels: StatFieldLabels<SportTypeMap[L]['teamStatKey'], SportTypeMap[L]['playerStatKey']>;
59
- /** One play-by-play line for any stored event but a void, a correction included. */
60
47
  readonly describeEvent: (event: GameStatEvent, resolve: StatEventNameResolver) => string;
61
- /** Present only for a sport played in rounds: the header's round line and the scoreboard's grid. */
62
48
  readonly rounds?: RoundsDisplay;
63
49
  readonly scoreboard: Scoreboard;
64
- /** The one component of the scoring screen that is the sport's own, named by its kind. */
65
50
  readonly scoringPanel: ScoringPanel;
66
51
  }
67
- /** The game an empty rollup is built for: its real (non-bye) teams. */
68
52
  export interface GameTeamIds {
69
53
  readonly teamIds: readonly string[];
70
54
  }
71
- /**
72
- * One sport's adapter: its facts, its scoring members, its display, its column catalogs, and its
73
- * bulk entry. The scoring members are typed over every sport, so any registered adapter is called
74
- * the same way.
75
- */
76
55
  export interface SportAdapter<L extends LeagueType> extends SportScoring {
77
56
  readonly leagueType: L;
78
- /** The storage key: `sportHallOfFame/{sportKey}`, `historicalStats/{sportKey}`, `lifetimeStats.{sportKey}`. */
79
57
  readonly sportKey: (typeof SPORT_KEY_BY_LEAGUE_TYPE)[L];
80
- /** The sport's own event types; the store-level void and correction belong to every sport. */
81
58
  readonly eventTypes: readonly SportTypeMap[L]['eventType'][];
82
- /** The counters of a team line and of a player line — what the aggregates sum and a ghost link merges. */
83
59
  readonly teamStatKeys: readonly SportTypeMap[L]['teamStatKey'][];
84
60
  readonly playerStatKeys: readonly SportTypeMap[L]['playerStatKey'][];
85
- /** Whether the sport keeps `sportHallOfFame/{sportKey}` and the hall-of-fame page serves it. */
86
61
  readonly hallOfFame: boolean;
87
- /** Whether an admin may enter pre-Q-Sports career totals for the sport. */
88
62
  readonly historicalBaseline: boolean;
89
63
  readonly lineSchemas: SportLineSchemas<L>;
90
64
  readonly display: SportDisplay<L>;
91
65
  readonly columns: SportColumnCatalogs<L>;
92
- /**
93
- * The rollup of a game with no events (RULE-QS-SPORT-915): a team line for each of the game's teams, and
94
- * no player lines. Every call returns new objects.
95
- */
96
66
  readonly emptyStats: (game: GameTeamIds) => SportGameStats<L>;
97
- /** The sport's bulk-entry form, whose rules `validate` enforces again on every event it becomes. */
98
67
  readonly bulkEntry: BulkEntry;
99
68
  }
100
- /** Every registered adapter, by `leagueType`. Indexing it with a generic sport keeps the sport. */
101
69
  export type SportAdapterRegistry = {
102
70
  readonly [L in LeagueType]: SportAdapter<L>;
103
71
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sport-adapter.d.ts","sourceRoot":"","sources":["../../src/sports/sport-adapter.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,UAAU,EACV,wBAAwB,EACxB,YAAY,EACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,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,CAAC,YAAY,EAAE,SAAS,YAAY,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC;IACjE,QAAQ,CAAC,cAAc,EAAE,SAAS,YAAY,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,CAAC;IACrE,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;IACzC,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,cAAc,CAAC,CAAC,CAAC,CAAC;IAC9D,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;CAC/B;AAED,MAAM,MAAM,oBAAoB,GAAG;IAAE,QAAQ,EAAE,CAAC,IAAI,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC;CAAE,CAAC;AAEnF,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC"}
@@ -1,10 +1,3 @@
1
- // The sport adapter contract: one adapter per sport owns everything about that sport, and every
2
- // shared surface asks it rather than branching on a sport (RULE-QS-SPORT-903, RULE-QS-SPORT-904). Every member is
3
- // pure — no Firestore operation, no clock, no minted id, no React — so both app roots run the one
4
- // copy (RULE-STD-ARCH-101, RULE-STD-ARCH-202).
5
- // The line kind each stats table reads its rows from. Standings rows are team season lines; the
6
- // game page's rows are player game lines; every player-totals table — league rankings, the team
7
- // page, the hall of fame — reads rows shaped as membership rows.
8
1
  export const COLUMN_CATALOG_LINE_KINDS = {
9
2
  playerTotals: 'membershipRow',
10
3
  gamePlayer: 'gamePlayer',
@@ -1 +1 @@
1
- {"version":3,"file":"sport-adapter.js","sourceRoot":"","sources":["../../src/sports/sport-adapter.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,kHAAkH;AAClH,kGAAkG;AAClG,+CAA+C;AAmE/C,gGAAgG;AAChG,gGAAgG;AAChG,iEAAiE;AACjE,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,YAAY,EAAE,eAAe;IAC7B,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;CACiC,CAAC","sourcesContent":["// The sport adapter contract: one adapter per sport owns everything about that sport, and every\n// shared surface asks it rather than branching on a sport (RULE-QS-SPORT-903, RULE-QS-SPORT-904). Every member is\n// pure — no Firestore operation, no clock, no minted id, no React — so both app roots run the one\n// copy (RULE-STD-ARCH-101, RULE-STD-ARCH-202).\n\nimport type { z } from 'zod';\nimport type { SPORT_LINE_SCHEMAS } from '../doc-schemas/aggregate-stats.js';\nimport type { SPORT_GAME_STATS_SCHEMAS } from '../doc-schemas/sport-game.js';\nimport type {\n BasketballPlayerStatKey,\n BasketballStatEventType,\n BasketballTeamStatKey,\n CurlingStatEventType,\n CurlingTeamStatKey,\n FootballStatEventType,\n FootballTeamStatKey,\n LeagueType,\n SPORT_KEY_BY_LEAGUE_TYPE,\n SportIconKey,\n} from '../types/sports.js';\nimport type { StatLineKind } from '../types/stats.js';\nimport type { GameStatEvent } from '../doc-schemas/game-stats.js';\nimport type { BulkEntry } from './bulk-entry.js';\nimport type { ColumnCatalog, ColumnCatalogKey } from './column-catalog.js';\nimport type { LifetimeSummary } from './lifetime-summary.js';\nimport type { SportScoring } from './scoring.js';\nimport type {\n RoundsDisplay,\n Scoreboard,\n ScoringPanel,\n StatEventLabel,\n StatEventNameResolver,\n StatFieldLabels,\n} from './scoring-display.js';\n\n// Each sport's declared vocabulary, keyed by `leagueType`. Its lines, and the game payload built\n// from them, come from `SPORT_LINE_SCHEMAS`.\nexport interface SportTypeMap {\n readonly Basketball: {\n readonly eventType: BasketballStatEventType;\n readonly teamStatKey: BasketballTeamStatKey;\n readonly playerStatKey: BasketballPlayerStatKey;\n };\n readonly Curling: {\n readonly eventType: CurlingStatEventType;\n readonly teamStatKey: CurlingTeamStatKey;\n readonly playerStatKey: never;\n };\n readonly Football: {\n readonly eventType: FootballStatEventType;\n readonly teamStatKey: FootballTeamStatKey;\n readonly playerStatKey: never;\n };\n}\n\n/**\n * The schema of each of the sport's stat lines, by kind. A stored line is read as this sport's line\n * through its schema — chosen by the adapter `leagueType` selected, never inferred from the line's\n * shape (RULE-QS-SPORT-902).\n */\nexport type SportLineSchemas<L extends LeagueType> = (typeof SPORT_LINE_SCHEMAS)[L];\n\n/** `never` for a kind the sport keeps no line of. */\nexport type SportLine<L extends LeagueType, K extends StatLineKind> = z.infer<\n SportLineSchemas<L>[K]\n>;\n\n/** The game `stats` payload of one sport: its team lines and roster-entry lines. */\nexport type SportGameStats<L extends LeagueType> = z.infer<(typeof SPORT_GAME_STATS_SCHEMAS)[L]>;\n\n// The line kind each stats table reads its rows from. Standings rows are team season lines; the\n// game page's rows are player game lines; every player-totals table — league rankings, the team\n// page, the hall of fame — reads rows shaped as membership rows.\nexport const COLUMN_CATALOG_LINE_KINDS = {\n playerTotals: 'membershipRow',\n gamePlayer: 'gamePlayer',\n teamSeason: 'teamSeason',\n} as const satisfies Record<ColumnCatalogKey, StatLineKind>;\n\nexport type ColumnCatalogRow<L extends LeagueType, K extends ColumnCatalogKey> = SportLine<\n L,\n (typeof COLUMN_CATALOG_LINE_KINDS)[K]\n>;\n\n/** A sport's three column catalogs, each over its own row type; a sport missing one does not compile. */\nexport type SportColumnCatalogs<L extends LeagueType> = {\n readonly [K in ColumnCatalogKey]: ColumnCatalog<ColumnCatalogRow<L, K>>;\n};\n\n/** What shared surfaces render for the sport instead of branching on it (RULE-QS-SPORT-904, RULE-QS-SPORT-929). */\nexport interface SportDisplay<L extends LeagueType> {\n readonly label: string;\n readonly iconKey: SportIconKey;\n /** The profile's lifetime summary for the sport: its totals, and its per-game averages beneath. */\n readonly lifetimeSummary: LifetimeSummary<SportLine<L, 'lifetime'>>;\n /** Each of the sport's event types: its scoring-panel button and its play-by-play label. */\n readonly eventLabels: Readonly<Record<SportTypeMap[L]['eventType'], StatEventLabel>>;\n /** Each counter of a team line and of a player line — what a correction row and the Correct a game form name. */\n readonly fieldLabels: StatFieldLabels<\n SportTypeMap[L]['teamStatKey'],\n SportTypeMap[L]['playerStatKey']\n >;\n /** One play-by-play line for any stored event but a void, a correction included. */\n readonly describeEvent: (event: GameStatEvent, resolve: StatEventNameResolver) => string;\n /** Present only for a sport played in rounds: the header's round line and the scoreboard's grid. */\n readonly rounds?: RoundsDisplay;\n readonly scoreboard: Scoreboard;\n /** The one component of the scoring screen that is the sport's own, named by its kind. */\n readonly scoringPanel: ScoringPanel;\n}\n\n/** The game an empty rollup is built for: its real (non-bye) teams. */\nexport interface GameTeamIds {\n readonly teamIds: readonly string[];\n}\n\n/**\n * One sport's adapter: its facts, its scoring members, its display, its column catalogs, and its\n * bulk entry. The scoring members are typed over every sport, so any registered adapter is called\n * the same way.\n */\nexport interface SportAdapter<L extends LeagueType> extends SportScoring {\n readonly leagueType: L;\n /** The storage key: `sportHallOfFame/{sportKey}`, `historicalStats/{sportKey}`, `lifetimeStats.{sportKey}`. */\n readonly sportKey: (typeof SPORT_KEY_BY_LEAGUE_TYPE)[L];\n /** The sport's own event types; the store-level void and correction belong to every sport. */\n readonly eventTypes: readonly SportTypeMap[L]['eventType'][];\n /** The counters of a team line and of a player line — what the aggregates sum and a ghost link merges. */\n readonly teamStatKeys: readonly SportTypeMap[L]['teamStatKey'][];\n readonly playerStatKeys: readonly SportTypeMap[L]['playerStatKey'][];\n /** Whether the sport keeps `sportHallOfFame/{sportKey}` and the hall-of-fame page serves it. */\n readonly hallOfFame: boolean;\n /** Whether an admin may enter pre-Q-Sports career totals for the sport. */\n readonly historicalBaseline: boolean;\n readonly lineSchemas: SportLineSchemas<L>;\n readonly display: SportDisplay<L>;\n readonly columns: SportColumnCatalogs<L>;\n /**\n * The rollup of a game with no events (RULE-QS-SPORT-915): a team line for each of the game's teams, and\n * no player lines. Every call returns new objects.\n */\n readonly emptyStats: (game: GameTeamIds) => SportGameStats<L>;\n /** The sport's bulk-entry form, whose rules `validate` enforces again on every event it becomes. */\n readonly bulkEntry: BulkEntry;\n}\n\n/** Every registered adapter, by `leagueType`. Indexing it with a generic sport keeps the sport. */\nexport type SportAdapterRegistry = { readonly [L in LeagueType]: SportAdapter<L> };\n\nexport type AnySportAdapter = SportAdapterRegistry[LeagueType];\n"]}
1
+ {"version":3,"file":"sport-adapter.js","sourceRoot":"","sources":["../../src/sports/sport-adapter.ts"],"names":[],"mappings":"AAwDA,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,YAAY,EAAE,eAAe;IAC7B,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;CACiC,CAAC","sourcesContent":["import type { z } from 'zod';\nimport type { SPORT_LINE_SCHEMAS } from '../doc-schemas/aggregate-stats.js';\nimport type { SPORT_GAME_STATS_SCHEMAS } from '../doc-schemas/sport-game.js';\nimport type {\n BasketballPlayerStatKey,\n BasketballStatEventType,\n BasketballTeamStatKey,\n CurlingStatEventType,\n CurlingTeamStatKey,\n FootballStatEventType,\n FootballTeamStatKey,\n LeagueType,\n SPORT_KEY_BY_LEAGUE_TYPE,\n SportIconKey,\n} from '../types/sports.js';\nimport type { StatLineKind } from '../types/stats.js';\nimport type { GameStatEvent } from '../doc-schemas/game-stats.js';\nimport type { BulkEntry } from './bulk-entry.js';\nimport type { ColumnCatalog, ColumnCatalogKey } from './column-catalog.js';\nimport type { LifetimeSummary } from './lifetime-summary.js';\nimport type { SportScoring } from './scoring.js';\nimport type {\n RoundsDisplay,\n Scoreboard,\n ScoringPanel,\n StatEventLabel,\n StatEventNameResolver,\n StatFieldLabels,\n} from './scoring-display.js';\n\nexport interface SportTypeMap {\n readonly Basketball: {\n readonly eventType: BasketballStatEventType;\n readonly teamStatKey: BasketballTeamStatKey;\n readonly playerStatKey: BasketballPlayerStatKey;\n };\n readonly Curling: {\n readonly eventType: CurlingStatEventType;\n readonly teamStatKey: CurlingTeamStatKey;\n readonly playerStatKey: never;\n };\n readonly Football: {\n readonly eventType: FootballStatEventType;\n readonly teamStatKey: FootballTeamStatKey;\n readonly playerStatKey: never;\n };\n}\n\nexport type SportLineSchemas<L extends LeagueType> = (typeof SPORT_LINE_SCHEMAS)[L];\n\nexport type SportLine<L extends LeagueType, K extends StatLineKind> = z.infer<\n SportLineSchemas<L>[K]\n>;\n\nexport type SportGameStats<L extends LeagueType> = z.infer<(typeof SPORT_GAME_STATS_SCHEMAS)[L]>;\n\nexport const COLUMN_CATALOG_LINE_KINDS = {\n playerTotals: 'membershipRow',\n gamePlayer: 'gamePlayer',\n teamSeason: 'teamSeason',\n} as const satisfies Record<ColumnCatalogKey, StatLineKind>;\n\nexport type ColumnCatalogRow<L extends LeagueType, K extends ColumnCatalogKey> = SportLine<\n L,\n (typeof COLUMN_CATALOG_LINE_KINDS)[K]\n>;\n\nexport type SportColumnCatalogs<L extends LeagueType> = {\n readonly [K in ColumnCatalogKey]: ColumnCatalog<ColumnCatalogRow<L, K>>;\n};\n\nexport interface SportDisplay<L extends LeagueType> {\n readonly label: string;\n readonly iconKey: SportIconKey;\n readonly lifetimeSummary: LifetimeSummary<SportLine<L, 'lifetime'>>;\n readonly eventLabels: Readonly<Record<SportTypeMap[L]['eventType'], StatEventLabel>>;\n readonly fieldLabels: StatFieldLabels<\n SportTypeMap[L]['teamStatKey'],\n SportTypeMap[L]['playerStatKey']\n >;\n readonly describeEvent: (event: GameStatEvent, resolve: StatEventNameResolver) => string;\n readonly rounds?: RoundsDisplay;\n readonly scoreboard: Scoreboard;\n readonly scoringPanel: ScoringPanel;\n}\n\nexport interface GameTeamIds {\n readonly teamIds: readonly string[];\n}\n\nexport interface SportAdapter<L extends LeagueType> extends SportScoring {\n readonly leagueType: L;\n readonly sportKey: (typeof SPORT_KEY_BY_LEAGUE_TYPE)[L];\n readonly eventTypes: readonly SportTypeMap[L]['eventType'][];\n readonly teamStatKeys: readonly SportTypeMap[L]['teamStatKey'][];\n readonly playerStatKeys: readonly SportTypeMap[L]['playerStatKey'][];\n readonly hallOfFame: boolean;\n readonly historicalBaseline: boolean;\n readonly lineSchemas: SportLineSchemas<L>;\n readonly display: SportDisplay<L>;\n readonly columns: SportColumnCatalogs<L>;\n readonly emptyStats: (game: GameTeamIds) => SportGameStats<L>;\n readonly bulkEntry: BulkEntry;\n}\n\nexport type SportAdapterRegistry = { readonly [L in LeagueType]: SportAdapter<L> };\n\nexport type AnySportAdapter = SportAdapterRegistry[LeagueType];\n"]}
@@ -4,19 +4,11 @@ import type { StatEventSubmission } from '../schemas/scoring.js';
4
4
  import type { RecordedStatEventOutcome, StatEventRefusalCode } from '../types/stats.js';
5
5
  import { type StatEventRoster } from './scoring.js';
6
6
  import type { AnySportAdapter, GameTeamIds } from './sport-adapter.js';
7
- /** The document id a submission is stored at. */
8
7
  export declare function statEventSubmissionId(submission: StatEventSubmission): string;
9
- /**
10
- * The ids a batch reads before it decides anything: every submission's own id, and every void's
11
- * target — the driver needs the stored document at each, or knows none is stored. A correction's is
12
- * never read: the driver refuses one before it looks at the store.
13
- */
14
8
  export declare function statEventIdsToRead(submissions: readonly StatEventSubmission[]): string[];
15
- /** An event the batch stores now: its id, its place in the replay, and every field its caller sent. */
16
9
  export interface AcceptedStatEvent {
17
10
  readonly eventId: string;
18
11
  readonly sequence: number;
19
- /** The document's fields but the recorder facts, which the writing core stamps (RULE-STD-ARCH-106). */
20
12
  readonly fields: Readonly<Record<string, unknown>>;
21
13
  }
22
14
  export interface RecordedStatEventResult {
@@ -26,17 +18,13 @@ export interface RecordedStatEventResult {
26
18
  }
27
19
  export type StatEventBatchDecision = {
28
20
  readonly ok: true;
29
- /** The rollup after the batch — unchanged when every event was already recorded. */
30
21
  readonly stats: GameStats;
31
22
  readonly statEventSequence: number;
32
- /** Each submission's result, in the order sent. */
33
23
  readonly results: readonly RecordedStatEventResult[];
34
- /** The events to create, in sequence order; empty when every event was already recorded. */
35
24
  readonly accepted: readonly AcceptedStatEvent[];
36
25
  } | {
37
26
  readonly ok: false;
38
27
  readonly code: StatEventRefusalCode;
39
- /** The first submission refused; nothing of the batch is written. */
40
28
  readonly eventId: string;
41
29
  };
42
30
  export interface StatEventBatch {
@@ -45,25 +33,9 @@ export interface StatEventBatch {
45
33
  readonly stats: GameStats;
46
34
  readonly statEventSequence: number;
47
35
  };
48
- /** The game's teams and the roster entries the batch names that exist. */
49
36
  readonly roster: StatEventRoster;
50
37
  readonly submissions: readonly StatEventSubmission[];
51
- /** The stored event at an id `statEventIdsToRead` named, or `undefined` where none is stored. */
52
38
  readonly storedEvent: (eventId: string) => GameStatEvent | undefined;
53
39
  }
54
- /**
55
- * Decide one scoring write. Every submission in order, against a running rollup that starts from
56
- * the stored one with a team line for each of the game's teams:
57
- *
58
- * - a correction → refused; only the game-reconcile core appends one;
59
- * - an id already stored, or earlier in the batch → acknowledged when it is the same event, and
60
- * refused (`eventIdConflict`) when it is not;
61
- * - a new sport event → the adapter validates it and applies it, and it takes the next sequence;
62
- * - a new void → its target, stored or earlier in the batch, must be one of the sport's events; the
63
- * adapter undoes it, and it takes the next sequence. A void that would leave a stat below zero —
64
- * the target's field moved down by a later edit — is refused (`undoBelowZero`).
65
- *
66
- * The first refusal refuses the whole batch.
67
- */
68
40
  export declare function decideStatEventBatch(batch: StatEventBatch): StatEventBatchDecision;
69
41
  //# sourceMappingURL=store-driver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"store-driver.d.ts","sourceRoot":"","sources":["../../src/sports/store-driver.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAA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: what one scoring write does with the batch of events it was
2
- // sent, given what the game already holds. It owns ids, the sequence, void resolution, and the fold;
3
- // everything sport-shaped is the adapter's (RULE-QS-SPORT-903). The writing core reads the game, the stored
4
- // events the batch names, and the roster entries it names, hands them here, and writes what comes
5
- // back — one transaction, all or nothing.
6
- //
7
- // An event id is the idempotency key (RULE-QS-SPORT-912): an id already stored, or earlier in the batch, is
8
- // acknowledged when its content matches and never applied again, so re-sending a batch whose first
9
- // send timed out after committing changes nothing. A void's id is derived from its target, so a
10
- // second undo of one event is the same document and is acknowledged too.
11
1
  import { buildStatVoidId } from '../ids/stat-event-ids.js';
12
2
  import { STAT_EVENT_RECORDER_FIELD_KEYS, STAT_EVENT_SNAPSHOT_FIELD_KEYS } from '../types/stats.js';
13
3
  import { foldStatEvent, withGameTeamLines } from './replay.js';
14
4
  import { isSportStatEventIn, isStatCorrection, isStatVoid, } from './scoring.js';
15
- /** The document id a submission is stored at. */
16
5
  export function statEventSubmissionId(submission) {
17
6
  return isStatVoid(submission) ? buildStatVoidId(submission.targetEventId) : submission.eventId;
18
7
  }
19
- /**
20
- * The ids a batch reads before it decides anything: every submission's own id, and every void's
21
- * target — the driver needs the stored document at each, or knows none is stored. A correction's is
22
- * never read: the driver refuses one before it looks at the store.
23
- */
24
8
  export function statEventIdsToRead(submissions) {
25
9
  const ids = new Set();
26
10
  for (const submission of submissions) {
@@ -32,7 +16,6 @@ export function statEventIdsToRead(submissions) {
32
16
  }
33
17
  return [...ids];
34
18
  }
35
- // The fields of a stored event the writing core derives, which a caller's re-send never carries.
36
19
  const DERIVED_FIELDS = new Set([
37
20
  ...STAT_EVENT_RECORDER_FIELD_KEYS,
38
21
  ...STAT_EVENT_SNAPSHOT_FIELD_KEYS,
@@ -47,47 +30,26 @@ function sameFields(left, right) {
47
30
  return (keys.length === Object.keys(rightFields).length &&
48
31
  keys.every((key) => Object.is(leftFields[key], rightFields[key])));
49
32
  }
50
- /**
51
- * Whether a submission is the event already held at its id. A void is the same void when it names
52
- * the same target; a sport event only when every field its caller supplies is the same.
53
- */
54
33
  function isSameEvent(submission, held) {
55
34
  if (isStatVoid(submission))
56
35
  return isStatVoid(held) && held.targetEventId === submission.targetEventId;
57
36
  return sameFields(submission, held);
58
37
  }
59
- /** Whether any counter, or any recorded round, of any line is below zero. */
60
38
  function holdsNegativeValue(stats) {
61
39
  const lines = [...Object.values(stats.teamStats), ...Object.values(stats.playerStats)];
62
40
  return lines.some((line) => Object.values(line).some((value) => Array.isArray(value)
63
41
  ? value.some((slot) => typeof slot === 'number' && slot < 0)
64
42
  : typeof value === 'number' && value < 0));
65
43
  }
66
- /** The stored fields of a new event: the void's derived id, or the caller's own id and fields. */
67
44
  function acceptedFields(submission, eventId, sequence) {
68
45
  return { ...callerFields(submission), eventId, sequence };
69
46
  }
70
- /**
71
- * Decide one scoring write. Every submission in order, against a running rollup that starts from
72
- * the stored one with a team line for each of the game's teams:
73
- *
74
- * - a correction → refused; only the game-reconcile core appends one;
75
- * - an id already stored, or earlier in the batch → acknowledged when it is the same event, and
76
- * refused (`eventIdConflict`) when it is not;
77
- * - a new sport event → the adapter validates it and applies it, and it takes the next sequence;
78
- * - a new void → its target, stored or earlier in the batch, must be one of the sport's events; the
79
- * adapter undoes it, and it takes the next sequence. A void that would leave a stat below zero —
80
- * the target's field moved down by a later edit — is refused (`undoBelowZero`).
81
- *
82
- * The first refusal refuses the whole batch.
83
- */
84
47
  export function decideStatEventBatch(batch) {
85
48
  const { adapter, game, roster, submissions, storedEvent } = batch;
86
49
  let stats = withGameTeamLines(adapter, game.stats, game);
87
50
  let sequence = game.statEventSequence;
88
51
  const results = [];
89
52
  const accepted = [];
90
- // Every event the batch has placed so far — stored or new — by id, with the sequence it holds.
91
53
  const placed = new Map();
92
54
  for (const submission of submissions) {
93
55
  const eventId = statEventSubmissionId(submission);