@ttt-productions/q-core 0.1.16 → 0.1.18

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 (275) hide show
  1. package/dist/constants/business.d.ts.map +1 -1
  2. package/dist/constants/business.js +25 -5
  3. package/dist/constants/business.js.map +1 -1
  4. package/dist/constants/sports.d.ts.map +1 -1
  5. package/dist/constants/sports.js +2 -2
  6. package/dist/constants/sports.js.map +1 -1
  7. package/dist/doc-schemas/admin-notifications.d.ts +1 -1
  8. package/dist/doc-schemas/admin-notifications.d.ts.map +1 -1
  9. package/dist/doc-schemas/admin-notifications.js +4 -1
  10. package/dist/doc-schemas/admin-notifications.js.map +1 -1
  11. package/dist/doc-schemas/aggregate-stats.d.ts.map +1 -1
  12. package/dist/doc-schemas/aggregate-stats.js +4 -1
  13. package/dist/doc-schemas/aggregate-stats.js.map +1 -1
  14. package/dist/doc-schemas/atoms.d.ts.map +1 -1
  15. package/dist/doc-schemas/atoms.js +2 -2
  16. package/dist/doc-schemas/atoms.js.map +1 -1
  17. package/dist/doc-schemas/audit-event.d.ts.map +1 -1
  18. package/dist/doc-schemas/audit-event.js +8 -4
  19. package/dist/doc-schemas/audit-event.js.map +1 -1
  20. package/dist/doc-schemas/award-group-grant.d.ts.map +1 -1
  21. package/dist/doc-schemas/award-group-grant.js +11 -3
  22. package/dist/doc-schemas/award-group-grant.js.map +1 -1
  23. package/dist/doc-schemas/catalogs.js +1 -1
  24. package/dist/doc-schemas/catalogs.js.map +1 -1
  25. package/dist/doc-schemas/gallery.js +1 -1
  26. package/dist/doc-schemas/gallery.js.map +1 -1
  27. package/dist/doc-schemas/game-stat-history.d.ts.map +1 -1
  28. package/dist/doc-schemas/game-stat-history.js.map +1 -1
  29. package/dist/doc-schemas/game-stats.d.ts.map +1 -1
  30. package/dist/doc-schemas/game-stats.js +10 -2
  31. package/dist/doc-schemas/game-stats.js.map +1 -1
  32. package/dist/doc-schemas/league-team.js +1 -1
  33. package/dist/doc-schemas/league-team.js.map +1 -1
  34. package/dist/doc-schemas/membership-roster-sync.d.ts.map +1 -1
  35. package/dist/doc-schemas/membership-roster-sync.js +2 -1
  36. package/dist/doc-schemas/membership-roster-sync.js.map +1 -1
  37. package/dist/doc-schemas/migration-console.js +1 -1
  38. package/dist/doc-schemas/migration-console.js.map +1 -1
  39. package/dist/doc-schemas/pending-media.d.ts.map +1 -1
  40. package/dist/doc-schemas/pending-media.js.map +1 -1
  41. package/dist/doc-schemas/picture-retirement.d.ts.map +1 -1
  42. package/dist/doc-schemas/picture-retirement.js +5 -1
  43. package/dist/doc-schemas/picture-retirement.js.map +1 -1
  44. package/dist/doc-schemas/registry.d.ts +1 -1
  45. package/dist/doc-schemas/registry.d.ts.map +1 -1
  46. package/dist/doc-schemas/registry.js +1 -1
  47. package/dist/doc-schemas/registry.js.map +1 -1
  48. package/dist/doc-schemas/sport-game.d.ts.map +1 -1
  49. package/dist/doc-schemas/sport-game.js.map +1 -1
  50. package/dist/doc-schemas/sport-league.d.ts.map +1 -1
  51. package/dist/doc-schemas/sport-league.js +10 -2
  52. package/dist/doc-schemas/sport-league.js.map +1 -1
  53. package/dist/doc-schemas/status-reconcile-queue.d.ts.map +1 -1
  54. package/dist/doc-schemas/status-reconcile-queue.js.map +1 -1
  55. package/dist/doc-schemas/sweep-state.d.ts.map +1 -1
  56. package/dist/doc-schemas/sweep-state.js +10 -2
  57. package/dist/doc-schemas/sweep-state.js.map +1 -1
  58. package/dist/doc-schemas/system.d.ts.map +1 -1
  59. package/dist/doc-schemas/system.js.map +1 -1
  60. package/dist/doc-schemas/user-profile.d.ts.map +1 -1
  61. package/dist/doc-schemas/user-profile.js +1 -1
  62. package/dist/doc-schemas/user-profile.js.map +1 -1
  63. package/dist/doc-schemas/waivers-and-hardware.d.ts.map +1 -1
  64. package/dist/doc-schemas/waivers-and-hardware.js +15 -3
  65. package/dist/doc-schemas/waivers-and-hardware.js.map +1 -1
  66. package/dist/domain-events/domain-events.d.ts.map +1 -1
  67. package/dist/domain-events/domain-events.js +88 -24
  68. package/dist/domain-events/domain-events.js.map +1 -1
  69. package/dist/ids/notification-ids.d.ts.map +1 -1
  70. package/dist/ids/notification-ids.js.map +1 -1
  71. package/dist/ids/picture-ids.d.ts.map +1 -1
  72. package/dist/ids/picture-ids.js.map +1 -1
  73. package/dist/ids/stat-event-ids.d.ts.map +1 -1
  74. package/dist/ids/stat-event-ids.js.map +1 -1
  75. package/dist/ids/waiver-template-ids.d.ts.map +1 -1
  76. package/dist/ids/waiver-template-ids.js.map +1 -1
  77. package/dist/index.d.ts +4 -9
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +6 -9
  80. package/dist/index.js.map +1 -1
  81. package/dist/input-formats/{index.d.ts → input-formats.d.ts} +1 -1
  82. package/dist/input-formats/input-formats.d.ts.map +1 -0
  83. package/dist/input-formats/{index.js → input-formats.js} +1 -1
  84. package/dist/input-formats/input-formats.js.map +1 -0
  85. package/dist/media/file-origins.d.ts.map +1 -1
  86. package/dist/media/file-origins.js +30 -6
  87. package/dist/media/file-origins.js.map +1 -1
  88. package/dist/migration-console/action-ids.d.ts.map +1 -1
  89. package/dist/migration-console/action-ids.js.map +1 -1
  90. package/dist/migration-console/manifest.d.ts.map +1 -1
  91. package/dist/migration-console/manifest.js +42 -7
  92. package/dist/migration-console/manifest.js.map +1 -1
  93. package/dist/migration-console/run-state.d.ts.map +1 -1
  94. package/dist/migration-console/run-state.js.map +1 -1
  95. package/dist/notifications/admin-notification-config.d.ts.map +1 -1
  96. package/dist/notifications/admin-notification-config.js +5 -3
  97. package/dist/notifications/admin-notification-config.js.map +1 -1
  98. package/dist/notifications/occurrences.d.ts.map +1 -1
  99. package/dist/notifications/occurrences.js.map +1 -1
  100. package/dist/paths/path-builders.d.ts.map +1 -1
  101. package/dist/paths/path-builders.js +60 -15
  102. package/dist/paths/path-builders.js.map +1 -1
  103. package/dist/paths/picture-owner-paths.d.ts.map +1 -1
  104. package/dist/paths/picture-owner-paths.js.map +1 -1
  105. package/dist/paths/storage-paths.d.ts.map +1 -1
  106. package/dist/paths/storage-paths.js.map +1 -1
  107. package/dist/schemas/admin-notifications.d.ts.map +1 -1
  108. package/dist/schemas/admin-notifications.js +8 -4
  109. package/dist/schemas/admin-notifications.js.map +1 -1
  110. package/dist/schemas/app-config.js +1 -1
  111. package/dist/schemas/app-config.js.map +1 -1
  112. package/dist/schemas/atoms.d.ts +0 -1
  113. package/dist/schemas/atoms.d.ts.map +1 -1
  114. package/dist/schemas/atoms.js +3 -5
  115. package/dist/schemas/atoms.js.map +1 -1
  116. package/dist/schemas/awards.d.ts.map +1 -1
  117. package/dist/schemas/awards.js +13 -5
  118. package/dist/schemas/awards.js.map +1 -1
  119. package/dist/schemas/dead-letters.d.ts.map +1 -1
  120. package/dist/schemas/dead-letters.js +6 -3
  121. package/dist/schemas/dead-letters.js.map +1 -1
  122. package/dist/schemas/game-locations.d.ts.map +1 -1
  123. package/dist/schemas/game-locations.js +1 -1
  124. package/dist/schemas/game-locations.js.map +1 -1
  125. package/dist/schemas/hardware-loan-contracts.d.ts.map +1 -1
  126. package/dist/schemas/hardware-loan-contracts.js +11 -4
  127. package/dist/schemas/hardware-loan-contracts.js.map +1 -1
  128. package/dist/schemas/leagues.d.ts +2 -2
  129. package/dist/schemas/leagues.d.ts.map +1 -1
  130. package/dist/schemas/leagues.js +12 -3
  131. package/dist/schemas/leagues.js.map +1 -1
  132. package/dist/schemas/migration-console.d.ts.map +1 -1
  133. package/dist/schemas/migration-console.js +3 -6
  134. package/dist/schemas/migration-console.js.map +1 -1
  135. package/dist/schemas/pictures.d.ts.map +1 -1
  136. package/dist/schemas/pictures.js +6 -2
  137. package/dist/schemas/pictures.js.map +1 -1
  138. package/dist/schemas/schedules.d.ts +8 -8
  139. package/dist/schemas/schedules.d.ts.map +1 -1
  140. package/dist/schemas/schedules.js +9 -3
  141. package/dist/schemas/schedules.js.map +1 -1
  142. package/dist/schemas/scoring.d.ts +12 -12
  143. package/dist/schemas/scoring.d.ts.map +1 -1
  144. package/dist/schemas/scoring.js +11 -4
  145. package/dist/schemas/scoring.js.map +1 -1
  146. package/dist/schemas/signed-waivers.d.ts.map +1 -1
  147. package/dist/schemas/signed-waivers.js +5 -3
  148. package/dist/schemas/signed-waivers.js.map +1 -1
  149. package/dist/schemas/stats.d.ts.map +1 -1
  150. package/dist/schemas/stats.js +27 -8
  151. package/dist/schemas/stats.js.map +1 -1
  152. package/dist/schemas/team-joining.d.ts.map +1 -1
  153. package/dist/schemas/team-joining.js +13 -5
  154. package/dist/schemas/team-joining.js.map +1 -1
  155. package/dist/schemas/teams.d.ts.map +1 -1
  156. package/dist/schemas/teams.js +19 -6
  157. package/dist/schemas/teams.js.map +1 -1
  158. package/dist/schemas/uploads.d.ts.map +1 -1
  159. package/dist/schemas/uploads.js +12 -5
  160. package/dist/schemas/uploads.js.map +1 -1
  161. package/dist/schemas/users.d.ts.map +1 -1
  162. package/dist/schemas/users.js +22 -8
  163. package/dist/schemas/users.js.map +1 -1
  164. package/dist/schemas/waiver-templates.js +1 -1
  165. package/dist/schemas/waiver-templates.js.map +1 -1
  166. package/dist/sports/basketball-scoring.d.ts.map +1 -1
  167. package/dist/sports/basketball-scoring.js +67 -16
  168. package/dist/sports/basketball-scoring.js.map +1 -1
  169. package/dist/sports/basketball.d.ts.map +1 -1
  170. package/dist/sports/basketball.js +34 -7
  171. package/dist/sports/basketball.js.map +1 -1
  172. package/dist/sports/column-catalog.d.ts.map +1 -1
  173. package/dist/sports/column-catalog.js +4 -1
  174. package/dist/sports/column-catalog.js.map +1 -1
  175. package/dist/sports/contribution.d.ts.map +1 -1
  176. package/dist/sports/contribution.js +10 -3
  177. package/dist/sports/contribution.js.map +1 -1
  178. package/dist/sports/curling-scoring.d.ts.map +1 -1
  179. package/dist/sports/curling-scoring.js +30 -8
  180. package/dist/sports/curling-scoring.js.map +1 -1
  181. package/dist/sports/curling.d.ts.map +1 -1
  182. package/dist/sports/curling.js +1 -1
  183. package/dist/sports/curling.js.map +1 -1
  184. package/dist/sports/finalized-record.d.ts.map +1 -1
  185. package/dist/sports/finalized-record.js.map +1 -1
  186. package/dist/sports/football-scoring.d.ts.map +1 -1
  187. package/dist/sports/football-scoring.js +28 -8
  188. package/dist/sports/football-scoring.js.map +1 -1
  189. package/dist/sports/football.d.ts.map +1 -1
  190. package/dist/sports/football.js +1 -1
  191. package/dist/sports/football.js.map +1 -1
  192. package/dist/sports/index.d.ts +2 -2
  193. package/dist/sports/index.d.ts.map +1 -1
  194. package/dist/sports/index.js +1 -1
  195. package/dist/sports/index.js.map +1 -1
  196. package/dist/sports/ledger-continuity.d.ts.map +1 -1
  197. package/dist/sports/ledger-continuity.js.map +1 -1
  198. package/dist/sports/rankings.d.ts.map +1 -1
  199. package/dist/sports/rankings.js +5 -1
  200. package/dist/sports/rankings.js.map +1 -1
  201. package/dist/sports/replay.d.ts.map +1 -1
  202. package/dist/sports/replay.js +4 -1
  203. package/dist/sports/replay.js.map +1 -1
  204. package/dist/sports/rollup-check.d.ts.map +1 -1
  205. package/dist/sports/rollup-check.js +15 -3
  206. package/dist/sports/rollup-check.js.map +1 -1
  207. package/dist/sports/score-mirror.d.ts.map +1 -1
  208. package/dist/sports/score-mirror.js.map +1 -1
  209. package/dist/sports/scoring-display.d.ts.map +1 -1
  210. package/dist/sports/scoring-display.js.map +1 -1
  211. package/dist/sports/scoring.d.ts.map +1 -1
  212. package/dist/sports/scoring.js.map +1 -1
  213. package/dist/sports/sport-adapter.d.ts.map +1 -1
  214. package/dist/sports/sport-adapter.js.map +1 -1
  215. package/dist/sports/store-driver.d.ts.map +1 -1
  216. package/dist/sports/store-driver.js +18 -7
  217. package/dist/sports/store-driver.js.map +1 -1
  218. package/dist/types/audit.d.ts.map +1 -1
  219. package/dist/types/audit.js +16 -3
  220. package/dist/types/audit.js.map +1 -1
  221. package/dist/types/index.d.ts +0 -1
  222. package/dist/types/index.d.ts.map +1 -1
  223. package/dist/types/index.js +0 -1
  224. package/dist/types/index.js.map +1 -1
  225. package/dist/types/notifications.d.ts.map +1 -1
  226. package/dist/types/notifications.js +9 -13
  227. package/dist/types/notifications.js.map +1 -1
  228. package/dist/types/schedules.d.ts.map +1 -1
  229. package/dist/types/schedules.js.map +1 -1
  230. package/dist/types/sports.d.ts.map +1 -1
  231. package/dist/types/sports.js +9 -2
  232. package/dist/types/sports.js.map +1 -1
  233. package/dist/types/stats.d.ts.map +1 -1
  234. package/dist/types/stats.js +45 -9
  235. package/dist/types/stats.js.map +1 -1
  236. package/dist/types/unions.d.ts.map +1 -1
  237. package/dist/types/unions.js +32 -6
  238. package/dist/types/unions.js.map +1 -1
  239. package/dist/upload-variables/picture-upload-variables.d.ts.map +1 -1
  240. package/dist/upload-variables/picture-upload-variables.js +4 -2
  241. package/dist/upload-variables/picture-upload-variables.js.map +1 -1
  242. package/dist/upload-variables/sign-hardware-contract-variables.d.ts.map +1 -1
  243. package/dist/upload-variables/sign-hardware-contract-variables.js +4 -2
  244. package/dist/upload-variables/sign-hardware-contract-variables.js.map +1 -1
  245. package/dist/upload-variables/sign-waiver-variables.d.ts.map +1 -1
  246. package/dist/upload-variables/sign-waiver-variables.js +5 -3
  247. package/dist/upload-variables/sign-waiver-variables.js.map +1 -1
  248. package/dist/utils/app-config.d.ts.map +1 -1
  249. package/dist/utils/app-config.js +5 -1
  250. package/dist/utils/app-config.js.map +1 -1
  251. package/dist/utils/app-routes.d.ts.map +1 -1
  252. package/dist/utils/app-routes.js +6 -1
  253. package/dist/utils/app-routes.js.map +1 -1
  254. package/dist/utils/league-calendar.d.ts.map +1 -1
  255. package/dist/utils/league-calendar.js +4 -1
  256. package/dist/utils/league-calendar.js.map +1 -1
  257. package/dist/utils/league-join-warning.d.ts.map +1 -1
  258. package/dist/utils/league-join-warning.js +15 -5
  259. package/dist/utils/league-join-warning.js.map +1 -1
  260. package/dist/utils/schedules.d.ts.map +1 -1
  261. package/dist/utils/schedules.js +6 -2
  262. package/dist/utils/schedules.js.map +1 -1
  263. package/dist/utils/team-member-actions.d.ts.map +1 -1
  264. package/dist/utils/team-member-actions.js.map +1 -1
  265. package/package.json +5 -17
  266. package/dist/input-formats/index.d.ts.map +0 -1
  267. package/dist/input-formats/index.js.map +0 -1
  268. package/dist/migration-console/index.d.ts +0 -4
  269. package/dist/migration-console/index.d.ts.map +0 -1
  270. package/dist/migration-console/index.js +0 -5
  271. package/dist/migration-console/index.js.map +0 -1
  272. package/dist/types/documents.d.ts +0 -24
  273. package/dist/types/documents.d.ts.map +0 -1
  274. package/dist/types/documents.js +0 -5
  275. package/dist/types/documents.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"dead-letters.js","sourceRoot":"","sources":["../../src/schemas/dead-letters.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,oGAAoG;AACpG,uGAAuG;AACvG,mGAAmG;AACnG,cAAc;AAEd,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,oDAAoD;AACpD,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,wBAAwB,CAAU,CAAC;AAC/E,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;AAG9E,gFAAgF;AAChF,MAAM,CAAC,MAAM,6BAA6B,GAAqD;IAC7F,sBAAsB,EAAE,6BAA6B;CACtD,CAAC;AAEF,+CAA+C;AAC/C,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C,iGAAiG;AACjG,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,UAAU,EAAE,0BAA0B,CAAC,QAAQ,EAAE;IACjD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAA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,CAAC,CAAC,QAAQ,EAAE;IACpC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;IAClC,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACrC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the operator's dead letters: the read-only list of the durable rows every\n// supported pipeline stopped retrying, and the replay that puts one back to work after the cause is\n// fixed. The replay is a repair, so it takes the admin's reason (BACKEND-212). The caller names a lane\n// and a row id, never a Firestore path: the backend's lane registry derives the document from them\n// (ARCH-106).\n\nimport { z } from 'zod';\nimport { countSchema, documentIdSegmentSchema, epochMsSchema } from '../doc-schemas/atoms.js';\nimport { repairReasonSchema } from './atoms.js';\n\n/** Every ledger the dead-letter replay supports. */\nexport const DEAD_LETTER_COLLECTION_KEYS = ['notificationDeliveries'] as const;\nexport const DeadLetterCollectionSchema = z.enum(DEAD_LETTER_COLLECTION_KEYS);\nexport type DeadLetterCollection = z.infer<typeof DeadLetterCollectionSchema>;\n\n/** What the operator's screen calls each lane, beside its raw collection id. */\nexport const DEAD_LETTER_COLLECTION_LABELS: { readonly [K in DeadLetterCollection]: string } = {\n notificationDeliveries: 'Admin notification delivery',\n};\n\n/** The most rows the list returns per lane. */\nexport const MAX_DEAD_LETTERS_LISTED = 200;\n\n// The list: every lane, or one; at most `limit` rows per lane, under the callable's own ceiling.\nexport const GetDeadLettersInputSchema = z\n .object({\n collection: DeadLetterCollectionSchema.optional(),\n limit: z.number().int().min(1).max(MAX_DEAD_LETTERS_LISTED).optional(),\n })\n .strict()\n .nullish();\nexport type GetDeadLettersInput = z.infer<typeof GetDeadLettersInputSchema>;\n\n// One parked row, a projection over the lanes' own row shapes: each names its dead-letter time, last\n// error, and attempts in its own fields, and the list maps them onto these.\nexport const DeadLetterRowSchema = z\n .object({\n collection: DeadLetterCollectionSchema,\n docId: z.string().min(1),\n deadLetteredAt: epochMsSchema.nullable(),\n lastError: z.string().nullable(),\n attemptCount: countSchema.nullable(),\n })\n .strict();\nexport type DeadLetterRow = z.infer<typeof DeadLetterRowSchema>;\n\n// `truncated` is true when any lane hit the row cap: more parked rows exist than shown.\nexport const GetDeadLettersResultSchema = z\n .object({ generatedAt: epochMsSchema, rows: z.array(DeadLetterRowSchema), truncated: z.boolean() })\n .strict();\nexport type GetDeadLettersResult = z.infer<typeof GetDeadLettersResultSchema>;\n\n// `dryRun` inspects the row — its status, and what a replay would reset it to — and writes nothing.\nexport const AdminReplayDeadLetterInputSchema = z\n .object({\n collection: DeadLetterCollectionSchema,\n docId: documentIdSegmentSchema,\n reason: repairReasonSchema,\n dryRun: z.boolean().optional(),\n })\n .strict();\nexport type AdminReplayDeadLetterInput = z.infer<typeof AdminReplayDeadLetterInputSchema>;\n\n// A performed replay answers `replayed` and the active value the row was reset to; a dry run answers\n// `dryRun`, the row's current status, and what a replay would reset it to.\nexport const AdminReplayDeadLetterResultSchema = z\n .object({\n collection: DeadLetterCollectionSchema,\n docId: z.string().min(1),\n replayed: z.literal(true).optional(),\n resetTo: z.string().optional(),\n dryRun: z.literal(true).optional(),\n currentStatus: z.unknown().optional(),\n wouldResetTo: z.string().optional(),\n })\n .strict();\nexport type AdminReplayDeadLetterResult = z.infer<typeof AdminReplayDeadLetterResultSchema>;\n"]}
1
+ {"version":3,"file":"dead-letters.js","sourceRoot":"","sources":["../../src/schemas/dead-letters.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,oGAAoG;AACpG,uGAAuG;AACvG,mGAAmG;AACnG,cAAc;AAEd,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,aAAa,EACb,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,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M,EAAE,CAAC;AAGZ,oGAAoG;AACpG,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,UAAU,EAAE,0BAA0B;IACtC,KAAK,EAAE,uBAAuB;IAC9B,MAAM,EAAE,kBAAkB;IAC1B,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,qGAAqG;AACrG,2EAA2E;AAC3E,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,UAAU,EAAE,0BAA0B;IACtC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;IACpC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;IAClC,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACrC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the operator's dead letters: the read-only list of the durable rows every\n// supported pipeline stopped retrying, and the replay that puts one back to work after the cause is\n// fixed. The replay is a repair, so it takes the admin's reason (BACKEND-212). The caller names a lane\n// and a row id, never a Firestore path: the backend's lane registry derives the document from them\n// (ARCH-106).\n\nimport { z } from 'zod';\nimport {\n countSchema,\n documentIdSegmentSchema,\n epochMsSchema,\n repairReasonSchema,\n} from '../doc-schemas/atoms.js';\n\n/** Every ledger the dead-letter replay supports. */\nexport const DEAD_LETTER_COLLECTION_KEYS = ['notificationDeliveries'] as const;\nexport const DeadLetterCollectionSchema = z.enum(DEAD_LETTER_COLLECTION_KEYS);\nexport type DeadLetterCollection = z.infer<typeof DeadLetterCollectionSchema>;\n\n/** What the operator's screen calls each lane, beside its raw collection id. */\nexport const DEAD_LETTER_COLLECTION_LABELS: { readonly [K in DeadLetterCollection]: string } = {\n notificationDeliveries: 'Admin notification delivery',\n};\n\n/** The most rows the list returns per lane. */\nexport const MAX_DEAD_LETTERS_LISTED = 200;\n\n// The list: every lane, or one; at most `limit` rows per lane, under the callable's own ceiling.\nexport const GetDeadLettersInputSchema = z\n .object({\n collection: DeadLetterCollectionSchema.optional(),\n limit: z.number().int().min(1).max(MAX_DEAD_LETTERS_LISTED).optional(),\n })\n .strict()\n .nullish();\nexport type GetDeadLettersInput = z.infer<typeof GetDeadLettersInputSchema>;\n\n// One parked row, a projection over the lanes' own row shapes: each names its dead-letter time, last\n// error, and attempts in its own fields, and the list maps them onto these.\nexport const DeadLetterRowSchema = z\n .object({\n collection: DeadLetterCollectionSchema,\n docId: z.string().min(1),\n deadLetteredAt: epochMsSchema.nullable(),\n lastError: z.string().nullable(),\n attemptCount: countSchema.nullable(),\n })\n .strict();\nexport type DeadLetterRow = z.infer<typeof DeadLetterRowSchema>;\n\n// `truncated` is true when any lane hit the row cap: more parked rows exist than shown.\nexport const GetDeadLettersResultSchema = z\n .object({\n generatedAt: epochMsSchema,\n rows: z.array(DeadLetterRowSchema),\n truncated: z.boolean(),\n })\n .strict();\nexport type GetDeadLettersResult = z.infer<typeof GetDeadLettersResultSchema>;\n\n// `dryRun` inspects the row — its status, and what a replay would reset it to — and writes nothing.\nexport const AdminReplayDeadLetterInputSchema = z\n .object({\n collection: DeadLetterCollectionSchema,\n docId: documentIdSegmentSchema,\n reason: repairReasonSchema,\n dryRun: z.boolean().optional(),\n })\n .strict();\nexport type AdminReplayDeadLetterInput = z.infer<typeof AdminReplayDeadLetterInputSchema>;\n\n// A performed replay answers `replayed` and the active value the row was reset to; a dry run answers\n// `dryRun`, the row's current status, and what a replay would reset it to.\nexport const AdminReplayDeadLetterResultSchema = z\n .object({\n collection: DeadLetterCollectionSchema,\n docId: z.string().min(1),\n replayed: z.literal(true).optional(),\n resetTo: z.string().optional(),\n dryRun: z.literal(true).optional(),\n currentStatus: z.unknown().optional(),\n wouldResetTo: z.string().optional(),\n })\n .strict();\nexport type AdminReplayDeadLetterResult = z.infer<typeof AdminReplayDeadLetterResultSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"game-locations.d.ts","sourceRoot":"","sources":["../../src/schemas/game-locations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,sBAAsB,wDAAmD,CAAC;AACvF,eAAO,MAAM,+BAA+B,wDAA6D,CAAC;AAE1G,eAAO,MAAM,6BAA6B,wDAA2D,CAAC;AACtG,eAAO,MAAM,8BAA8B,oEAKvC,CAAC;AAEL,eAAO,MAAM,sBAAsB,wDAAmD,CAAC;AAWvF,eAAO,MAAM,kCAAkC;;;;;kBAA6C,CAAC;AAC7F,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,eAAO,MAAM,mCAAmC;;kBAErC,CAAC;AACZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG,eAAO,MAAM,kCAAkC;;;;;;kBAY5C,CAAC;AACJ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,eAAO,MAAM,mCAAmC;;kBAErC,CAAC;AACZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG,eAAO,MAAM,kCAAkC;;kBAEpC,CAAC;AACZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,eAAO,MAA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from 'zod';
4
4
  import { MAX_GAME_LOCATION_SUB_LOCATIONS } from '../constants/business.js';
5
5
  import { textFieldSchema } from '../doc-schemas/atoms.js';
6
6
  import { gameLocationIdSchema } from '../doc-schemas/game-location.js';
7
- import { GAME_LOCATION_MEMO_INPUT_FORMAT, GAME_LOCATION_NAME_INPUT_FORMAT, GAME_LOCATION_STREET_ADDRESS_INPUT_FORMAT, GAME_LOCATION_SUB_LOCATION_INPUT_FORMAT, } from '../input-formats/index.js';
7
+ import { GAME_LOCATION_MEMO_INPUT_FORMAT, GAME_LOCATION_NAME_INPUT_FORMAT, GAME_LOCATION_STREET_ADDRESS_INPUT_FORMAT, GAME_LOCATION_SUB_LOCATION_INPUT_FORMAT, } from '../input-formats/input-formats.js';
8
8
  export const gameLocationNameSchema = textFieldSchema(GAME_LOCATION_NAME_INPUT_FORMAT);
9
9
  export const gameLocationStreetAddressSchema = textFieldSchema(GAME_LOCATION_STREET_ADDRESS_INPUT_FORMAT);
10
10
  // One court, sheet, or room within a venue — as the venue lists it, and as a game names it.
@@ -1 +1 @@
1
- {"version":3,"file":"game-locations.js","sourceRoot":"","sources":["../../src/schemas/game-locations.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,yEAAyE;AAEzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EAC/B,yCAAyC,EACzC,uCAAuC,GACxC,MAAM,2BAA2B,CAAC;AAEnC,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAC,+BAA+B,CAAC,CAAC;AACvF,MAAM,CAAC,MAAM,+BAA+B,GAAG,eAAe,CAAC,yCAAyC,CAAC,CAAC;AAC1G,4FAA4F;A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AAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,EAC9G,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAC1C,CAAC;AAEJ,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC;KACjD,MAAM,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAC;KAChD,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC;KAChD,MAAM,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAC;KAChD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC;KACjD,MAAM,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAC;KAChD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for game locations: create, edit, and delete one venue. Admin only. The\n// venue's picture goes through the upload pipeline, never through these.\n\nimport { z } from 'zod';\nimport { MAX_GAME_LOCATION_SUB_LOCATIONS } from '../constants/business.js';\nimport { textFieldSchema } from '../doc-schemas/atoms.js';\nimport { gameLocationIdSchema } from '../doc-schemas/game-location.js';\nimport {\n GAME_LOCATION_MEMO_INPUT_FORMAT,\n GAME_LOCATION_NAME_INPUT_FORMAT,\n GAME_LOCATION_STREET_ADDRESS_INPUT_FORMAT,\n GAME_LOCATION_SUB_LOCATION_INPUT_FORMAT,\n} from '../input-formats/index.js';\n\nexport const gameLocationNameSchema = textFieldSchema(GAME_LOCATION_NAME_INPUT_FORMAT);\nexport const gameLocationStreetAddressSchema = textFieldSchema(GAME_LOCATION_STREET_ADDRESS_INPUT_FORMAT);\n// One court, sheet, or room within a venue — as the venue lists it, and as a game names it.\nexport const gameLocationSubLocationSchema = textFieldSchema(GAME_LOCATION_SUB_LOCATION_INPUT_FORMAT);\nexport const gameLocationSubLocationsSchema = z\n .array(gameLocationSubLocationSchema)\n .max(MAX_GAME_LOCATION_SUB_LOCATIONS)\n .refine((subLocations) => new Set(subLocations).size === subLocations.length, {\n message: 'Each sub-location may appear only once.',\n });\n// An empty memo means the venue has none.\nexport const gameLocationMemoSchema = textFieldSchema(GAME_LOCATION_MEMO_INPUT_FORMAT);\n\n// The venue's own fields. A create sends all of them; an edit sends only the ones the admin\n// changed, so saving one never rewrites another with what this editor last read.\nconst gameLocationFieldsShape = {\n name: gameLocationNameSchema,\n streetAddress: gameLocationStreetAddressSchema,\n subLocations: gameLocationSubLocationsSchema,\n memo: gameLocationMemoSchema,\n};\n\nexport const AdminCreateGameLocationInputSchema = z.object(gameLocationFieldsShape).strict();\nexport type AdminCreateGameLocationInput = z.infer<typeof AdminCreateGameLocationInputSchema>;\nexport const AdminCreateGameLocationResultSchema = z\n .object({ gameLocationId: gameLocationIdSchema })\n .strict();\nexport type AdminCreateGameLocationResult = z.infer<typeof AdminCreateGameLocationResultSchema>;\n\nexport const AdminUpdateGameLocationInputSchema = z\n .object({\n gameLocationId: gameLocationIdSchema,\n name: gameLocationNameSchema.optional(),\n streetAddress: gameLocationStreetAddressSchema.optional(),\n subLocations: gameLocationSubLocationsSchema.optional(),\n memo: gameLocationMemoSchema.optional(),\n })\n .strict()\n .refine(\n ({ gameLocationId: _gameLocationId, ...fields }) => Object.values(fields).some((value) => value !== undefined),\n { message: 'Change at least one field.' },\n );\nexport type AdminUpdateGameLocationInput = z.infer<typeof AdminUpdateGameLocationInputSchema>;\nexport const AdminUpdateGameLocationResultSchema = z\n .object({ gameLocationId: gameLocationIdSchema })\n .strict();\nexport type AdminUpdateGameLocationResult = z.infer<typeof AdminUpdateGameLocationResultSchema>;\n\nexport const AdminDeleteGameLocationInputSchema = z\n .object({ gameLocationId: gameLocationIdSchema })\n .strict();\nexport type AdminDeleteGameLocationInput = z.infer<typeof AdminDeleteGameLocationInputSchema>;\nexport const AdminDeleteGameLocationResultSchema = z\n .object({ gameLocationId: gameLocationIdSchema })\n .strict();\nexport type AdminDeleteGameLocationResult = z.infer<typeof AdminDeleteGameLocationResultSchema>;\n"]}
1
+ {"version":3,"file":"game-locations.js","sourceRoot":"","sources":["../../src/schemas/game-locations.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,yEAAyE;AAEzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EAC/B,yCAAyC,EACzC,uCAAuC,GACxC,MAAM,mCAAmC,CAAC;AAE3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAC,+BAA+B,CAAC,CAAC;AACvF,MAAM,CAAC,MAAM,+BAA+B,GAAG,eAAe,CAC5D,yCAAyC,CAC1C,CAAC;AACF,4FAA4F;AAC5F,MAAM,CAAC,MAAM,6BAA6B,GAAG,eAAe,CAC1D,uCAAuC,CACxC,CAAC;AACF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC;KAC5C,KAAK,CAAC,6BAA6B,CAAC;KACpC,GAAG,CAAC,+BAA+B,CAAC;KACpC,MAAM,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,MAAM,EAAE;IAC5E,OAAO,EAAE,yCAAyC;CACnD,CAAC,CAAC;AACL,0CAA0C;AAC1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAC,+BAA+B,CAAC,CAAC;AAEvF,4FAA4F;AAC5F,iFAAiF;AACjF,MAAM,uBAAuB,GAAG;IAC9B,IAAI,EAAE,sBAAsB;IAC5B,aAAa,EAAE,+BAA+B;IAC9C,YAAY,EAAE,8BAA8B;IAC5C,IAAI,EAAE,sBAAsB;CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,MAAM,EAAE,CAAC;AAE7F,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC;KACjD,MAAM,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAC;KAChD,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC;KAChD,MAAM,CAAC;IACN,cAAc,EAAE,oBAAoB;IACpC,IAAI,EAAE,sBAAsB,CAAC,QAAQ,EAAE;IACvC,aAAa,EAAE,+BAA+B,CAAC,QAAQ,EAAE;IACzD,YAAY,EAAE,8BAA8B,CAAC,QAAQ,EAAE;IACvD,IAAI,EAAE,sBAAsB,CAAC,QAAQ,EAAE;CACxC,CAAC;KACD,MAAM,EAAE;KACR,MAAM,CACL,CAAC,EAAE,cAAc,EAAE,eAAe,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE,CACjD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,EAC5D,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAC1C,CAAC;AAEJ,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC;KACjD,MAAM,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAC;KAChD,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC;KAChD,MAAM,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAC;KAChD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC;KACjD,MAAM,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAC;KAChD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for game locations: create, edit, and delete one venue. Admin only. The\n// venue's picture goes through the upload pipeline, never through these.\n\nimport { z } from 'zod';\nimport { MAX_GAME_LOCATION_SUB_LOCATIONS } from '../constants/business.js';\nimport { textFieldSchema } from '../doc-schemas/atoms.js';\nimport { gameLocationIdSchema } from '../doc-schemas/game-location.js';\nimport {\n GAME_LOCATION_MEMO_INPUT_FORMAT,\n GAME_LOCATION_NAME_INPUT_FORMAT,\n GAME_LOCATION_STREET_ADDRESS_INPUT_FORMAT,\n GAME_LOCATION_SUB_LOCATION_INPUT_FORMAT,\n} from '../input-formats/input-formats.js';\n\nexport const gameLocationNameSchema = textFieldSchema(GAME_LOCATION_NAME_INPUT_FORMAT);\nexport const gameLocationStreetAddressSchema = textFieldSchema(\n GAME_LOCATION_STREET_ADDRESS_INPUT_FORMAT,\n);\n// One court, sheet, or room within a venue — as the venue lists it, and as a game names it.\nexport const gameLocationSubLocationSchema = textFieldSchema(\n GAME_LOCATION_SUB_LOCATION_INPUT_FORMAT,\n);\nexport const gameLocationSubLocationsSchema = z\n .array(gameLocationSubLocationSchema)\n .max(MAX_GAME_LOCATION_SUB_LOCATIONS)\n .refine((subLocations) => new Set(subLocations).size === subLocations.length, {\n message: 'Each sub-location may appear only once.',\n });\n// An empty memo means the venue has none.\nexport const gameLocationMemoSchema = textFieldSchema(GAME_LOCATION_MEMO_INPUT_FORMAT);\n\n// The venue's own fields. A create sends all of them; an edit sends only the ones the admin\n// changed, so saving one never rewrites another with what this editor last read.\nconst gameLocationFieldsShape = {\n name: gameLocationNameSchema,\n streetAddress: gameLocationStreetAddressSchema,\n subLocations: gameLocationSubLocationsSchema,\n memo: gameLocationMemoSchema,\n};\n\nexport const AdminCreateGameLocationInputSchema = z.object(gameLocationFieldsShape).strict();\nexport type AdminCreateGameLocationInput = z.infer<typeof AdminCreateGameLocationInputSchema>;\nexport const AdminCreateGameLocationResultSchema = z\n .object({ gameLocationId: gameLocationIdSchema })\n .strict();\nexport type AdminCreateGameLocationResult = z.infer<typeof AdminCreateGameLocationResultSchema>;\n\nexport const AdminUpdateGameLocationInputSchema = z\n .object({\n gameLocationId: gameLocationIdSchema,\n name: gameLocationNameSchema.optional(),\n streetAddress: gameLocationStreetAddressSchema.optional(),\n subLocations: gameLocationSubLocationsSchema.optional(),\n memo: gameLocationMemoSchema.optional(),\n })\n .strict()\n .refine(\n ({ gameLocationId: _gameLocationId, ...fields }) =>\n Object.values(fields).some((value) => value !== undefined),\n { message: 'Change at least one field.' },\n );\nexport type AdminUpdateGameLocationInput = z.infer<typeof AdminUpdateGameLocationInputSchema>;\nexport const AdminUpdateGameLocationResultSchema = z\n .object({ gameLocationId: gameLocationIdSchema })\n .strict();\nexport type AdminUpdateGameLocationResult = z.infer<typeof AdminUpdateGameLocationResultSchema>;\n\nexport const AdminDeleteGameLocationInputSchema = z\n .object({ gameLocationId: gameLocationIdSchema })\n .strict();\nexport type AdminDeleteGameLocationInput = z.infer<typeof AdminDeleteGameLocationInputSchema>;\nexport const AdminDeleteGameLocationResultSchema = z\n .object({ gameLocationId: gameLocationIdSchema })\n .strict();\nexport type AdminDeleteGameLocationResult = z.infer<typeof AdminDeleteGameLocationResultSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"hardware-loan-contracts.d.ts","sourceRoot":"","sources":["../../src/schemas/hardware-loan-contracts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,2BAA2B;;;EAAoC,CAAC;AAG7E,eAAO,MAAM,0CAA0C;;;;;;kBASnD,CAAC;AACL,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0CAA0C,CAAC,CAAC;AAE9G,eAAO,MAAM,2CAA2C;;kBAE7C,CAAC;AACZ,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2CAA2C,CAAC,CAAC;AAIhH,eAAO,MAAM,8CAA8C;;;kBAEhD,CAAC;AACZ,MAAM,MAAM,wCAAwC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8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AO,MAAM,8CAA8C;;;kBAEhD,CAAC;AACZ,MAAM,MAAM,wCAAwC,GAAG,CAAC,CAAC,KAAK,CAC5D,OAAO,8CAA8C,CACtD,CAAC;AAGF,eAAO,MAAM,+CAA+C;;;;kBAMjD,CAAC;AACZ,MAAM,MAAM,yCAAyC,GAAG,CAAC,CAAC,KAAK,CAC7D,OAAO,+CAA+C,CACvD,CAAC;AAGF,eAAO,MAAM,0CAA0C;;kBAE5C,CAAC;AACZ,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,0CAA0C,CAClD,CAAC;AAGF,eAAO,MAAM,2CAA2C;;;;kBAM7C,CAAC;AACZ,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,2CAA2C,CACnD,CAAC;AAIF,eAAO,MAAM,0CAA0C;;kBAE5C,CAAC;AACZ,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,0CAA0C,CAClD,CAAC;AAEF,eAAO,MAAM,2CAA2C;;;kBAE7C,CAAC;AACZ,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,2CAA2C,CACnD,CAAC;AAIF,eAAO,MAAM,+CAA+C;;kBAEjD,CAAC;AACZ,MAAM,MAAM,yCAAyC,GAAG,CAAC,CAAC,KAAK,CAC7D,OAAO,+CAA+C,CACvD,CAAC"}
@@ -3,8 +3,7 @@
3
3
  // and the signature is read back through a callable — never by URL.
4
4
  import { z } from 'zod';
5
5
  import { HARDWARE_CATALOG, HARDWARE_CATALOG_ITEM_IDS } from '../constants/business.js';
6
- import { epochMsSchema, hardwareLoanContractIdSchema } from '../doc-schemas/atoms.js';
7
- import { userIdSchema } from './atoms.js';
6
+ import { epochMsSchema, hardwareLoanContractIdSchema, userIdSchema } from '../doc-schemas/atoms.js';
8
7
  import { stagingUploadPathSchema } from './uploads.js';
9
8
  export const hardwareCatalogItemIdSchema = z.enum(HARDWARE_CATALOG_ITEM_IDS);
10
9
  // The referee must be on the referee roster; each item is a catalog item, named once.
@@ -28,7 +27,11 @@ export const SubmitHardwareLoanContractSignatureInputSchema = z
28
27
  .strict();
29
28
  // `alreadySigned` when this very signing was recorded before: a retry, answered without copying again.
30
29
  export const SubmitHardwareLoanContractSignatureResultSchema = z
31
- .object({ contractId: hardwareLoanContractIdSchema, loanedAt: epochMsSchema, alreadySigned: z.boolean() })
30
+ .object({
31
+ contractId: hardwareLoanContractIdSchema,
32
+ loanedAt: epochMsSchema,
33
+ alreadySigned: z.boolean(),
34
+ })
32
35
  .strict();
33
36
  // An admin records a loaned contract's equipment back. The signature is kept.
34
37
  export const AdminReturnHardwareLoanContractInputSchema = z
@@ -36,7 +39,11 @@ export const AdminReturnHardwareLoanContractInputSchema = z
36
39
  .strict();
37
40
  // `changed` is false when the contract was already returned: nothing was written.
38
41
  export const AdminReturnHardwareLoanContractResultSchema = z
39
- .object({ contractId: hardwareLoanContractIdSchema, returnedAt: epochMsSchema, changed: z.boolean() })
42
+ .object({
43
+ contractId: hardwareLoanContractIdSchema,
44
+ returnedAt: epochMsSchema,
45
+ changed: z.boolean(),
46
+ })
40
47
  .strict();
41
48
  // An admin deletes a contract the referee has not signed. A signed contract is a legal record and is
42
49
  // never deleted.
@@ -1 +1 @@
1
- {"version":3,"file":"hardware-loan-contracts.js","sourceRoot":"","sources":["../../src/schemas/hardware-loan-contracts.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,mGAAmG;AACnG,oEAAoE;AAEpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM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kFAAkF;AAClF,MAAM,CAAC,MAAM,2CAA2C,GAAG,CAAC;KACzD,MAAM,CAAC,EAAE,UAAU,EAAE,4BAA4B,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;KACrG,MAAM,EAAE,CAAC;AAGZ,qGAAqG;AACrG,iBAAiB;AACjB,MAAM,CAAC,MAAM,0CAA0C,GAAG,CAAC;KACxD,MAAM,CAAC,EAAE,UAAU,EAAE,4BAA4B,EAAE,CAAC;KACpD,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,2CAA2C,GAAG,CAAC;KACzD,MAAM,CAAC,EAAE,UAAU,EAAE,4BAA4B,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;KAC1E,MAAM,EAAE,CAAC;AAGZ,oGAAoG;AACpG,2DAA2D;AAC3D,MAAM,CAAC,MAAM,+CAA+C,GAAG,CAAC;KAC7D,MAAM,CAAC,EAAE,UAAU,EAAE,4BAA4B,EAAE,CAAC;KACpD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for hardware loan contracts: an admin creates a loan for a referee, the referee\n// signs the agreement, an admin records the equipment returned or deletes a contract never signed,\n// and the signature is read back through a callable — never by URL.\n\nimport { z } from 'zod';\nimport { HARDWARE_CATALOG, HARDWARE_CATALOG_ITEM_IDS } from '../constants/business.js';\nimport { epochMsSchema, hardwareLoanContractIdSchema } from '../doc-schemas/atoms.js';\nimport { userIdSchema } from './atoms.js';\nimport { stagingUploadPathSchema } from './uploads.js';\n\nexport const hardwareCatalogItemIdSchema = z.enum(HARDWARE_CATALOG_ITEM_IDS);\n\n// The referee must be on the referee roster; each item is a catalog item, named once.\nexport const AdminCreateHardwareLoanContractInputSchema = z\n .object({\n refereeUserId: userIdSchema,\n hardwareItemIds: z.array(hardwareCatalogItemIdSchema).min(1).max(HARDWARE_CATALOG.length),\n })\n .strict()\n .refine((input) => new Set(input.hardwareItemIds).size === input.hardwareItemIds.length, {\n message: 'Name each item once.',\n path: ['hardwareItemIds'],\n });\nexport type AdminCreateHardwareLoanContractInput = z.infer<typeof AdminCreateHardwareLoanContractInputSchema>;\n\nexport const AdminCreateHardwareLoanContractResultSchema = z\n .object({ contractId: hardwareLoanContractIdSchema })\n .strict();\nexport type AdminCreateHardwareLoanContractResult = z.infer<typeof AdminCreateHardwareLoanContractResultSchema>;\n\n// The contract's referee signs it: the drawn PNG staged at their own staging path. The signer is the\n// caller — never named in the payload.\nexport const SubmitHardwareLoanContractSignatureInputSchema = z\n .object({ contractId: hardwareLoanContractIdSchema, storagePath: stagingUploadPathSchema })\n .strict();\nexport type SubmitHardwareLoanContractSignatureInput = z.infer<typeof SubmitHardwareLoanContractSignatureInputSchema>;\n\n// `alreadySigned` when this very signing was recorded before: a retry, answered without copying again.\nexport const SubmitHardwareLoanContractSignatureResultSchema = z\n .object({ contractId: hardwareLoanContractIdSchema, loanedAt: epochMsSchema, alreadySigned: z.boolean() })\n .strict();\nexport type SubmitHardwareLoanContractSignatureResult = z.infer<typeof SubmitHardwareLoanContractSignatureResultSchema>;\n\n// An admin records a loaned contract's equipment back. The signature is kept.\nexport const AdminReturnHardwareLoanContractInputSchema = z\n .object({ contractId: hardwareLoanContractIdSchema })\n .strict();\nexport type AdminReturnHardwareLoanContractInput = z.infer<typeof AdminReturnHardwareLoanContractInputSchema>;\n\n// `changed` is false when the contract was already returned: nothing was written.\nexport const AdminReturnHardwareLoanContractResultSchema = z\n .object({ contractId: hardwareLoanContractIdSchema, returnedAt: epochMsSchema, changed: z.boolean() })\n .strict();\nexport type AdminReturnHardwareLoanContractResult = z.infer<typeof AdminReturnHardwareLoanContractResultSchema>;\n\n// An admin deletes a contract the referee has not signed. A signed contract is a legal record and is\n// never deleted.\nexport const AdminDeleteHardwareLoanContractInputSchema = z\n .object({ contractId: hardwareLoanContractIdSchema })\n .strict();\nexport type AdminDeleteHardwareLoanContractInput = z.infer<typeof AdminDeleteHardwareLoanContractInputSchema>;\n\nexport const AdminDeleteHardwareLoanContractResultSchema = z\n .object({ contractId: hardwareLoanContractIdSchema, deleted: z.boolean() })\n .strict();\nexport type AdminDeleteHardwareLoanContractResult = z.infer<typeof AdminDeleteHardwareLoanContractResultSchema>;\n\n// A contract's signature, read by its referee (the member entry) or an admin (the admin entry). The\n// answer is `SignatureFileResultSchema`, as a waiver's is.\nexport const GetHardwareLoanContractSignatureFileInputSchema = z\n .object({ contractId: hardwareLoanContractIdSchema })\n .strict();\nexport type GetHardwareLoanContractSignatureFileInput = z.infer<typeof GetHardwareLoanContractSignatureFileInputSchema>;\n"]}
1
+ {"version":3,"file":"hardware-loan-contracts.js","sourceRoot":"","sources":["../../src/schemas/hardware-loan-contracts.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,mGAAmG;AACnG,oEAAoE;AAEpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACpG,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;AAE7E,sFAAsF;AACtF,MAAM,CAAC,MAAM,0CAA0C,GAAG,CAAC;KACxD,MAAM,CAAC;IACN,aAAa,EAAE,YAAY;IAC3B,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,MAAM,CAAC;CAC1F,CAAC;KACD,MAAM,EAAE;KACR,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,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AAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;KAC1E,MAAM,EAAE,CAAC;AAKZ,oGAAoG;AACpG,2DAA2D;AAC3D,MAAM,CAAC,MAAM,+CAA+C,GAAG,CAAC;KAC7D,MAAM,CAAC,EAAE,UAAU,EAAE,4BAA4B,EAAE,CAAC;KACpD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for hardware loan contracts: an admin creates a loan for a referee, the referee\n// signs the agreement, an admin records the equipment returned or deletes a contract never signed,\n// and the signature is read back through a callable — never by URL.\n\nimport { z } from 'zod';\nimport { HARDWARE_CATALOG, HARDWARE_CATALOG_ITEM_IDS } from '../constants/business.js';\nimport { epochMsSchema, hardwareLoanContractIdSchema, userIdSchema } from '../doc-schemas/atoms.js';\nimport { stagingUploadPathSchema } from './uploads.js';\n\nexport const hardwareCatalogItemIdSchema = z.enum(HARDWARE_CATALOG_ITEM_IDS);\n\n// The referee must be on the referee roster; each item is a catalog item, named once.\nexport const AdminCreateHardwareLoanContractInputSchema = z\n .object({\n refereeUserId: userIdSchema,\n hardwareItemIds: z.array(hardwareCatalogItemIdSchema).min(1).max(HARDWARE_CATALOG.length),\n })\n .strict()\n .refine((input) => new Set(input.hardwareItemIds).size === input.hardwareItemIds.length, {\n message: 'Name each item once.',\n path: ['hardwareItemIds'],\n });\nexport type AdminCreateHardwareLoanContractInput = z.infer<\n typeof AdminCreateHardwareLoanContractInputSchema\n>;\n\nexport const AdminCreateHardwareLoanContractResultSchema = z\n .object({ contractId: hardwareLoanContractIdSchema })\n .strict();\nexport type AdminCreateHardwareLoanContractResult = z.infer<\n typeof AdminCreateHardwareLoanContractResultSchema\n>;\n\n// The contract's referee signs it: the drawn PNG staged at their own staging path. The signer is the\n// caller — never named in the payload.\nexport const SubmitHardwareLoanContractSignatureInputSchema = z\n .object({ contractId: hardwareLoanContractIdSchema, storagePath: stagingUploadPathSchema })\n .strict();\nexport type SubmitHardwareLoanContractSignatureInput = z.infer<\n typeof SubmitHardwareLoanContractSignatureInputSchema\n>;\n\n// `alreadySigned` when this very signing was recorded before: a retry, answered without copying again.\nexport const SubmitHardwareLoanContractSignatureResultSchema = z\n .object({\n contractId: hardwareLoanContractIdSchema,\n loanedAt: epochMsSchema,\n alreadySigned: z.boolean(),\n })\n .strict();\nexport type SubmitHardwareLoanContractSignatureResult = z.infer<\n typeof SubmitHardwareLoanContractSignatureResultSchema\n>;\n\n// An admin records a loaned contract's equipment back. The signature is kept.\nexport const AdminReturnHardwareLoanContractInputSchema = z\n .object({ contractId: hardwareLoanContractIdSchema })\n .strict();\nexport type AdminReturnHardwareLoanContractInput = z.infer<\n typeof AdminReturnHardwareLoanContractInputSchema\n>;\n\n// `changed` is false when the contract was already returned: nothing was written.\nexport const AdminReturnHardwareLoanContractResultSchema = z\n .object({\n contractId: hardwareLoanContractIdSchema,\n returnedAt: epochMsSchema,\n changed: z.boolean(),\n })\n .strict();\nexport type AdminReturnHardwareLoanContractResult = z.infer<\n typeof AdminReturnHardwareLoanContractResultSchema\n>;\n\n// An admin deletes a contract the referee has not signed. A signed contract is a legal record and is\n// never deleted.\nexport const AdminDeleteHardwareLoanContractInputSchema = z\n .object({ contractId: hardwareLoanContractIdSchema })\n .strict();\nexport type AdminDeleteHardwareLoanContractInput = z.infer<\n typeof AdminDeleteHardwareLoanContractInputSchema\n>;\n\nexport const AdminDeleteHardwareLoanContractResultSchema = z\n .object({ contractId: hardwareLoanContractIdSchema, deleted: z.boolean() })\n .strict();\nexport type AdminDeleteHardwareLoanContractResult = z.infer<\n typeof AdminDeleteHardwareLoanContractResultSchema\n>;\n\n// A contract's signature, read by its referee (the member entry) or an admin (the admin entry). The\n// answer is `SignatureFileResultSchema`, as a waiver's is.\nexport const GetHardwareLoanContractSignatureFileInputSchema = z\n .object({ contractId: hardwareLoanContractIdSchema })\n .strict();\nexport type GetHardwareLoanContractSignatureFileInput = z.infer<\n typeof GetHardwareLoanContractSignatureFileInputSchema\n>;\n"]}
@@ -7,8 +7,8 @@ export type LeagueSettingsField = (typeof LEAGUE_SETTINGS_FIELD_KEYS)[number];
7
7
  export declare const leagueSettingsFieldSchema: z.ZodEnum<{
8
8
  playoffCutoff: "playoffCutoff";
9
9
  description: "description";
10
- leagueEndDate: "leagueEndDate";
11
10
  waiverTemplateId: "waiverTemplateId";
11
+ leagueEndDate: "leagueEndDate";
12
12
  leagueStartDate: "leagueStartDate";
13
13
  playoffCutoffComp: "playoffCutoffComp";
14
14
  playoffCutoffRec: "playoffCutoffRec";
@@ -61,8 +61,8 @@ export declare const AdminUpdateSportLeagueResultSchema: z.ZodObject<{
61
61
  changedFields: z.ZodArray<z.ZodEnum<{
62
62
  playoffCutoff: "playoffCutoff";
63
63
  description: "description";
64
- leagueEndDate: "leagueEndDate";
65
64
  waiverTemplateId: "waiverTemplateId";
65
+ leagueEndDate: "leagueEndDate";
66
66
  leagueStartDate: "leagueStartDate";
67
67
  playoffCutoffComp: "playoffCutoffComp";
68
68
  playoffCutoffRec: "playoffCutoffRec";
@@ -1 +1 @@
1
- {"version":3,"file":"leagues.d.ts","sourceRoot":"","sources":["../../src/schemas/leagues.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,eAAO,MAAM,iBAAiB,wDAA6C,CAAC;AAC5E,eAAO,MAAM,uBAAuB,wDAAmD,CAAC;AACxF,eAAO,MAAM,mBAAmB,aAAmD,CAAC;AAKpF,eAAO,MAAM,0BAA0B,6KAU7B,CAAC;AACX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9E,eAAO,MAAM,yBAAyB;;;;;;;;;;EAAqC,CAAC;AAI5E,eAAO,MAAM,yBAAyB,qEAIa,CAAC;AACpD,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAgB5E,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;kBAG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,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,4BAA4B;;;;;;;;;kBAO9B,CAAC;AACZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
@@ -3,7 +3,7 @@
3
3
  // field (ARCH-106).
4
4
  import { z } from 'zod';
5
5
  import { MAX_PLAYOFF_CUTOFF } from '../constants/business.js';
6
- import { LEAGUE_DESCRIPTION_INPUT_FORMAT, LEAGUE_TITLE_INPUT_FORMAT } from '../input-formats/index.js';
6
+ import { LEAGUE_DESCRIPTION_INPUT_FORMAT, LEAGUE_TITLE_INPUT_FORMAT, } from '../input-formats/input-formats.js';
7
7
  import { calendarDateSchema, textFieldSchema, countSchema, epochMsSchema, leagueIdSchema, leagueModeSchema, leagueStatusSchema, leagueTypeSchema, } from '../doc-schemas/atoms.js';
8
8
  import { playoffCutoffCountSchema, refineLeagueSettings } from '../doc-schemas/sport-league.js';
9
9
  import { waiverTemplateIdSchema } from '../doc-schemas/waiver-template.js';
@@ -65,7 +65,11 @@ export const AdminUpdateSportLeagueInputSchema = z
65
65
  // changed — and the league it names holds exactly the settings sent, so it is the form's next
66
66
  // `expectedUpdatedAt` and a second save from the same form is not refused as stale.
67
67
  export const AdminUpdateSportLeagueResultSchema = z
68
- .object({ leagueId: leagueIdSchema, changedFields: z.array(leagueSettingsFieldSchema), updatedAt: epochMsSchema })
68
+ .object({
69
+ leagueId: leagueIdSchema,
70
+ changedFields: z.array(leagueSettingsFieldSchema),
71
+ updatedAt: epochMsSchema,
72
+ })
69
73
  .strict();
70
74
  export const AdminUpdateSportLeagueStatusInputSchema = z
71
75
  .object({ leagueId: leagueIdSchema, status: leagueStatusSchema })
@@ -84,6 +88,11 @@ export const SwitchLeagueModeInputSchema = z
84
88
  .strict();
85
89
  // `teamsUpdated` is 0 when the league was already in `newMode`: nothing is rewritten.
86
90
  export const SwitchLeagueModeResultSchema = z
87
- .object({ leagueId: leagueIdSchema, leagueMode: leagueModeSchema, teamsUpdated: countSchema, ...leagueUpdatedAtMoveShape })
91
+ .object({
92
+ leagueId: leagueIdSchema,
93
+ leagueMode: leagueModeSchema,
94
+ teamsUpdated: countSchema,
95
+ ...leagueUpdatedAtMoveShape,
96
+ })
88
97
  .strict();
89
98
  //# sourceMappingURL=leagues.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"leagues.js","sourceRoot":"","sources":["../../src/schemas/leagues.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,oGAAoG;AACpG,oBAAoB;AAEpB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,+BAA+B,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACvG,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAChG,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,mGAAmG;AACnG,sBAAsB;AACtB,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,yBAAyB,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC,+BAA+B,CAAC,CAAC;AACxF,MAAM,CAAC,MAAM,mBAAmB,GAAG,wBAAwB,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;AAEpF,oGAAoG;AACpG,gFAAgF;AAChF,iGAAiG;AACjG,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,aAAa;IACb,aAAa;IACb,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,mBAAmB;IACnB,k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G,8FAA8F;AAC9F,oFAAoF;AACpF,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC;KAChD,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;KACjH,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC;KACrD,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;KAChE,MAAM,EAAE,CAAC;AAGZ,sGAAsG;AACtG,yFAAyF;AACzF,mGAAmG;AACnG,gGAAgG;AAChG,2BAA2B;AAC3B,MAAM,wBAAwB,GAAG,EAAE,iBAAiB,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;AAEhG,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC;KACtD,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,wBAAwB,EAAE,CAAC;KAC7F,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC;KACzC,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;KAC/D,MAAM,EAAE,CAAC;AAEZ,sFAAsF;AACtF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC;KAC1C,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,wBAAwB,EAAE,CAAC;KAC1H,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the league: creation, the settings edit, the status move, and the mode\n// switch. Every one is admin authority, and the acting admin is `request.auth.uid` — never an input\n// field (ARCH-106).\n\nimport { z } from 'zod';\nimport { MAX_PLAYOFF_CUTOFF } from '../constants/business.js';\nimport { LEAGUE_DESCRIPTION_INPUT_FORMAT, LEAGUE_TITLE_INPUT_FORMAT } from '../input-formats/index.js';\nimport {\n calendarDateSchema,\n textFieldSchema,\n countSchema,\n epochMsSchema,\n leagueIdSchema,\n leagueModeSchema,\n leagueStatusSchema,\n leagueTypeSchema,\n} from '../doc-schemas/atoms.js';\nimport { playoffCutoffCountSchema, refineLeagueSettings } from '../doc-schemas/sport-league.js';\nimport { waiverTemplateIdSchema } from '../doc-schemas/waiver-template.js';\n\n// The title and description, each built from its field's one declaration, so the form and the wire\n// run the same check.\nexport const leagueTitleSchema = textFieldSchema(LEAGUE_TITLE_INPUT_FORMAT);\nexport const leagueDescriptionSchema = textFieldSchema(LEAGUE_DESCRIPTION_INPUT_FORMAT);\nexport const playoffCutoffSchema = playoffCutoffCountSchema.max(MAX_PLAYOFF_CUTOFF);\n\n// The settings an admin sets at creation and edits afterwards, in the order the update's result and\n// audit event list them. Sport and mode are not settings: the sport is fixed at\n// creation, and the mode changes only through the mode switch, which retypes the league's teams.\nexport const LEAGUE_SETTINGS_FIELD_KEYS = [\n 'leagueTitle',\n 'description',\n 'leagueStartDate',\n 'leagueEndDate',\n 'playoffCutoff',\n 'playoffCutoffComp',\n 'playoffCutoffRec',\n 'requiresWaiver',\n 'waiverTemplateId',\n] as const;\nexport type LeagueSettingsField = (typeof LEAGUE_SETTINGS_FIELD_KEYS)[number];\nexport const leagueSettingsFieldSchema = z.enum(LEAGUE_SETTINGS_FIELD_KEYS);\n\n// The playoff cutoffs among the settings: a league whose mode sorts its teams by type shows the\n// competitive and recreational pair, any other league the single cutoff.\nexport const PLAYOFF_CUTOFF_FIELD_KEYS = [\n 'playoffCutoff',\n 'playoffCutoffComp',\n 'playoffCutoffRec',\n] as const satisfies readonly LeagueSettingsField[];\nexport type PlayoffCutoffField = (typeof PLAYOFF_CUTOFF_FIELD_KEYS)[number];\n\n// Every cutoff is sent whether or not the league's mode shows it, so a later mode switch finds the\n// other mode's cutoffs already set.\nconst leagueSettingsShape = {\n leagueTitle: leagueTitleSchema,\n description: leagueDescriptionSchema,\n leagueStartDate: calendarDateSchema,\n leagueEndDate: calendarDateSchema,\n playoffCutoff: playoffCutoffSchema,\n playoffCutoffComp: playoffCutoffSchema,\n playoffCutoffRec: playoffCutoffSchema,\n requiresWaiver: z.boolean(),\n waiverTemplateId: waiverTemplateIdSchema.optional(),\n} satisfies Record<LeagueSettingsField, z.ZodType>;\n\nexport const AdminCreateSportLeagueInputSchema = z\n .object({ ...leagueSettingsShape, leagueType: leagueTypeSchema, leagueMode: leagueModeSchema })\n .strict()\n .superRefine(refineLeagueSettings);\nexport type AdminCreateSportLeagueInput = z.infer<typeof AdminCreateSportLeagueInputSchema>;\nexport const AdminCreateSportLeagueResultSchema = z.object({ leagueId: leagueIdSchema }).strict();\nexport type AdminCreateSportLeagueResult = z.infer<typeof AdminCreateSportLeagueResultSchema>;\n\n// The whole settings set, every time: the callable writes exactly these fields, and a waiver\n// requirement turned off drops the template reference with it. `expectedUpdatedAt` is the league's\n// `updatedAt` as the admin loaded it: a save that would change a league written since is refused,\n// so a stale form never writes its old values over another admin's edit.\nexport const AdminUpdateSportLeagueInputSchema = z\n .object({ leagueId: leagueIdSchema, expectedUpdatedAt: epochMsSchema, ...leagueSettingsShape })\n .strict()\n .superRefine(refineLeagueSettings);\nexport type AdminUpdateSportLeagueInput = z.infer<typeof AdminUpdateSportLeagueInputSchema>;\n// `changedFields` is empty when the settings already held every value sent. `updatedAt` is the\n// league's `updatedAt` once the save is done — the value written, or the stored one when nothing\n// changed — and the league it names holds exactly the settings sent, so it is the form's next\n// `expectedUpdatedAt` and a second save from the same form is not refused as stale.\nexport const AdminUpdateSportLeagueResultSchema = z\n .object({ leagueId: leagueIdSchema, changedFields: z.array(leagueSettingsFieldSchema), updatedAt: epochMsSchema })\n .strict();\nexport type AdminUpdateSportLeagueResult = z.infer<typeof AdminUpdateSportLeagueResultSchema>;\n\nexport const AdminUpdateSportLeagueStatusInputSchema = z\n .object({ leagueId: leagueIdSchema, status: leagueStatusSchema })\n .strict();\nexport type AdminUpdateSportLeagueStatusInput = z.infer<typeof AdminUpdateSportLeagueStatusInputSchema>;\n\n// The league's `updatedAt` before and after a status move or a mode switch, equal when nothing moved.\n// Neither changes a setting and neither checks the settings form, so a form advances its\n// `expectedUpdatedAt` to `updatedAt` only when it was loaded at `previousUpdatedAt`. A form loaded\n// at any other value was already stale, and advancing it would let its old values overwrite the\n// edit that made it stale.\nconst leagueUpdatedAtMoveShape = { previousUpdatedAt: epochMsSchema, updatedAt: epochMsSchema };\n\nexport const AdminUpdateSportLeagueStatusResultSchema = z\n .object({ leagueId: leagueIdSchema, status: leagueStatusSchema, ...leagueUpdatedAtMoveShape })\n .strict();\nexport type AdminUpdateSportLeagueStatusResult = z.infer<typeof AdminUpdateSportLeagueStatusResultSchema>;\n\nexport const SwitchLeagueModeInputSchema = z\n .object({ leagueId: leagueIdSchema, newMode: leagueModeSchema })\n .strict();\nexport type SwitchLeagueModeInput = z.infer<typeof SwitchLeagueModeInputSchema>;\n// `teamsUpdated` is 0 when the league was already in `newMode`: nothing is rewritten.\nexport const SwitchLeagueModeResultSchema = z\n .object({ leagueId: leagueIdSchema, leagueMode: leagueModeSchema, teamsUpdated: countSchema, ...leagueUpdatedAtMoveShape })\n .strict();\nexport type SwitchLeagueModeResult = z.infer<typeof SwitchLeagueModeResultSchema>;\n"]}
1
+ {"version":3,"file":"leagues.js","sourceRoot":"","sources":["../../src/schemas/leagues.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,oGAAoG;AACpG,oBAAoB;AAEpB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,GAC1B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,aAAa,EACb,cA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,EAAE,cAAc,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,wBAAwB,EAAE,CAAC;KAC7F,MAAM,EAAE,CAAC;AAKZ,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC;KACzC,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;KAC/D,MAAM,EAAE,CAAC;AAEZ,sFAAsF;AACtF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC;KAC1C,MAAM,CAAC;IACN,QAAQ,EAAE,cAAc;IACxB,UAAU,EAAE,gBAAgB;IAC5B,YAAY,EAAE,WAAW;IACzB,GAAG,wBAAwB;CAC5B,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the league: creation, the settings edit, the status move, and the mode\n// switch. Every one is admin authority, and the acting admin is `request.auth.uid` — never an input\n// field (ARCH-106).\n\nimport { z } from 'zod';\nimport { MAX_PLAYOFF_CUTOFF } from '../constants/business.js';\nimport {\n LEAGUE_DESCRIPTION_INPUT_FORMAT,\n LEAGUE_TITLE_INPUT_FORMAT,\n} from '../input-formats/input-formats.js';\nimport {\n calendarDateSchema,\n textFieldSchema,\n countSchema,\n epochMsSchema,\n leagueIdSchema,\n leagueModeSchema,\n leagueStatusSchema,\n leagueTypeSchema,\n} from '../doc-schemas/atoms.js';\nimport { playoffCutoffCountSchema, refineLeagueSettings } from '../doc-schemas/sport-league.js';\nimport { waiverTemplateIdSchema } from '../doc-schemas/waiver-template.js';\n\n// The title and description, each built from its field's one declaration, so the form and the wire\n// run the same check.\nexport const leagueTitleSchema = textFieldSchema(LEAGUE_TITLE_INPUT_FORMAT);\nexport const leagueDescriptionSchema = textFieldSchema(LEAGUE_DESCRIPTION_INPUT_FORMAT);\nexport const playoffCutoffSchema = playoffCutoffCountSchema.max(MAX_PLAYOFF_CUTOFF);\n\n// The settings an admin sets at creation and edits afterwards, in the order the update's result and\n// audit event list them. Sport and mode are not settings: the sport is fixed at\n// creation, and the mode changes only through the mode switch, which retypes the league's teams.\nexport const LEAGUE_SETTINGS_FIELD_KEYS = [\n 'leagueTitle',\n 'description',\n 'leagueStartDate',\n 'leagueEndDate',\n 'playoffCutoff',\n 'playoffCutoffComp',\n 'playoffCutoffRec',\n 'requiresWaiver',\n 'waiverTemplateId',\n] as const;\nexport type LeagueSettingsField = (typeof LEAGUE_SETTINGS_FIELD_KEYS)[number];\nexport const leagueSettingsFieldSchema = z.enum(LEAGUE_SETTINGS_FIELD_KEYS);\n\n// The playoff cutoffs among the settings: a league whose mode sorts its teams by type shows the\n// competitive and recreational pair, any other league the single cutoff.\nexport const PLAYOFF_CUTOFF_FIELD_KEYS = [\n 'playoffCutoff',\n 'playoffCutoffComp',\n 'playoffCutoffRec',\n] as const satisfies readonly LeagueSettingsField[];\nexport type PlayoffCutoffField = (typeof PLAYOFF_CUTOFF_FIELD_KEYS)[number];\n\n// Every cutoff is sent whether or not the league's mode shows it, so a later mode switch finds the\n// other mode's cutoffs already set.\nconst leagueSettingsShape = {\n leagueTitle: leagueTitleSchema,\n description: leagueDescriptionSchema,\n leagueStartDate: calendarDateSchema,\n leagueEndDate: calendarDateSchema,\n playoffCutoff: playoffCutoffSchema,\n playoffCutoffComp: playoffCutoffSchema,\n playoffCutoffRec: playoffCutoffSchema,\n requiresWaiver: z.boolean(),\n waiverTemplateId: waiverTemplateIdSchema.optional(),\n} satisfies Record<LeagueSettingsField, z.ZodType>;\n\nexport const AdminCreateSportLeagueInputSchema = z\n .object({ ...leagueSettingsShape, leagueType: leagueTypeSchema, leagueMode: leagueModeSchema })\n .strict()\n .superRefine(refineLeagueSettings);\nexport type AdminCreateSportLeagueInput = z.infer<typeof AdminCreateSportLeagueInputSchema>;\nexport const AdminCreateSportLeagueResultSchema = z.object({ leagueId: leagueIdSchema }).strict();\nexport type AdminCreateSportLeagueResult = z.infer<typeof AdminCreateSportLeagueResultSchema>;\n\n// The whole settings set, every time: the callable writes exactly these fields, and a waiver\n// requirement turned off drops the template reference with it. `expectedUpdatedAt` is the league's\n// `updatedAt` as the admin loaded it: a save that would change a league written since is refused,\n// so a stale form never writes its old values over another admin's edit.\nexport const AdminUpdateSportLeagueInputSchema = z\n .object({ leagueId: leagueIdSchema, expectedUpdatedAt: epochMsSchema, ...leagueSettingsShape })\n .strict()\n .superRefine(refineLeagueSettings);\nexport type AdminUpdateSportLeagueInput = z.infer<typeof AdminUpdateSportLeagueInputSchema>;\n// `changedFields` is empty when the settings already held every value sent. `updatedAt` is the\n// league's `updatedAt` once the save is done — the value written, or the stored one when nothing\n// changed — and the league it names holds exactly the settings sent, so it is the form's next\n// `expectedUpdatedAt` and a second save from the same form is not refused as stale.\nexport const AdminUpdateSportLeagueResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n changedFields: z.array(leagueSettingsFieldSchema),\n updatedAt: epochMsSchema,\n })\n .strict();\nexport type AdminUpdateSportLeagueResult = z.infer<typeof AdminUpdateSportLeagueResultSchema>;\n\nexport const AdminUpdateSportLeagueStatusInputSchema = z\n .object({ leagueId: leagueIdSchema, status: leagueStatusSchema })\n .strict();\nexport type AdminUpdateSportLeagueStatusInput = z.infer<\n typeof AdminUpdateSportLeagueStatusInputSchema\n>;\n\n// The league's `updatedAt` before and after a status move or a mode switch, equal when nothing moved.\n// Neither changes a setting and neither checks the settings form, so a form advances its\n// `expectedUpdatedAt` to `updatedAt` only when it was loaded at `previousUpdatedAt`. A form loaded\n// at any other value was already stale, and advancing it would let its old values overwrite the\n// edit that made it stale.\nconst leagueUpdatedAtMoveShape = { previousUpdatedAt: epochMsSchema, updatedAt: epochMsSchema };\n\nexport const AdminUpdateSportLeagueStatusResultSchema = z\n .object({ leagueId: leagueIdSchema, status: leagueStatusSchema, ...leagueUpdatedAtMoveShape })\n .strict();\nexport type AdminUpdateSportLeagueStatusResult = z.infer<\n typeof AdminUpdateSportLeagueStatusResultSchema\n>;\n\nexport const SwitchLeagueModeInputSchema = z\n .object({ leagueId: leagueIdSchema, newMode: leagueModeSchema })\n .strict();\nexport type SwitchLeagueModeInput = z.infer<typeof SwitchLeagueModeInputSchema>;\n// `teamsUpdated` is 0 when the league was already in `newMode`: nothing is rewritten.\nexport const SwitchLeagueModeResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n leagueMode: leagueModeSchema,\n teamsUpdated: countSchema,\n ...leagueUpdatedAtMoveShape,\n })\n .strict();\nexport type SwitchLeagueModeResult = z.infer<typeof SwitchLeagueModeResultSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"migration-console.d.ts","sourceRoot":"","sources":["../../src/schemas/migration-console.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,wCAAwC;AACxC,eAAO,MAAM,6BAA6B;;;;;;;kBAiB/B,CAAC;AACZ,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,yEAAyE;AACzE,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAqBjC,CAAC;AACZ,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,uFAAuF;AACvF,eAAO,MAAM,8BAA8B,iCAAwB,CAAC;AACpE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;kBAMjC,CAAC;AACZ,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
@@ -7,9 +7,8 @@
7
7
  // The line resolution is the one action with its own input (`AdminResolveUnrosteredStatLineInputSchema`).
8
8
  import { z } from 'zod';
9
9
  import { MigrationActionRunSchema, MigrationConsoleSchema, MigrationFindingSchema, MigrationRunRecordSchema, migrationActionIdSchema, migrationEvidenceSchema, migrationOperationIdSchema, } from '../doc-schemas/migration-console.js';
10
- import { MAX_MIGRATION_PAGE_SIZE, MIGRATION_RECORD_OUTCOME_KEYS } from '../migration-console/run-state.js';
11
- import { countSchema, epochMsSchema, repairReasonSchema } from './atoms.js';
12
- import { statsOperationIdSchema } from '../doc-schemas/atoms.js';
10
+ import { MAX_MIGRATION_PAGE_SIZE, MIGRATION_RECORD_OUTCOME_KEYS, } from '../migration-console/run-state.js';
11
+ import { countSchema, epochMsSchema, repairReasonSchema, statsOperationIdSchema, } from '../doc-schemas/atoms.js';
13
12
  // The operation ids a product control's record names: one per sport for the hall of fame, one
14
13
  // otherwise, none for a control that writes no operation.
15
14
  const MAX_RECORDED_OPERATION_IDS = 10;
@@ -96,9 +95,7 @@ export const RecordMigrationCheckpointInputSchema = z
96
95
  })
97
96
  .strict();
98
97
  /** The cutover: from here on the product owns every destination. */
99
- export const RecordMigrationCutoverInputSchema = z
100
- .object({ reason: repairReasonSchema })
101
- .strict();
98
+ export const RecordMigrationCutoverInputSchema = z.object({ reason: repairReasonSchema }).strict();
102
99
  /** What a record call answers: the step as now recorded. A second identical record changes nothing. */
103
100
  export const RecordMigrationStepResultSchema = z
104
101
  .object({
@@ -1 +1 @@
1
- {"version":3,"file":"migration-console.js","sourceRoot":"","sources":["../../src/schemas/migration-console.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,EAAE;AACF,mGAAmG;AACnG,sGAAsG;AACtG,qGAAqG;AACrG,oGAAoG;AACpG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K,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;IACxC,MAAM,EAAE,aAAa;CACtB,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,mFAAmF;AACnF,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC;IACN,QAAQ,EAAE,uBAAuB;IACjC,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,GAAG,CAAC,0BAA0B,CAAC;IAC7E,MAAM,EAAE,kBAAkB;CAC3B,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,qEAAqE;AACrE,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC;IACN,QAAQ,EAAE,uBAAuB;IACjC,QAAQ,EAAE,uBAAuB;CAClC,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,oEAAoE;AACpE,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;KACtC,MAAM,EAAE,CAAC;AAGZ,uGAAuG;AACvG,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC;KAC7C,MAAM,CAAC;IACN,QAAQ,EAAE,uBAAuB;IACjC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC;IAC9C,MAAM,EAAE,wBAAwB;CACjC,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// The migration console's callables. Every one is admin-only, asking its auth gate for admin.\n//\n// Each executable cutover action has its own callable (`MigrationStep.callable`), and every one of\n// them takes `RunMigrationActionInputSchema` and answers `MigrationActionPageResultSchema` — one page\n// per call. The console holds each run's resume key itself, so a browser that lost its place resumes\n// the same logical run by sending the same operation id; a new operation id starts the action over.\n// The line resolution is the one action with its own input (`AdminResolveUnrosteredStatLineInputSchema`).\n\nimport { z } from 'zod';\nimport {\n MigrationActionRunSchema,\n MigrationConsoleSchema,\n MigrationFindingSchema,\n MigrationRunRecordSchema,\n migrationActionIdSchema,\n migrationEvidenceSchema,\n migrationOperationIdSchema,\n} from '../doc-schemas/migration-console.js';\nimport { MAX_MIGRATION_PAGE_SIZE, MIGRATION_RECORD_OUTCOME_KEYS } from '../migration-console/run-state.js';\nimport { countSchema, epochMsSchema, repairReasonSchema } from './atoms.js';\nimport { statsOperationIdSchema } from '../doc-schemas/atoms.js';\n\n// The operation ids a product control's record names: one per sport for the hall of fame, one\n// otherwise, none for a control that writes no operation.\nconst MAX_RECORDED_OPERATION_IDS = 10;\n\n/** One page of an executable action. */\nexport const RunMigrationActionInputSchema = z\n .object({\n operationId: migrationOperationIdSchema,\n // Required on every page (BACKEND-212); the run keeps the one its first page gave.\n reason: repairReasonSchema,\n // A preview: read, transform, and report, writing nothing. A verification only reads either way.\n dryRun: z.boolean(),\n pageSize: z.number().int().min(1).max(MAX_MIGRATION_PAGE_SIZE),\n // A verification's declaration, read at the run's first page, that its source really is empty —\n // without it a sweep that checked nothing does not pass.\n expectEmptySource: z.boolean().optional(),\n // `verify.v1Pictures` only, read at the run's first page: the operator, having reviewed them,\n // acknowledges the picture sources the verification cannot examine — in another bucket (every\n // source, in a rehearsal, which copies Firestore only), or every one on a page unavailable or\n // refused — so they are reported instead of failing the run. Any other action refuses it.\n acknowledgeUnexaminedSources: z.boolean().optional(),\n })\n .strict();\nexport type RunMigrationActionInput = z.infer<typeof RunMigrationActionInputSchema>;\n\n/** What one page did, and the run it belongs to as recorded after it. */\nexport const MigrationActionPageResultSchema = z\n .object({\n actionId: migrationActionIdSchema,\n operationId: migrationOperationIdSchema,\n dryRun: z.boolean(),\n // The page's own counts; a write action fills read, written, and skipped, a verification checked,\n // missing, and mismatched.\n read: countSchema,\n written: countSchema,\n skipped: countSchema,\n checked: countSchema,\n missing: countSchema,\n mismatched: countSchema,\n details: z.record(z.string().min(1), countSchema),\n // Every document the page reported, in full.\n findings: z.array(MigrationFindingSchema),\n nextResumeAfter: z.string().min(1).nullable(),\n // The run reached its end with this page.\n complete: z.boolean(),\n run: MigrationRunRecordSchema,\n })\n .strict();\nexport type MigrationActionPageResult = z.infer<typeof MigrationActionPageResultSchema>;\n\n/** The console as it stands: the marker, the lock, and every step's recorded state. */\nexport const GetMigrationConsoleInputSchema = z.object({}).strict();\nexport type GetMigrationConsoleInput = z.infer<typeof GetMigrationConsoleInputSchema>;\n\nexport const MigrationStepStateSchema = z\n .object({\n actionId: migrationActionIdSchema,\n // Every dependency satisfied: the step may run.\n unlocked: z.boolean(),\n // The step itself is satisfied for its dependents.\n satisfied: z.boolean(),\n // A dependency not yet satisfied, each named.\n waitingOn: z.array(migrationActionIdSchema),\n // Its latest preview reached its end since its dependencies were last done: a step that removes\n // data starts a new run only then.\n previewCurrent: z.boolean(),\n record: MigrationActionRunSchema.nullable(),\n })\n .strict();\nexport type MigrationStepState = z.infer<typeof MigrationStepStateSchema>;\n\nexport const GetMigrationConsoleResultSchema = z\n .object({\n console: MigrationConsoleSchema,\n // In cutover order, one per manifest step.\n steps: z.array(MigrationStepStateSchema),\n readAt: epochMsSchema,\n })\n .strict();\nexport type GetMigrationConsoleResult = z.infer<typeof GetMigrationConsoleResultSchema>;\n\n/** A product control's run, recorded once the console has checked its evidence. */\nexport const RecordMigrationControlRunInputSchema = z\n .object({\n actionId: migrationActionIdSchema,\n operationIds: z.array(statsOperationIdSchema).max(MAX_RECORDED_OPERATION_IDS),\n reason: repairReasonSchema,\n })\n .strict();\nexport type RecordMigrationControlRunInput = z.infer<typeof RecordMigrationControlRunInputSchema>;\n\n/** An operator checkpoint, recorded with the operator's evidence. */\nexport const RecordMigrationCheckpointInputSchema = z\n .object({\n actionId: migrationActionIdSchema,\n evidence: migrationEvidenceSchema,\n })\n .strict();\nexport type RecordMigrationCheckpointInput = z.infer<typeof RecordMigrationCheckpointInputSchema>;\n\n/** The cutover: from here on the product owns every destination. */\nexport const RecordMigrationCutoverInputSchema = z\n .object({ reason: repairReasonSchema })\n .strict();\nexport type RecordMigrationCutoverInput = z.infer<typeof RecordMigrationCutoverInputSchema>;\n\n/** What a record call answers: the step as now recorded. A second identical record changes nothing. */\nexport const RecordMigrationStepResultSchema = z\n .object({\n actionId: migrationActionIdSchema,\n outcome: z.enum(MIGRATION_RECORD_OUTCOME_KEYS),\n record: MigrationActionRunSchema,\n })\n .strict();\nexport type RecordMigrationStepResult = z.infer<typeof RecordMigrationStepResultSchema>;\n"]}
1
+ {"version":3,"file":"migration-console.js","sourceRoot":"","sources":["../../src/schemas/migration-console.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,EAAE;AACF,mGAAmG;AACnG,sGAAsG;AACtG,qGAAqG;AACrG,oGAAoG;AACpG,0GAA0G;AAE1G,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAEjC,8FAA8F;AAC9F,0DAA0D;AAC1D,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAEtC,wCAAwC;AACxC,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC;KAC3C,MAAM,CAAC;IACN,WAAW,EAAE,0BAA0B;IACvC,mFAAmF;IACnF,MAAM,EAAE,kBAAkB;IAC1B,iGAAiG;IACjG,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,uBAAuB,CAAC;IAC9D,gGAAgG;IAChG,yDAAyD;IACzD,iBAAiB,EAAE,CAAC,CAAC,O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B;CACjC,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// The migration console's callables. Every one is admin-only, asking its auth gate for admin.\n//\n// Each executable cutover action has its own callable (`MigrationStep.callable`), and every one of\n// them takes `RunMigrationActionInputSchema` and answers `MigrationActionPageResultSchema` — one page\n// per call. The console holds each run's resume key itself, so a browser that lost its place resumes\n// the same logical run by sending the same operation id; a new operation id starts the action over.\n// The line resolution is the one action with its own input (`AdminResolveUnrosteredStatLineInputSchema`).\n\nimport { z } from 'zod';\nimport {\n MigrationActionRunSchema,\n MigrationConsoleSchema,\n MigrationFindingSchema,\n MigrationRunRecordSchema,\n migrationActionIdSchema,\n migrationEvidenceSchema,\n migrationOperationIdSchema,\n} from '../doc-schemas/migration-console.js';\nimport {\n MAX_MIGRATION_PAGE_SIZE,\n MIGRATION_RECORD_OUTCOME_KEYS,\n} from '../migration-console/run-state.js';\nimport {\n countSchema,\n epochMsSchema,\n repairReasonSchema,\n statsOperationIdSchema,\n} from '../doc-schemas/atoms.js';\n\n// The operation ids a product control's record names: one per sport for the hall of fame, one\n// otherwise, none for a control that writes no operation.\nconst MAX_RECORDED_OPERATION_IDS = 10;\n\n/** One page of an executable action. */\nexport const RunMigrationActionInputSchema = z\n .object({\n operationId: migrationOperationIdSchema,\n // Required on every page (BACKEND-212); the run keeps the one its first page gave.\n reason: repairReasonSchema,\n // A preview: read, transform, and report, writing nothing. A verification only reads either way.\n dryRun: z.boolean(),\n pageSize: z.number().int().min(1).max(MAX_MIGRATION_PAGE_SIZE),\n // A verification's declaration, read at the run's first page, that its source really is empty —\n // without it a sweep that checked nothing does not pass.\n expectEmptySource: z.boolean().optional(),\n // `verify.v1Pictures` only, read at the run's first page: the operator, having reviewed them,\n // acknowledges the picture sources the verification cannot examine — in another bucket (every\n // source, in a rehearsal, which copies Firestore only), or every one on a page unavailable or\n // refused — so they are reported instead of failing the run. Any other action refuses it.\n acknowledgeUnexaminedSources: z.boolean().optional(),\n })\n .strict();\nexport type RunMigrationActionInput = z.infer<typeof RunMigrationActionInputSchema>;\n\n/** What one page did, and the run it belongs to as recorded after it. */\nexport const MigrationActionPageResultSchema = z\n .object({\n actionId: migrationActionIdSchema,\n operationId: migrationOperationIdSchema,\n dryRun: z.boolean(),\n // The page's own counts; a write action fills read, written, and skipped, a verification checked,\n // missing, and mismatched.\n read: countSchema,\n written: countSchema,\n skipped: countSchema,\n checked: countSchema,\n missing: countSchema,\n mismatched: countSchema,\n details: z.record(z.string().min(1), countSchema),\n // Every document the page reported, in full.\n findings: z.array(MigrationFindingSchema),\n nextResumeAfter: z.string().min(1).nullable(),\n // The run reached its end with this page.\n complete: z.boolean(),\n run: MigrationRunRecordSchema,\n })\n .strict();\nexport type MigrationActionPageResult = z.infer<typeof MigrationActionPageResultSchema>;\n\n/** The console as it stands: the marker, the lock, and every step's recorded state. */\nexport const GetMigrationConsoleInputSchema = z.object({}).strict();\nexport type GetMigrationConsoleInput = z.infer<typeof GetMigrationConsoleInputSchema>;\n\nexport const MigrationStepStateSchema = z\n .object({\n actionId: migrationActionIdSchema,\n // Every dependency satisfied: the step may run.\n unlocked: z.boolean(),\n // The step itself is satisfied for its dependents.\n satisfied: z.boolean(),\n // A dependency not yet satisfied, each named.\n waitingOn: z.array(migrationActionIdSchema),\n // Its latest preview reached its end since its dependencies were last done: a step that removes\n // data starts a new run only then.\n previewCurrent: z.boolean(),\n record: MigrationActionRunSchema.nullable(),\n })\n .strict();\nexport type MigrationStepState = z.infer<typeof MigrationStepStateSchema>;\n\nexport const GetMigrationConsoleResultSchema = z\n .object({\n console: MigrationConsoleSchema,\n // In cutover order, one per manifest step.\n steps: z.array(MigrationStepStateSchema),\n readAt: epochMsSchema,\n })\n .strict();\nexport type GetMigrationConsoleResult = z.infer<typeof GetMigrationConsoleResultSchema>;\n\n/** A product control's run, recorded once the console has checked its evidence. */\nexport const RecordMigrationControlRunInputSchema = z\n .object({\n actionId: migrationActionIdSchema,\n operationIds: z.array(statsOperationIdSchema).max(MAX_RECORDED_OPERATION_IDS),\n reason: repairReasonSchema,\n })\n .strict();\nexport type RecordMigrationControlRunInput = z.infer<typeof RecordMigrationControlRunInputSchema>;\n\n/** An operator checkpoint, recorded with the operator's evidence. */\nexport const RecordMigrationCheckpointInputSchema = z\n .object({\n actionId: migrationActionIdSchema,\n evidence: migrationEvidenceSchema,\n })\n .strict();\nexport type RecordMigrationCheckpointInput = z.infer<typeof RecordMigrationCheckpointInputSchema>;\n\n/** The cutover: from here on the product owns every destination. */\nexport const RecordMigrationCutoverInputSchema = z.object({ reason: repairReasonSchema }).strict();\nexport type RecordMigrationCutoverInput = z.infer<typeof RecordMigrationCutoverInputSchema>;\n\n/** What a record call answers: the step as now recorded. A second identical record changes nothing. */\nexport const RecordMigrationStepResultSchema = z\n .object({\n actionId: migrationActionIdSchema,\n outcome: z.enum(MIGRATION_RECORD_OUTCOME_KEYS),\n record: MigrationActionRunSchema,\n })\n .strict();\nexport type RecordMigrationStepResult = z.infer<typeof RecordMigrationStepResultSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"pictures.d.ts","sourceRoot":"","sources":["../../src/schemas/pictures.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,yBAAyB;;;;;;;;;;;kBAAgE,CAAC;AACvG,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,2BAA2B;;;kBAM7B,CAAC;AACZ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAEhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
@@ -9,7 +9,9 @@ import { GalleryPictureSchema, pictureIdSchema } from '../doc-schemas/gallery.js
9
9
  import { PictureOwnerRefSchema } from '../doc-schemas/pending-media.js';
10
10
  import { DomainEventSchema } from '../domain-events/domain-events.js';
11
11
  // A gallery picture as a client holds it in its cached pages: the document with its id.
12
- export const GalleryPictureEntrySchema = GalleryPictureSchema.extend({ id: pictureIdSchema }).strict();
12
+ export const GalleryPictureEntrySchema = GalleryPictureSchema.extend({
13
+ id: pictureIdSchema,
14
+ }).strict();
13
15
  export const AdminMovePictureInputSchema = z
14
16
  .object({
15
17
  pictureId: pictureIdSchema,
@@ -20,7 +22,9 @@ export const AdminMovePictureInputSchema = z
20
22
  export const AdminMovePictureResultSchema = z
21
23
  .object({ picture: GalleryPictureEntrySchema, event: DomainEventSchema })
22
24
  .strict();
23
- export const AdminUpdateFeaturedPictureInputSchema = z.object({ pictureId: pictureIdSchema }).strict();
25
+ export const AdminUpdateFeaturedPictureInputSchema = z
26
+ .object({ pictureId: pictureIdSchema })
27
+ .strict();
24
28
  export const AdminUpdateFeaturedPictureResultSchema = z
25
29
  .object({ picture: GalleryPictureEntrySchema, event: DomainEventSchema })
26
30
  .strict();
@@ -1 +1 @@
1
- {"version":3,"file":"pictures.js","sourceRoot":"","sources":["../../src/schemas/pictures.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,wFAAwF;AACxF,EAAE;AACF,gGAAgG;AAChG,oGAAoG;AACpG,mEAAmE;AAEnE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,wFAAwF;AACxF,MAAM,CAAC,MAAM,yBAAyB,GAAG,oBAAoB,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAGvG,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC;KACzC,MAAM,CAAC;IACN,SAAS,EAAE,eAAe;IAC1B,iFAAiF;IACjF,cAAc,EAAE,eAAe,CAAC,QAAQ,EAAE;CAC3C,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC;KAC1C,MAAM,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;KACxE,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAEvG,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC;KACpD,MAAM,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;KACxE,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC;KAC3C,MAAM,CAAC;IACN,iGAAiG;IACjG,iFAAiF;IACjF,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,eAAe;CAC3B,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC;KAC5C,MAAM,CAAC,EAAE,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;KAC9F,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for managing pictures already published: ordering a gallery, choosing its\n// featured picture, and removing a gallery picture or a location's picture. Admin only.\n//\n// Each result carries the one entry it changed, so a client patches that entry into the gallery\n// pages it holds instead of refetching them (FRONTEND-103), and the owner's own update event, which\n// refreshes the owner document that carries the gallery's summary.\n\nimport { z } from 'zod';\nimport { GalleryPictureSchema, pictureIdSchema } from '../doc-schemas/gallery.js';\nimport { PictureOwnerRefSchema } from '../doc-schemas/pending-media.js';\nimport { DomainEventSchema } from '../domain-events/domain-events.js';\n\n// A gallery picture as a client holds it in its cached pages: the document with its id.\nexport const GalleryPictureEntrySchema = GalleryPictureSchema.extend({ id: pictureIdSchema }).strict();\nexport type GalleryPictureEntry = z.infer<typeof GalleryPictureEntrySchema>;\n\nexport const AdminMovePictureInputSchema = z\n .object({\n pictureId: pictureIdSchema,\n // The picture it goes directly after, in the same gallery; `null` puts it first.\n afterPictureId: pictureIdSchema.nullable(),\n })\n .strict();\nexport type AdminMovePictureInput = z.infer<typeof AdminMovePictureInputSchema>;\nexport const AdminMovePictureResultSchema = z\n .object({ picture: GalleryPictureEntrySchema, event: DomainEventSchema })\n .strict();\nexport type AdminMovePictureResult = z.infer<typeof AdminMovePictureResultSchema>;\n\nexport const AdminUpdateFeaturedPictureInputSchema = z.object({ pictureId: pictureIdSchema }).strict();\nexport type AdminUpdateFeaturedPictureInput = z.infer<typeof AdminUpdateFeaturedPictureInputSchema>;\nexport const AdminUpdateFeaturedPictureResultSchema = z\n .object({ picture: GalleryPictureEntrySchema, event: DomainEventSchema })\n .strict();\nexport type AdminUpdateFeaturedPictureResult = z.infer<typeof AdminUpdateFeaturedPictureResultSchema>;\n\nexport const AdminDeletePictureInputSchema = z\n .object({\n // The owner the admin is removing it from. A gallery picture must belong to it, and a location's\n // must be its current picture; an award's badge is never removed, only replaced.\n owner: PictureOwnerRefSchema,\n pictureId: pictureIdSchema,\n })\n .strict();\nexport type AdminDeletePictureInput = z.infer<typeof AdminDeletePictureInputSchema>;\nexport const AdminDeletePictureResultSchema = z\n .object({ owner: PictureOwnerRefSchema, pictureId: pictureIdSchema, event: DomainEventSchema })\n .strict();\nexport type AdminDeletePictureResult = z.infer<typeof AdminDeletePictureResultSchema>;\n"]}
1
+ {"version":3,"file":"pictures.js","sourceRoot":"","sources":["../../src/schemas/pictures.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,wFAAwF;AACxF,EAAE;AACF,gGAAgG;AAChG,oGAAoG;AACpG,mEAAmE;AAEnE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,wFAAwF;AACxF,MAAM,CAAC,MAAM,yBAAyB,GAAG,oBAAoB,CAAC,MAAM,CAAC;IACnE,EAAE,EAAE,eAAe;CACpB,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC;KACzC,MAAM,CAAC;IACN,SAAS,EAAE,eAAe;IAC1B,iFAAiF;IACjF,cAAc,EAAE,eAAe,CAAC,QAAQ,EAAE;CAC3C,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC;KAC1C,MAAM,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;KACxE,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC;KACnD,MAAM,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;KACtC,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC;KACpD,MAAM,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;KACxE,MAAM,EAAE,CAAC;AAKZ,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC;KAC3C,MAAM,CAAC;IACN,iGAAiG;IACjG,iFAAiF;IACjF,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,eAAe;CAC3B,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC;KAC5C,MAAM,CAAC,EAAE,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;KAC9F,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for managing pictures already published: ordering a gallery, choosing its\n// featured picture, and removing a gallery picture or a location's picture. Admin only.\n//\n// Each result carries the one entry it changed, so a client patches that entry into the gallery\n// pages it holds instead of refetching them (FRONTEND-103), and the owner's own update event, which\n// refreshes the owner document that carries the gallery's summary.\n\nimport { z } from 'zod';\nimport { GalleryPictureSchema, pictureIdSchema } from '../doc-schemas/gallery.js';\nimport { PictureOwnerRefSchema } from '../doc-schemas/pending-media.js';\nimport { DomainEventSchema } from '../domain-events/domain-events.js';\n\n// A gallery picture as a client holds it in its cached pages: the document with its id.\nexport const GalleryPictureEntrySchema = GalleryPictureSchema.extend({\n id: pictureIdSchema,\n}).strict();\nexport type GalleryPictureEntry = z.infer<typeof GalleryPictureEntrySchema>;\n\nexport const AdminMovePictureInputSchema = z\n .object({\n pictureId: pictureIdSchema,\n // The picture it goes directly after, in the same gallery; `null` puts it first.\n afterPictureId: pictureIdSchema.nullable(),\n })\n .strict();\nexport type AdminMovePictureInput = z.infer<typeof AdminMovePictureInputSchema>;\nexport const AdminMovePictureResultSchema = z\n .object({ picture: GalleryPictureEntrySchema, event: DomainEventSchema })\n .strict();\nexport type AdminMovePictureResult = z.infer<typeof AdminMovePictureResultSchema>;\n\nexport const AdminUpdateFeaturedPictureInputSchema = z\n .object({ pictureId: pictureIdSchema })\n .strict();\nexport type AdminUpdateFeaturedPictureInput = z.infer<typeof AdminUpdateFeaturedPictureInputSchema>;\nexport const AdminUpdateFeaturedPictureResultSchema = z\n .object({ picture: GalleryPictureEntrySchema, event: DomainEventSchema })\n .strict();\nexport type AdminUpdateFeaturedPictureResult = z.infer<\n typeof AdminUpdateFeaturedPictureResultSchema\n>;\n\nexport const AdminDeletePictureInputSchema = z\n .object({\n // The owner the admin is removing it from. A gallery picture must belong to it, and a location's\n // must be its current picture; an award's badge is never removed, only replaced.\n owner: PictureOwnerRefSchema,\n pictureId: pictureIdSchema,\n })\n .strict();\nexport type AdminDeletePictureInput = z.infer<typeof AdminDeletePictureInputSchema>;\nexport const AdminDeletePictureResultSchema = z\n .object({ owner: PictureOwnerRefSchema, pictureId: pictureIdSchema, event: DomainEventSchema })\n .strict();\nexport type AdminDeletePictureResult = z.infer<typeof AdminDeletePictureResultSchema>;\n"]}
@@ -10,17 +10,17 @@ export declare const ScheduleGameInputSchema: z.ZodObject<{
10
10
  }, z.core.$strict>;
11
11
  export type ScheduleGameInput = z.infer<typeof ScheduleGameInputSchema>;
12
12
  export declare const sportGameScheduleFieldSchema: z.ZodEnum<{
13
- weekId: "weekId";
14
13
  teams: "teams";
15
- startTime: "startTime";
16
14
  gameLocationId: "gameLocationId";
17
- subLocation: "subLocation";
15
+ weekId: "weekId";
16
+ startTime: "startTime";
18
17
  locationLabel: "locationLabel";
18
+ subLocation: "subLocation";
19
19
  }>;
20
20
  export declare const scheduleWeekFieldSchema: z.ZodEnum<{
21
21
  weekTitle: "weekTitle";
22
- weekStartDate: "weekStartDate";
23
22
  weekLocation: "weekLocation";
23
+ weekStartDate: "weekStartDate";
24
24
  }>;
25
25
  export declare const AdminCreateScheduleWeekInputSchema: z.ZodObject<{
26
26
  leagueId: z.ZodString;
@@ -54,8 +54,8 @@ export declare const AdminUpdateScheduleWeekResultSchema: z.ZodObject<{
54
54
  weekId: z.ZodString;
55
55
  changedFields: z.ZodArray<z.ZodEnum<{
56
56
  weekTitle: "weekTitle";
57
- weekStartDate: "weekStartDate";
58
57
  weekLocation: "weekLocation";
58
+ weekStartDate: "weekStartDate";
59
59
  }>>;
60
60
  gamesUpdated: z.ZodNumber;
61
61
  }, z.core.$strict>;
@@ -101,12 +101,12 @@ export type AdminUpdateSportGameInput = z.infer<typeof AdminUpdateSportGameInput
101
101
  export declare const AdminUpdateSportGameResultSchema: z.ZodObject<{
102
102
  gameId: z.ZodString;
103
103
  changedFields: z.ZodArray<z.ZodEnum<{
104
- weekId: "weekId";
105
104
  teams: "teams";
106
- startTime: "startTime";
107
105
  gameLocationId: "gameLocationId";
108
- subLocation: "subLocation";
106
+ weekId: "weekId";
107
+ startTime: "startTime";
109
108
  locationLabel: "locationLabel";
109
+ subLocation: "subLocation";
110
110
  }>>;
111
111
  updatedAt: z.ZodNumber;
112
112
  }, z.core.$strict>;
@@ -1 +1 @@
1
- {"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../../src/schemas/schedules.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,eAAO,MAAM,uBAAuB,wDAAoD,CAAC;AAIzF,eAAO,MAAM,uBAAuB,8CAGiD,CAAC;AACtF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAWxE,eAAO,MAAM,uBAAuB;;;;;kBAAuC,CAAC;AAC5E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,4BAA4B;;;;;;;EAAyC,CAAC;AACnF,eAAO,MAAM,uBAAuB;;;;EAAmC,CAAC;AAKxE,eAAO,MAAM,kCAAkC;;;;;;;;;;;kBAQpC,CAAC;AACZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,eAAO,MAAM,mCAAmC;;;;kBAErC,CAAC;AACZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO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KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,eAAO,MAAM,mCAAmC;;;;;;kBAQrC,CAAC;AACZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAGhG,eAAO,MAAM,+BAA+B;;;;;;;kBAEjC,CAAC;AACZ,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AACxF,eAAO,MAAM,gCAAgC;;;;kBAElC,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAM1F,eAAO,MAAM,+BAA+B;;;;;;;;kBAcxC,CAAC;AACL,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AACxF,eAAO,MAAM,gCAAgC;;;;;;;;;;;kBAMlC,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAK1F,eAAO,MAAM,+BAA+B;;kBAA8C,CAAC;AAC3F,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AACxF,eAAO,MAAM,gCAAgC;;;;kBAElC,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
@@ -6,7 +6,7 @@
6
6
  import { z } from 'zod';
7
7
  import { MAX_SCHEDULE_WEEK_GAMES } from '../constants/business.js';
8
8
  import { textFieldSchema } from '../doc-schemas/atoms.js';
9
- import { SCHEDULE_WEEK_TITLE_INPUT_FORMAT } from '../input-formats/index.js';
9
+ import { SCHEDULE_WEEK_TITLE_INPUT_FORMAT } from '../input-formats/input-formats.js';
10
10
  import { countSchema, epochMsSchema, gameIdSchema, leagueIdSchema, scheduleWeekIdSchema, statsOperationIdSchema, teamIdSchema, } from '../doc-schemas/atoms.js';
11
11
  import { gameLocationIdSchema } from '../doc-schemas/game-location.js';
12
12
  import { isByeTeamId } from '../ids/minted-ids.js';
@@ -43,7 +43,11 @@ export const AdminCreateScheduleWeekInputSchema = z
43
43
  })
44
44
  .strict();
45
45
  export const AdminCreateScheduleWeekResultSchema = z
46
- .object({ leagueId: leagueIdSchema, weekId: scheduleWeekIdSchema, gameIds: z.array(gameIdSchema) })
46
+ .object({
47
+ leagueId: leagueIdSchema,
48
+ weekId: scheduleWeekIdSchema,
49
+ gameIds: z.array(gameIdSchema),
50
+ })
47
51
  .strict();
48
52
  // Only the week's shared fields the admin changed: a field left out keeps what each game holds, so
49
53
  // two admins editing different fields of one week never write each other's loaded values back
@@ -57,7 +61,9 @@ export const AdminUpdateScheduleWeekInputSchema = z
57
61
  weekGameLocationId: gameLocationIdSchema.optional(),
58
62
  })
59
63
  .strict()
60
- .refine((input) => input.weekTitle !== undefined || input.weekStartDate !== undefined || input.weekGameLocationId !== undefined, 'Name at least one field to change.');
64
+ .refine((input) => input.weekTitle !== undefined ||
65
+ input.weekStartDate !== undefined ||
66
+ input.weekGameLocationId !== undefined, 'Name at least one field to change.');
61
67
  export const AdminUpdateScheduleWeekResultSchema = z
62
68
  .object({
63
69
  leagueId: leagueIdSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"schedules.js","sourceRoot":"","sources":["../../src/schemas/schedules.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,mGAAmG;AACnG,yFAAyF;AACzF,mGAAmG;AACnG,0DAA0D;AAE1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EACL,WA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;IACxB,cAAc,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC/C,WAAW,EAAE,6BAA6B,CAAC,QAAQ,EAAE;CACtD,CAAC;KACD,MAAM,EAAE;KACR,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,KAAK,SAAS,IAAI,KAAK,CAAC,cAAc,KAAK,SAAS,EAAE;IACxF,OAAO,EAAE,mCAAmC;IAC5C,IAAI,EAAE,CAAC,aAAa,CAAC;CACtB,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,MAAM,EAAE,YAAY;IACpB,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,4BAA4B,CAAC;IACpD,SAAS,EAAE,aAAa;CACzB,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,gGAAgG;AAChG,qGAAqG;AACrG,sEAAsE;AACtE,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAE3F,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,sBAAsB,EAAE,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;KAC5F,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for a league's schedule: a week created with its games, a week's shared fields\n// edited, a week deleted with its games; one game added to a week, edited — moved, rescheduled, or\n// its teams replaced — or deleted. Every one is admin authority, and the acting admin is\n// `request.auth.uid`, never an input field (ARCH-106). Venue labels, calendar days, the sport, and\n// every stat field are derived by the server, never sent.\n\nimport { z } from 'zod';\nimport { MAX_SCHEDULE_WEEK_GAMES } from '../constants/business.js';\nimport { textFieldSchema } from '../doc-schemas/atoms.js';\nimport { SCHEDULE_WEEK_TITLE_INPUT_FORMAT } from '../input-formats/index.js';\nimport {\n countSchema,\n epochMsSchema,\n gameIdSchema,\n leagueIdSchema,\n scheduleWeekIdSchema,\n statsOperationIdSchema,\n teamIdSchema,\n} from '../doc-schemas/atoms.js';\nimport { gameLocationIdSchema } from '../doc-schemas/game-location.js';\nimport { isByeTeamId } from '../ids/minted-ids.js';\nimport { SCHEDULE_WEEK_FIELD_KEYS, SPORT_GAME_SCHEDULE_FIELD_KEYS } from '../types/schedules.js';\nimport { gameLocationSubLocationSchema } from './game-locations.js';\n\nexport const scheduleWeekTitleSchema = textFieldSchema(SCHEDULE_WEEK_TITLE_INPUT_FORMAT);\n\n// A game's two team slots, by position: team one, then team two. A slot names a team of the league\n// or BYE_TEAM_ID; a game has at least one real team, and never one team twice.\nexport const scheduleGameTeamsSchema = z\n .tuple([teamIdSchema, teamIdSchema])\n .refine(([first, second]) => !(isByeTeamId(first) && isByeTeamId(second)), 'A game needs at least one team.')\n .refine(([first, second]) => first !== second, 'A game needs two different teams.');\nexport type ScheduleGameTeams = z.infer<typeof scheduleGameTeamsSchema>;\n\n// Where and when one game is played. The venue is named by id, and the server writes the label the\n// schedule shows from the venue's own name and the chosen court.\nconst scheduleGameShape = {\n teams: scheduleGameTeamsSchema,\n startTime: epochMsSchema,\n gameLocationId: gameLocationIdSchema,\n subLocation: gameLocationSubLocationSchema.optional(),\n};\n\nexport const ScheduleGameInputSchema = z.object(scheduleGameShape).strict();\nexport type ScheduleGameInput = z.infer<typeof ScheduleGameInputSchema>;\n\nexport const sportGameScheduleFieldSchema = z.enum(SPORT_GAME_SCHEDULE_FIELD_KEYS);\nexport const scheduleWeekFieldSchema = z.enum(SCHEDULE_WEEK_FIELD_KEYS);\n\n// A new week and its games, saved together. `weekStartDate` is the week's first day as the admin's\n// form reads it; the week's venue is the default each game's form starts from, and its name is the\n// week's `weekLocation`.\nexport const AdminCreateScheduleWeekInputSchema = z\n .object({\n leagueId: leagueIdSchema,\n weekTitle: scheduleWeekTitleSchema,\n weekStartDate: epochMsSchema,\n weekGameLocationId: gameLocationIdSchema,\n games: z.array(ScheduleGameInputSchema).min(1).max(MAX_SCHEDULE_WEEK_GAMES),\n })\n .strict();\nexport type AdminCreateScheduleWeekInput = z.infer<typeof AdminCreateScheduleWeekInputSchema>;\nexport const AdminCreateScheduleWeekResultSchema = z\n .object({ leagueId: leagueIdSchema, weekId: scheduleWeekIdSchema, gameIds: z.array(gameIdSchema) })\n .strict();\nexport type AdminCreateScheduleWeekResult = z.infer<typeof AdminCreateScheduleWeekResultSchema>;\n\n// Only the week's shared fields the admin changed: a field left out keeps what each game holds, so\n// two admins editing different fields of one week never write each other's loaded values back\n// (BACKEND-116). The venue is named by id, and the week shows its name.\nexport const AdminUpdateScheduleWeekInputSchema = z\n .object({\n leagueId: leagueIdSchema,\n weekId: scheduleWeekIdSchema,\n weekTitle: scheduleWeekTitleSchema.optional(),\n weekStartDate: epochMsSchema.optional(),\n weekGameLocationId: gameLocationIdSchema.optional(),\n })\n .strict()\n .refine(\n (input) => input.weekTitle !== undefined || input.weekStartDate !== undefined || input.weekGameLocationId !== undefined,\n 'Name at least one field to change.',\n );\nexport type AdminUpdateScheduleWeekInput = z.infer<typeof AdminUpdateScheduleWeekInputSchema>;\nexport const AdminUpdateScheduleWeekResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n weekId: scheduleWeekIdSchema,\n changedFields: z.array(scheduleWeekFieldSchema),\n gamesUpdated: countSchema,\n })\n .strict();\nexport type AdminUpdateScheduleWeekResult = z.infer<typeof AdminUpdateScheduleWeekResultSchema>;\n\n// A whole week and every game in it. A game with events takes more than one step to delete, so a\n// call that runs out of time answers `complete: false` with the games still standing, and running\n// it again continues. A week with no game left answers complete.\nexport const AdminDeleteScheduleWeekInputSchema = z\n .object({ leagueId: leagueIdSchema, weekId: scheduleWeekIdSchema })\n .strict();\nexport type AdminDeleteScheduleWeekInput = z.infer<typeof AdminDeleteScheduleWeekInputSchema>;\nexport const AdminDeleteScheduleWeekResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n weekId: scheduleWeekIdSchema,\n deletedGameIds: z.array(gameIdSchema),\n remainingGameIds: z.array(gameIdSchema),\n complete: z.boolean(),\n })\n .strict();\nexport type AdminDeleteScheduleWeekResult = z.infer<typeof AdminDeleteScheduleWeekResultSchema>;\n\n// One game added to a saved week, which gives it the week's shared fields.\nexport const AdminCreateSportGameInputSchema = z\n .object({ leagueId: leagueIdSchema, weekId: scheduleWeekIdSchema, ...scheduleGameShape })\n .strict();\nexport type AdminCreateSportGameInput = z.infer<typeof AdminCreateSportGameInputSchema>;\nexport const AdminCreateSportGameResultSchema = z\n .object({ leagueId: leagueIdSchema, weekId: scheduleWeekIdSchema, gameId: gameIdSchema })\n .strict();\nexport type AdminCreateSportGameResult = z.infer<typeof AdminCreateSportGameResultSchema>;\n\n// One game's schedule, whole: its week (a reschedule into another saved week), its teams, its start\n// time, and its venue. `expectedUpdatedAt` is the game's `updatedAt` as the admin loaded it, so a\n// stale form never writes its old values over a newer change. A game that names no venue may keep\n// its stored label by naming none; a court is named only with its venue.\nexport const AdminUpdateSportGameInputSchema = z\n .object({\n gameId: gameIdSchema,\n expectedUpdatedAt: epochMsSchema,\n weekId: scheduleWeekIdSchema,\n teams: scheduleGameTeamsSchema,\n startTime: epochMsSchema,\n gameLocationId: gameLocationIdSchema.optional(),\n subLocation: gameLocationSubLocationSchema.optional(),\n })\n .strict()\n .refine((input) => input.subLocation === undefined || input.gameLocationId !== undefined, {\n message: 'A court is chosen within a venue.',\n path: ['subLocation'],\n });\nexport type AdminUpdateSportGameInput = z.infer<typeof AdminUpdateSportGameInputSchema>;\nexport const AdminUpdateSportGameResultSchema = z\n .object({\n gameId: gameIdSchema,\n changedFields: z.array(sportGameScheduleFieldSchema),\n updatedAt: epochMsSchema,\n })\n .strict();\nexport type AdminUpdateSportGameResult = z.infer<typeof AdminUpdateSportGameResultSchema>;\n\n// One game, with its events and roster. The server derives the deletion's operation id from the\n// game (`buildGameDeletionOperationId`), so a retry of a finished delete is acknowledged and a retry\n// of an interrupted one continues it; the caller names only the game.\nexport const AdminDeleteSportGameInputSchema = z.object({ gameId: gameIdSchema }).strict();\nexport type AdminDeleteSportGameInput = z.infer<typeof AdminDeleteSportGameInputSchema>;\nexport const AdminDeleteSportGameResultSchema = z\n .object({ gameId: gameIdSchema, operationId: statsOperationIdSchema, complete: z.boolean() })\n .strict();\nexport type AdminDeleteSportGameResult = z.infer<typeof AdminDeleteSportGameResultSchema>;\n"]}
1
+ {"version":3,"file":"schedules.js","sourceRoot":"","sources":["../../src/schemas/schedules.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,mGAAmG;AACnG,yFAAyF;AACzF,mGAAmG;AACnG,0DAA0D;AAE1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACjG,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAEpE,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC,gCAAgC,CAAC,CAAC;AAEzF,mGAAmG;AACnG,+EAA+E;AAC/E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,KAAK,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;KACnC,MAAM,CACL,CAAC,CAAC,KAAK,EAAE,MAAM,C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M,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAE3F,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,sBAAsB,EAAE,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;KAC5F,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for a league's schedule: a week created with its games, a week's shared fields\n// edited, a week deleted with its games; one game added to a week, edited — moved, rescheduled, or\n// its teams replaced — or deleted. Every one is admin authority, and the acting admin is\n// `request.auth.uid`, never an input field (ARCH-106). Venue labels, calendar days, the sport, and\n// every stat field are derived by the server, never sent.\n\nimport { z } from 'zod';\nimport { MAX_SCHEDULE_WEEK_GAMES } from '../constants/business.js';\nimport { textFieldSchema } from '../doc-schemas/atoms.js';\nimport { SCHEDULE_WEEK_TITLE_INPUT_FORMAT } from '../input-formats/input-formats.js';\nimport {\n countSchema,\n epochMsSchema,\n gameIdSchema,\n leagueIdSchema,\n scheduleWeekIdSchema,\n statsOperationIdSchema,\n teamIdSchema,\n} from '../doc-schemas/atoms.js';\nimport { gameLocationIdSchema } from '../doc-schemas/game-location.js';\nimport { isByeTeamId } from '../ids/minted-ids.js';\nimport { SCHEDULE_WEEK_FIELD_KEYS, SPORT_GAME_SCHEDULE_FIELD_KEYS } from '../types/schedules.js';\nimport { gameLocationSubLocationSchema } from './game-locations.js';\n\nexport const scheduleWeekTitleSchema = textFieldSchema(SCHEDULE_WEEK_TITLE_INPUT_FORMAT);\n\n// A game's two team slots, by position: team one, then team two. A slot names a team of the league\n// or BYE_TEAM_ID; a game has at least one real team, and never one team twice.\nexport const scheduleGameTeamsSchema = z\n .tuple([teamIdSchema, teamIdSchema])\n .refine(\n ([first, second]) => !(isByeTeamId(first) && isByeTeamId(second)),\n 'A game needs at least one team.',\n )\n .refine(([first, second]) => first !== second, 'A game needs two different teams.');\nexport type ScheduleGameTeams = z.infer<typeof scheduleGameTeamsSchema>;\n\n// Where and when one game is played. The venue is named by id, and the server writes the label the\n// schedule shows from the venue's own name and the chosen court.\nconst scheduleGameShape = {\n teams: scheduleGameTeamsSchema,\n startTime: epochMsSchema,\n gameLocationId: gameLocationIdSchema,\n subLocation: gameLocationSubLocationSchema.optional(),\n};\n\nexport const ScheduleGameInputSchema = z.object(scheduleGameShape).strict();\nexport type ScheduleGameInput = z.infer<typeof ScheduleGameInputSchema>;\n\nexport const sportGameScheduleFieldSchema = z.enum(SPORT_GAME_SCHEDULE_FIELD_KEYS);\nexport const scheduleWeekFieldSchema = z.enum(SCHEDULE_WEEK_FIELD_KEYS);\n\n// A new week and its games, saved together. `weekStartDate` is the week's first day as the admin's\n// form reads it; the week's venue is the default each game's form starts from, and its name is the\n// week's `weekLocation`.\nexport const AdminCreateScheduleWeekInputSchema = z\n .object({\n leagueId: leagueIdSchema,\n weekTitle: scheduleWeekTitleSchema,\n weekStartDate: epochMsSchema,\n weekGameLocationId: gameLocationIdSchema,\n games: z.array(ScheduleGameInputSchema).min(1).max(MAX_SCHEDULE_WEEK_GAMES),\n })\n .strict();\nexport type AdminCreateScheduleWeekInput = z.infer<typeof AdminCreateScheduleWeekInputSchema>;\nexport const AdminCreateScheduleWeekResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n weekId: scheduleWeekIdSchema,\n gameIds: z.array(gameIdSchema),\n })\n .strict();\nexport type AdminCreateScheduleWeekResult = z.infer<typeof AdminCreateScheduleWeekResultSchema>;\n\n// Only the week's shared fields the admin changed: a field left out keeps what each game holds, so\n// two admins editing different fields of one week never write each other's loaded values back\n// (BACKEND-116). The venue is named by id, and the week shows its name.\nexport const AdminUpdateScheduleWeekInputSchema = z\n .object({\n leagueId: leagueIdSchema,\n weekId: scheduleWeekIdSchema,\n weekTitle: scheduleWeekTitleSchema.optional(),\n weekStartDate: epochMsSchema.optional(),\n weekGameLocationId: gameLocationIdSchema.optional(),\n })\n .strict()\n .refine(\n (input) =>\n input.weekTitle !== undefined ||\n input.weekStartDate !== undefined ||\n input.weekGameLocationId !== undefined,\n 'Name at least one field to change.',\n );\nexport type AdminUpdateScheduleWeekInput = z.infer<typeof AdminUpdateScheduleWeekInputSchema>;\nexport const AdminUpdateScheduleWeekResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n weekId: scheduleWeekIdSchema,\n changedFields: z.array(scheduleWeekFieldSchema),\n gamesUpdated: countSchema,\n })\n .strict();\nexport type AdminUpdateScheduleWeekResult = z.infer<typeof AdminUpdateScheduleWeekResultSchema>;\n\n// A whole week and every game in it. A game with events takes more than one step to delete, so a\n// call that runs out of time answers `complete: false` with the games still standing, and running\n// it again continues. A week with no game left answers complete.\nexport const AdminDeleteScheduleWeekInputSchema = z\n .object({ leagueId: leagueIdSchema, weekId: scheduleWeekIdSchema })\n .strict();\nexport type AdminDeleteScheduleWeekInput = z.infer<typeof AdminDeleteScheduleWeekInputSchema>;\nexport const AdminDeleteScheduleWeekResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n weekId: scheduleWeekIdSchema,\n deletedGameIds: z.array(gameIdSchema),\n remainingGameIds: z.array(gameIdSchema),\n complete: z.boolean(),\n })\n .strict();\nexport type AdminDeleteScheduleWeekResult = z.infer<typeof AdminDeleteScheduleWeekResultSchema>;\n\n// One game added to a saved week, which gives it the week's shared fields.\nexport const AdminCreateSportGameInputSchema = z\n .object({ leagueId: leagueIdSchema, weekId: scheduleWeekIdSchema, ...scheduleGameShape })\n .strict();\nexport type AdminCreateSportGameInput = z.infer<typeof AdminCreateSportGameInputSchema>;\nexport const AdminCreateSportGameResultSchema = z\n .object({ leagueId: leagueIdSchema, weekId: scheduleWeekIdSchema, gameId: gameIdSchema })\n .strict();\nexport type AdminCreateSportGameResult = z.infer<typeof AdminCreateSportGameResultSchema>;\n\n// One game's schedule, whole: its week (a reschedule into another saved week), its teams, its start\n// time, and its venue. `expectedUpdatedAt` is the game's `updatedAt` as the admin loaded it, so a\n// stale form never writes its old values over a newer change. A game that names no venue may keep\n// its stored label by naming none; a court is named only with its venue.\nexport const AdminUpdateSportGameInputSchema = z\n .object({\n gameId: gameIdSchema,\n expectedUpdatedAt: epochMsSchema,\n weekId: scheduleWeekIdSchema,\n teams: scheduleGameTeamsSchema,\n startTime: epochMsSchema,\n gameLocationId: gameLocationIdSchema.optional(),\n subLocation: gameLocationSubLocationSchema.optional(),\n })\n .strict()\n .refine((input) => input.subLocation === undefined || input.gameLocationId !== undefined, {\n message: 'A court is chosen within a venue.',\n path: ['subLocation'],\n });\nexport type AdminUpdateSportGameInput = z.infer<typeof AdminUpdateSportGameInputSchema>;\nexport const AdminUpdateSportGameResultSchema = z\n .object({\n gameId: gameIdSchema,\n changedFields: z.array(sportGameScheduleFieldSchema),\n updatedAt: epochMsSchema,\n })\n .strict();\nexport type AdminUpdateSportGameResult = z.infer<typeof AdminUpdateSportGameResultSchema>;\n\n// One game, with its events and roster. The server derives the deletion's operation id from the\n// game (`buildGameDeletionOperationId`), so a retry of a finished delete is acknowledged and a retry\n// of an interrupted one continues it; the caller names only the game.\nexport const AdminDeleteSportGameInputSchema = z.object({ gameId: gameIdSchema }).strict();\nexport type AdminDeleteSportGameInput = z.infer<typeof AdminDeleteSportGameInputSchema>;\nexport const AdminDeleteSportGameResultSchema = z\n .object({ gameId: gameIdSchema, operationId: statsOperationIdSchema, complete: z.boolean() })\n .strict();\nexport type AdminDeleteSportGameResult = z.infer<typeof AdminDeleteSportGameResultSchema>;\n"]}