@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
@@ -31,8 +31,14 @@ export const PATH_BUILDERS = {
31
31
  USER_PROFILE_SUBCOLLECTIONS.HISTORICAL_STATS,
32
32
  ],
33
33
  publicUser: (userId) => [COLLECTIONS.PUBLIC_USERS, userId],
34
- statusReconcileQueueEntry: (userId) => [COLLECTIONS.STATUS_RECONCILE_QUEUE, userId],
35
- registrationStart: (userId) => [COLLECTIONS.REGISTRATION_STARTS, userId],
34
+ statusReconcileQueueEntry: (userId) => [
35
+ COLLECTIONS.STATUS_RECONCILE_QUEUE,
36
+ userId,
37
+ ],
38
+ registrationStart: (userId) => [
39
+ COLLECTIONS.REGISTRATION_STARTS,
40
+ userId,
41
+ ],
36
42
  sweepState: (name) => [COLLECTIONS.SWEEP_STATE, name],
37
43
  reservedDisplayName: (displayName) => [
38
44
  COLLECTIONS.RESERVED_DISPLAY_NAMES,
@@ -41,7 +47,10 @@ export const PATH_BUILDERS = {
41
47
  // Leagues, teams, membership
42
48
  sportLeague: (leagueId) => [COLLECTIONS.SPORT_LEAGUES, leagueId],
43
49
  leagueTeam: (teamId) => [COLLECTIONS.LEAGUE_TEAMS, teamId],
44
- leagueTeamContact: (teamId) => [COLLECTIONS.LEAGUE_TEAM_CONTACTS, teamId],
50
+ leagueTeamContact: (teamId) => [
51
+ COLLECTIONS.LEAGUE_TEAM_CONTACTS,
52
+ teamId,
53
+ ],
45
54
  teamMembership: (leagueId, teamId, userId) => [
46
55
  COLLECTIONS.TEAM_MEMBERSHIPS,
47
56
  buildTeamMembershipId(leagueId, teamId, userId),
@@ -51,7 +60,10 @@ export const PATH_BUILDERS = {
51
60
  buildTeamMembershipId(leagueId, teamId, userId),
52
61
  ],
53
62
  teamInvitation: (inviteId) => [COLLECTIONS.TEAM_INVITATIONS, inviteId],
54
- teamJoinRequest: (requestId) => [COLLECTIONS.TEAM_JOIN_REQUESTS, requestId],
63
+ teamJoinRequest: (requestId) => [
64
+ COLLECTIONS.TEAM_JOIN_REQUESTS,
65
+ requestId,
66
+ ],
55
67
  leagueFreeAgent: (leagueId, userId) => [
56
68
  COLLECTIONS.LEAGUE_FREE_AGENTS,
57
69
  buildLeagueFreeAgentId(leagueId, userId),
@@ -91,7 +103,10 @@ export const PATH_BUILDERS = {
91
103
  gameId,
92
104
  SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_HISTORY,
93
105
  ],
94
- gameLocation: (gameLocationId) => [COLLECTIONS.GAME_LOCATIONS, gameLocationId],
106
+ gameLocation: (gameLocationId) => [
107
+ COLLECTIONS.GAME_LOCATIONS,
108
+ gameLocationId,
109
+ ],
95
110
  // Waivers and hardware
96
111
  waiverTemplate: (waiverTemplateId) => [
97
112
  COLLECTIONS.WAIVER_TEMPLATES,
@@ -130,15 +145,30 @@ export const PATH_BUILDERS = {
130
145
  grantId,
131
146
  AWARD_GROUP_GRANT_SUBCOLLECTIONS.AWARD_GROUP_GRANT_PEOPLE,
132
147
  ],
133
- sportHallOfFame: (sportKey) => [COLLECTIONS.SPORT_HALL_OF_FAME, sportKey],
148
+ sportHallOfFame: (sportKey) => [
149
+ COLLECTIONS.SPORT_HALL_OF_FAME,
150
+ sportKey,
151
+ ],
134
152
  statsValidationReport: (reportId) => [
135
153
  COLLECTIONS.STATS_VALIDATION_REPORTS,
136
154
  reportId,
137
155
  ],
138
- statsOperation: (operationId) => [COLLECTIONS.STATS_OPERATIONS, operationId],
139
- migrationActionRun: (actionId) => [COLLECTIONS.MIGRATION_ACTION_RUNS, actionId],
140
- galleryPicture: (pictureId) => [COLLECTIONS.GALLERY_PICTURES, pictureId],
141
- pendingMedia: (pendingMediaId) => [COLLECTIONS.PENDING_MEDIA, pendingMediaId],
156
+ statsOperation: (operationId) => [
157
+ COLLECTIONS.STATS_OPERATIONS,
158
+ operationId,
159
+ ],
160
+ migrationActionRun: (actionId) => [
161
+ COLLECTIONS.MIGRATION_ACTION_RUNS,
162
+ actionId,
163
+ ],
164
+ galleryPicture: (pictureId) => [
165
+ COLLECTIONS.GALLERY_PICTURES,
166
+ pictureId,
167
+ ],
168
+ pendingMedia: (pendingMediaId) => [
169
+ COLLECTIONS.PENDING_MEDIA,
170
+ pendingMediaId,
171
+ ],
142
172
  // A picture's retirement is keyed by the picture id; a whole gallery's by `buildGalleryRetirementId`.
143
173
  pictureRetirement: (retirementId) => [
144
174
  COLLECTIONS.PICTURE_RETIREMENTS,
@@ -154,15 +184,30 @@ export const PATH_BUILDERS = {
154
184
  COLLECTIONS.ADMIN_NOTIFICATION_HISTORY,
155
185
  historyId,
156
186
  ],
157
- notificationDelivery: (deliveryId) => [COLLECTIONS.NOTIFICATION_DELIVERIES, deliveryId],
158
- notificationArchiveAllJob: (jobId) => [COLLECTIONS.NOTIFICATION_ARCHIVE_ALL_JOBS, jobId],
187
+ notificationDelivery: (deliveryId) => [
188
+ COLLECTIONS.NOTIFICATION_DELIVERIES,
189
+ deliveryId,
190
+ ],
191
+ notificationArchiveAllJob: (jobId) => [
192
+ COLLECTIONS.NOTIFICATION_ARCHIVE_ALL_JOBS,
193
+ jobId,
194
+ ],
159
195
  // Fixed-ID system documents
160
196
  landingPageConfig: () => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.LANDING_PAGE],
161
197
  appConfig: () => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.APP_CONFIG],
162
198
  statsBeacon: () => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.STATS_BEACON],
163
199
  adminList: () => [COLLECTIONS.SYSTEM_DATA, SPECIAL_DOCS.ADMIN_LIST],
164
- migrationConsole: () => [COLLECTIONS.SERVER_DATA, SPECIAL_DOCS.MIGRATION_CONSOLE],
165
- gameLocationRegistry: () => [COLLECTIONS.SERVER_DATA, SPECIAL_DOCS.GAME_LOCATION_REGISTRY],
166
- waiverTemplateRegistry: () => [COLLECTIONS.SERVER_DATA, SPECIAL_DOCS.WAIVER_TEMPLATE_REGISTRY],
200
+ migrationConsole: () => [
201
+ COLLECTIONS.SERVER_DATA,
202
+ SPECIAL_DOCS.MIGRATION_CONSOLE,
203
+ ],
204
+ gameLocationRegistry: () => [
205
+ COLLECTIONS.SERVER_DATA,
206
+ SPECIAL_DOCS.GAME_LOCATION_REGISTRY,
207
+ ],
208
+ waiverTemplateRegistry: () => [
209
+ COLLECTIONS.SERVER_DATA,
210
+ SPECIAL_DOCS.WAIVER_TEMPLATE_REGISTRY,
211
+ ],
167
212
  };
168
213
  //# sourceMappingURL=path-builders.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"path-builders.js","sourceRoot":"","sources":["../../src/paths/path-builders.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,0DAA0D;AAC1D,8DAA8D;AAC9D,EAAE;AACF,iGAAiG;AACjG,mGAAmG;AACnG,8EAA8E;AAE9E,OAAO,EACL,gCAAgC,EAChC,WAAW,EACX,yBAAyB,EACzB,YAAY,EACZ,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,SAAS;IACT,WAAW,EAAE,CAAC,MAAc,EAAoB,EAA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CAAC,0BAA0B;QACtC,cAAc;KACf;IACD,6BAA6B,EAAE,CAAC,SAAiB,EAAoB,EAAE,CAAC;QACtE,WAAW,CAAC,0BAA0B;QACtC,SAAS;KACV;IACD,oBAAoB,EAAE,CAAC,UAAkB,EAAoB,EAAE,CAAC,CAAC,WAAW,CAAC,uBAAuB,EAAE,UAAU,CAAC;IACjH,yBAAyB,EAAE,CAAC,KAAa,EAAoB,EAAE,CAAC,CAAC,WAAW,CAAC,6BAA6B,EAAE,KAAK,CAAC;IAElH,4BAA4B;IAC5B,iBAAiB,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC;IAC9F,SAAS,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,UAAU,CAAC;IACpF,WAAW,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC;IACxF,SAAS,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,YAAY,CAAC,UAAU,CAAC;IACrF,gBAAgB,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,YAAY,CAAC,iBAAiB,CAAC;IACnG,oBAAoB,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,YAAY,CAAC,sBAAsB,CAAC;IAC5G,sBAAsB,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,YAAY,CAAC,wBAAwB,CAAC;CACxG,CAAC","sourcesContent":["// Document path builders — segment tuples, the one path family.\n//\n// Frontend: doc(db, ...PATH_BUILDERS.userProfile(userId))\n// Backend: db.doc(toPath(PATH_BUILDERS.userProfile(userId)))\n//\n// A singular name builds a document path; its plural builds the parent collection path where the\n// parent is a subcollection (top-level collections are in COLLECTION_REFS). A compound document ID\n// is assembled here through its one builder in ../ids — never at a call site.\n\nimport {\n AWARD_GROUP_GRANT_SUBCOLLECTIONS,\n COLLECTIONS,\n SPORT_GAME_SUBCOLLECTIONS,\n SPECIAL_DOCS,\n USER_PROFILE_SUBCOLLECTIONS,\n WAIVER_TEMPLATE_SUBCOLLECTIONS,\n} from './collections.js';\nimport type { SweepStateName } from '../constants/scheduled-jobs.js';\nimport {\n buildGameRosterPlayerId,\n buildLeagueFreeAgentId,\n buildTeamMembershipId,\n buildSignedWaiverId,\n} from '../ids/compound-ids.js';\nimport { buildWaiverTemplateVersionId } from '../ids/waiver-template-ids.js';\nimport type { SportKey } from '../types/sports.js';\nimport { toReservedDisplayNameKey } from '../utils/display-name.js';\n\nexport const PATH_BUILDERS = {\n // People\n userProfile: (userId: string): [string, string] => [COLLECTIONS.USER_PROFILES, userId],\n userPrivateData: (userId: string): [string, string, string, string] => [\n COLLECTIONS.USER_PROFILES,\n userId,\n USER_PROFILE_SUBCOLLECTIONS.PRIVATE_DATA,\n userId,\n ],\n historicalStat: (userId: string, sportKey: SportKey): [string, string, string, string] => [\n COLLECTIONS.USER_PROFILES,\n userId,\n USER_PROFILE_SUBCOLLECTIONS.HISTORICAL_STATS,\n sportKey,\n ],\n historicalStats: (userId: string): [string, string, string] => [\n COLLECTIONS.USER_PROFILES,\n userId,\n USER_PROFILE_SUBCOLLECTIONS.HISTORICAL_STATS,\n ],\n publicUser: (userId: string): [string, string] => [COLLECTIONS.PUBLIC_USERS, userId],\n statusReconcileQueueEntry: (userId: string): [string, string] => [COLLECTIONS.STATUS_RECONCILE_QUEUE, userId],\n registrationStart: (userId: string): [string, string] => [COLLECTIONS.REGISTRATION_STARTS, userId],\n sweepState: (name: SweepStateName): [string, string] => [COLLECTIONS.SWEEP_STATE, name],\n reservedDisplayName: (displayName: string): [string, string] => [\n COLLECTIONS.RESERVED_DISPLAY_NAMES,\n toReservedDisplayNameKey(displayName),\n ],\n\n // Leagues, teams, membership\n sportLeague: (leagueId: string): [string, string] => [COLLECTIONS.SPORT_LEAGUES, leagueId],\n leagueTeam: (teamId: string): [string, string] => [COLLECTIONS.LEAGUE_TEAMS, teamId],\n leagueTeamContact: (teamId: string): [string, string] => [COLLECTIONS.LEAGUE_TEAM_CONTACTS, teamId],\n teamMembership: (leagueId: string, teamId: string, userId: string): [string, string] => [\n COLLECTIONS.TEAM_MEMBERSHIPS,\n buildTeamMembershipId(leagueId, teamId, userId),\n ],\n membershipRosterSync: (leagueId: string, teamId: string, userId: string): [string, string] => [\n COLLECTIONS.MEMBERSHIP_ROSTER_SYNCS,\n buildTeamMembershipId(leagueId, teamId, userId),\n ],\n teamInvitation: (inviteId: string): [string, string] => [COLLECTIONS.TEAM_INVITATIONS, inviteId],\n teamJoinRequest: (requestId: string): [string, string] => [COLLECTIONS.TEAM_JOIN_REQUESTS, requestId],\n leagueFreeAgent: (leagueId: string, userId: string): [string, string] => [\n COLLECTIONS.LEAGUE_FREE_AGENTS,\n buildLeagueFreeAgentId(leagueId, userId),\n ],\n\n // Games\n sportGame: (gameId: string): [string, string] => [COLLECTIONS.SPORT_GAMES, gameId],\n gameRosterPlayer: (gameId: string, teamId: string, userId: string): [string, string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_ROSTER_PLAYERS,\n buildGameRosterPlayerId(teamId, userId),\n ],\n gameRosterPlayers: (gameId: string): [string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_ROSTER_PLAYERS,\n ],\n gameStatEvent: (gameId: string, eventId: string): [string, string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_EVENTS,\n eventId,\n ],\n gameStatEvents: (gameId: string): [string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_EVENTS,\n ],\n gameStatHistoryPage: (gameId: string, pageId: string): [string, string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_HISTORY,\n pageId,\n ],\n gameStatHistory: (gameId: string): [string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_HISTORY,\n ],\n gameLocation: (gameLocationId: string): [string, string] => [COLLECTIONS.GAME_LOCATIONS, gameLocationId],\n\n // Waivers and hardware\n waiverTemplate: (waiverTemplateId: string): [string, string] => [\n COLLECTIONS.WAIVER_TEMPLATES,\n waiverTemplateId,\n ],\n waiverTemplateVersion: (waiverTemplateId: string, version: number): [string, string, string, string] => [\n COLLECTIONS.WAIVER_TEMPLATES,\n waiverTemplateId,\n WAIVER_TEMPLATE_SUBCOLLECTIONS.WAIVER_TEMPLATE_VERSIONS,\n buildWaiverTemplateVersionId(version),\n ],\n waiverTemplateVersions: (waiverTemplateId: string): [string, string, string] => [\n COLLECTIONS.WAIVER_TEMPLATES,\n waiverTemplateId,\n WAIVER_TEMPLATE_SUBCOLLECTIONS.WAIVER_TEMPLATE_VERSIONS,\n ],\n signedWaiver: (leagueId: string, userId: string): [string, string] => [\n COLLECTIONS.SIGNED_WAIVERS,\n buildSignedWaiverId(leagueId, userId),\n ],\n hardwareLoanContract: (contractId: string): [string, string] => [\n COLLECTIONS.HARDWARE_LOAN_CONTRACTS,\n contractId,\n ],\n\n // Awards and derived stats\n awardDefinition: (awardId: string): [string, string] => [COLLECTIONS.AWARD_DEFINITIONS, awardId],\n awardGroupGrant: (grantId: string): [string, string] => [COLLECTIONS.AWARD_GROUP_GRANTS, grantId],\n awardGroupGrantPerson: (grantId: string, userId: string): [string, string, string, string] => [\n COLLECTIONS.AWARD_GROUP_GRANTS,\n grantId,\n AWARD_GROUP_GRANT_SUBCOLLECTIONS.AWARD_GROUP_GRANT_PEOPLE,\n userId,\n ],\n awardGroupGrantPeople: (grantId: string): [string, string, string] => [\n COLLECTIONS.AWARD_GROUP_GRANTS,\n grantId,\n AWARD_GROUP_GRANT_SUBCOLLECTIONS.AWARD_GROUP_GRANT_PEOPLE,\n ],\n sportHallOfFame: (sportKey: SportKey): [string, string] => [COLLECTIONS.SPORT_HALL_OF_FAME, sportKey],\n statsValidationReport: (reportId: string): [string, string] => [\n COLLECTIONS.STATS_VALIDATION_REPORTS,\n reportId,\n ],\n statsOperation: (operationId: string): [string, string] => [COLLECTIONS.STATS_OPERATIONS, operationId],\n migrationActionRun: (actionId: string): [string, string] => [COLLECTIONS.MIGRATION_ACTION_RUNS, actionId],\n\n galleryPicture: (pictureId: string): [string, string] => [COLLECTIONS.GALLERY_PICTURES, pictureId],\n pendingMedia: (pendingMediaId: string): [string, string] => [COLLECTIONS.PENDING_MEDIA, pendingMediaId],\n // A picture's retirement is keyed by the picture id; a whole gallery's by `buildGalleryRetirementId`.\n pictureRetirement: (retirementId: string): [string, string] => [\n COLLECTIONS.PICTURE_RETIREMENTS,\n retirementId,\n ],\n\n auditEvent: (auditEventId: string): [string, string] => [COLLECTIONS.AUDIT_EVENTS, auditEventId],\n\n // Admin notifications. A card's id is notification-core's; the others come from ../ids.\n activeAdminNotification: (notificationId: string): [string, string] => [\n COLLECTIONS.ACTIVE_ADMIN_NOTIFICATIONS,\n notificationId,\n ],\n adminNotificationHistoryEntry: (historyId: string): [string, string] => [\n COLLECTIONS.ADMIN_NOTIFICATION_HISTORY,\n historyId,\n ],\n notificationDelivery: (deliveryId: string): [string, string] => [COLLECTIONS.NOTIFICATION_DELIVERIES, deliveryId],\n notificationArchiveAllJob: (jobId: string): [string, string] => [COLLECTIONS.NOTIFICATION_ARCHIVE_ALL_JOBS, jobId],\n\n // Fixed-ID system documents\n landingPageConfig: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.LANDING_PAGE],\n appConfig: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.APP_CONFIG],\n statsBeacon: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.STATS_BEACON],\n adminList: (): [string, string] => [COLLECTIONS.SYSTEM_DATA, SPECIAL_DOCS.ADMIN_LIST],\n migrationConsole: (): [string, string] => [COLLECTIONS.SERVER_DATA, SPECIAL_DOCS.MIGRATION_CONSOLE],\n gameLocationRegistry: (): [string, string] => [COLLECTIONS.SERVER_DATA, SPECIAL_DOCS.GAME_LOCATION_REGISTRY],\n waiverTemplateRegistry: (): [string, string] => [COLLECTIONS.SERVER_DATA, SPECIAL_DOCS.WAIVER_TEMPLATE_REGISTRY],\n} as const;\n"]}
1
+ {"version":3,"file":"path-builders.js","sourceRoot":"","sources":["../../src/paths/path-builders.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,0DAA0D;AAC1D,8DAA8D;AAC9D,EAAE;AACF,iGAAiG;AACjG,mGAAmG;AACnG,8EAA8E;AAE9E,OAAO,EACL,gCAAgC,EAChC,WAAW,EACX,yBAAyB,EACzB,YAAY,EACZ,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,SAAS;IACT,WAAW,EAAE,CAAC,MAAc,EAAoB,EAAE,CAAC,CAAC,WAAW,CAAC,aAAa,EAAE,MAAM,CAAC;IACtF,eAAe,EAAE,CAAC,MAAc,EAAoC,EAAE,CAAC;QACrE,WAAW,CAAC,aAAa;QACzB,MAAM;QACN,2BAA2B,CAAC,YAAY;QACxC,MAAM;KACP;IACD,cAAc,EAAE,CAAC,MAAc,EAAE,QAAkB,EAAoC,EAAE,CAAC;QACxF,WAAW,CAAC,aAAa;QACzB,MAAM;QACN,2BA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ACzC,KAAK;KACN;IAED,4BAA4B;IAC5B,iBAAiB,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC;IAC9F,SAAS,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,UAAU,CAAC;IACpF,WAAW,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC;IACxF,SAAS,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,YAAY,CAAC,UAAU,CAAC;IACrF,gBAAgB,EAAE,GAAqB,EAAE,CAAC;QACxC,WAAW,CAAC,WAAW;QACvB,YAAY,CAAC,iBAAiB;KAC/B;IACD,oBAAoB,EAAE,GAAqB,EAAE,CAAC;QAC5C,WAAW,CAAC,WAAW;QACvB,YAAY,CAAC,sBAAsB;KACpC;IACD,sBAAsB,EAAE,GAAqB,EAAE,CAAC;QAC9C,WAAW,CAAC,WAAW;QACvB,YAAY,CAAC,wBAAwB;KACtC;CACO,CAAC","sourcesContent":["// Document path builders — segment tuples, the one path family.\n//\n// Frontend: doc(db, ...PATH_BUILDERS.userProfile(userId))\n// Backend: db.doc(toPath(PATH_BUILDERS.userProfile(userId)))\n//\n// A singular name builds a document path; its plural builds the parent collection path where the\n// parent is a subcollection (top-level collections are in COLLECTION_REFS). A compound document ID\n// is assembled here through its one builder in ../ids — never at a call site.\n\nimport {\n AWARD_GROUP_GRANT_SUBCOLLECTIONS,\n COLLECTIONS,\n SPORT_GAME_SUBCOLLECTIONS,\n SPECIAL_DOCS,\n USER_PROFILE_SUBCOLLECTIONS,\n WAIVER_TEMPLATE_SUBCOLLECTIONS,\n} from './collections.js';\nimport type { SweepStateName } from '../constants/scheduled-jobs.js';\nimport {\n buildGameRosterPlayerId,\n buildLeagueFreeAgentId,\n buildTeamMembershipId,\n buildSignedWaiverId,\n} from '../ids/compound-ids.js';\nimport { buildWaiverTemplateVersionId } from '../ids/waiver-template-ids.js';\nimport type { SportKey } from '../types/sports.js';\nimport { toReservedDisplayNameKey } from '../utils/display-name.js';\n\nexport const PATH_BUILDERS = {\n // People\n userProfile: (userId: string): [string, string] => [COLLECTIONS.USER_PROFILES, userId],\n userPrivateData: (userId: string): [string, string, string, string] => [\n COLLECTIONS.USER_PROFILES,\n userId,\n USER_PROFILE_SUBCOLLECTIONS.PRIVATE_DATA,\n userId,\n ],\n historicalStat: (userId: string, sportKey: SportKey): [string, string, string, string] => [\n COLLECTIONS.USER_PROFILES,\n userId,\n USER_PROFILE_SUBCOLLECTIONS.HISTORICAL_STATS,\n sportKey,\n ],\n historicalStats: (userId: string): [string, string, string] => [\n COLLECTIONS.USER_PROFILES,\n userId,\n USER_PROFILE_SUBCOLLECTIONS.HISTORICAL_STATS,\n ],\n publicUser: (userId: string): [string, string] => [COLLECTIONS.PUBLIC_USERS, userId],\n statusReconcileQueueEntry: (userId: string): [string, string] => [\n COLLECTIONS.STATUS_RECONCILE_QUEUE,\n userId,\n ],\n registrationStart: (userId: string): [string, string] => [\n COLLECTIONS.REGISTRATION_STARTS,\n userId,\n ],\n sweepState: (name: SweepStateName): [string, string] => [COLLECTIONS.SWEEP_STATE, name],\n reservedDisplayName: (displayName: string): [string, string] => [\n COLLECTIONS.RESERVED_DISPLAY_NAMES,\n toReservedDisplayNameKey(displayName),\n ],\n\n // Leagues, teams, membership\n sportLeague: (leagueId: string): [string, string] => [COLLECTIONS.SPORT_LEAGUES, leagueId],\n leagueTeam: (teamId: string): [string, string] => [COLLECTIONS.LEAGUE_TEAMS, teamId],\n leagueTeamContact: (teamId: string): [string, string] => [\n COLLECTIONS.LEAGUE_TEAM_CONTACTS,\n teamId,\n ],\n teamMembership: (leagueId: string, teamId: string, userId: string): [string, string] => [\n COLLECTIONS.TEAM_MEMBERSHIPS,\n buildTeamMembershipId(leagueId, teamId, userId),\n ],\n membershipRosterSync: (leagueId: string, teamId: string, userId: string): [string, string] => [\n COLLECTIONS.MEMBERSHIP_ROSTER_SYNCS,\n buildTeamMembershipId(leagueId, teamId, userId),\n ],\n teamInvitation: (inviteId: string): [string, string] => [COLLECTIONS.TEAM_INVITATIONS, inviteId],\n teamJoinRequest: (requestId: string): [string, string] => [\n COLLECTIONS.TEAM_JOIN_REQUESTS,\n requestId,\n ],\n leagueFreeAgent: (leagueId: string, userId: string): [string, string] => [\n COLLECTIONS.LEAGUE_FREE_AGENTS,\n buildLeagueFreeAgentId(leagueId, userId),\n ],\n\n // Games\n sportGame: (gameId: string): [string, string] => [COLLECTIONS.SPORT_GAMES, gameId],\n gameRosterPlayer: (\n gameId: string,\n teamId: string,\n userId: string,\n ): [string, string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_ROSTER_PLAYERS,\n buildGameRosterPlayerId(teamId, userId),\n ],\n gameRosterPlayers: (gameId: string): [string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_ROSTER_PLAYERS,\n ],\n gameStatEvent: (gameId: string, eventId: string): [string, string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_EVENTS,\n eventId,\n ],\n gameStatEvents: (gameId: string): [string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_EVENTS,\n ],\n gameStatHistoryPage: (gameId: string, pageId: string): [string, string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_HISTORY,\n pageId,\n ],\n gameStatHistory: (gameId: string): [string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_HISTORY,\n ],\n gameLocation: (gameLocationId: string): [string, string] => [\n COLLECTIONS.GAME_LOCATIONS,\n gameLocationId,\n ],\n\n // Waivers and hardware\n waiverTemplate: (waiverTemplateId: string): [string, string] => [\n COLLECTIONS.WAIVER_TEMPLATES,\n waiverTemplateId,\n ],\n waiverTemplateVersion: (\n waiverTemplateId: string,\n version: number,\n ): [string, string, string, string] => [\n COLLECTIONS.WAIVER_TEMPLATES,\n waiverTemplateId,\n WAIVER_TEMPLATE_SUBCOLLECTIONS.WAIVER_TEMPLATE_VERSIONS,\n buildWaiverTemplateVersionId(version),\n ],\n waiverTemplateVersions: (waiverTemplateId: string): [string, string, string] => [\n COLLECTIONS.WAIVER_TEMPLATES,\n waiverTemplateId,\n WAIVER_TEMPLATE_SUBCOLLECTIONS.WAIVER_TEMPLATE_VERSIONS,\n ],\n signedWaiver: (leagueId: string, userId: string): [string, string] => [\n COLLECTIONS.SIGNED_WAIVERS,\n buildSignedWaiverId(leagueId, userId),\n ],\n hardwareLoanContract: (contractId: string): [string, string] => [\n COLLECTIONS.HARDWARE_LOAN_CONTRACTS,\n contractId,\n ],\n\n // Awards and derived stats\n awardDefinition: (awardId: string): [string, string] => [COLLECTIONS.AWARD_DEFINITIONS, awardId],\n awardGroupGrant: (grantId: string): [string, string] => [COLLECTIONS.AWARD_GROUP_GRANTS, grantId],\n awardGroupGrantPerson: (grantId: string, userId: string): [string, string, string, string] => [\n COLLECTIONS.AWARD_GROUP_GRANTS,\n grantId,\n AWARD_GROUP_GRANT_SUBCOLLECTIONS.AWARD_GROUP_GRANT_PEOPLE,\n userId,\n ],\n awardGroupGrantPeople: (grantId: string): [string, string, string] => [\n COLLECTIONS.AWARD_GROUP_GRANTS,\n grantId,\n AWARD_GROUP_GRANT_SUBCOLLECTIONS.AWARD_GROUP_GRANT_PEOPLE,\n ],\n sportHallOfFame: (sportKey: SportKey): [string, string] => [\n COLLECTIONS.SPORT_HALL_OF_FAME,\n sportKey,\n ],\n statsValidationReport: (reportId: string): [string, string] => [\n COLLECTIONS.STATS_VALIDATION_REPORTS,\n reportId,\n ],\n statsOperation: (operationId: string): [string, string] => [\n COLLECTIONS.STATS_OPERATIONS,\n operationId,\n ],\n migrationActionRun: (actionId: string): [string, string] => [\n COLLECTIONS.MIGRATION_ACTION_RUNS,\n actionId,\n ],\n\n galleryPicture: (pictureId: string): [string, string] => [\n COLLECTIONS.GALLERY_PICTURES,\n pictureId,\n ],\n pendingMedia: (pendingMediaId: string): [string, string] => [\n COLLECTIONS.PENDING_MEDIA,\n pendingMediaId,\n ],\n // A picture's retirement is keyed by the picture id; a whole gallery's by `buildGalleryRetirementId`.\n pictureRetirement: (retirementId: string): [string, string] => [\n COLLECTIONS.PICTURE_RETIREMENTS,\n retirementId,\n ],\n\n auditEvent: (auditEventId: string): [string, string] => [COLLECTIONS.AUDIT_EVENTS, auditEventId],\n\n // Admin notifications. A card's id is notification-core's; the others come from ../ids.\n activeAdminNotification: (notificationId: string): [string, string] => [\n COLLECTIONS.ACTIVE_ADMIN_NOTIFICATIONS,\n notificationId,\n ],\n adminNotificationHistoryEntry: (historyId: string): [string, string] => [\n COLLECTIONS.ADMIN_NOTIFICATION_HISTORY,\n historyId,\n ],\n notificationDelivery: (deliveryId: string): [string, string] => [\n COLLECTIONS.NOTIFICATION_DELIVERIES,\n deliveryId,\n ],\n notificationArchiveAllJob: (jobId: string): [string, string] => [\n COLLECTIONS.NOTIFICATION_ARCHIVE_ALL_JOBS,\n jobId,\n ],\n\n // Fixed-ID system documents\n landingPageConfig: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.LANDING_PAGE],\n appConfig: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.APP_CONFIG],\n statsBeacon: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.STATS_BEACON],\n adminList: (): [string, string] => [COLLECTIONS.SYSTEM_DATA, SPECIAL_DOCS.ADMIN_LIST],\n migrationConsole: (): [string, string] => [\n COLLECTIONS.SERVER_DATA,\n SPECIAL_DOCS.MIGRATION_CONSOLE,\n ],\n gameLocationRegistry: (): [string, string] => [\n COLLECTIONS.SERVER_DATA,\n SPECIAL_DOCS.GAME_LOCATION_REGISTRY,\n ],\n waiverTemplateRegistry: (): [string, string] => [\n COLLECTIONS.SERVER_DATA,\n SPECIAL_DOCS.WAIVER_TEMPLATE_REGISTRY,\n ],\n} as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"picture-owner-paths.d.ts","sourceRoot":"","sources":["../../src/paths/picture-owner-paths.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAoB,gBAAgB,EAAwB,MAAM,4BAA4B,CAAC;AAI3G,eAAO,MAAM,mBAAmB;;qCACK,MAAM;;;qCACP,MAAM;;;;;CAGwD,CAAC;AAGnG,eAAO,MAAM,mBAAmB;;qCAER,MAAM;;;;qCAIN,MAAM;;;CAG2F,CAAC;AAE1H,eAAO,MAAM,mBAAmB;;qCATR,MAAM;;;;qCAIN,MAAM;;;;qCAbO,MAAM;;;qCACP,MAAM;;;;;CAoBwD,CAAC;AAEnG;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAGjF"}
1
+ {"version":3,"file":"picture-owner-paths.d.ts","sourceRoot":"","sources":["../../src/paths/picture-owner-paths.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAEV,gBAAgB,EAEjB,MAAM,4BAA4B,CAAC;AAIpC,eAAO,MAAM,mBAAmB;;qCACK,MAAM;;;qCACP,MAAM;;;;;CAGwD,CAAC;AAGnG,eAAO,MAAM,mBAAmB;;qCAER,MAAM;;;;qCAIN,MAAM;;;CAM7B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;qCAZR,MAAM;;;;qCAIN,MAAM;;;;qCAbO,MAAM;;;qCACP,MAAM;;;;;CAuBwD,CAAC;AAEnG;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,O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AAa,IAAI,OAAO,KAAK,YAAY,CAAC,YAAY,CAAC;AACzE,CAAC","sourcesContent":["// The document each kind of picture owner is (ARCH-104), split by what the picture core writes on\n// it: a gallery owner holds a `pictures` summary, and a slot owner holds one picture in its slot\n// field. A writer indexes the map for the owners it writes, so its target is only those documents;\n// the full map, composed from both, serves the reads that take any owner.\n\nimport type { AwardDefinition } from '../doc-schemas/catalogs.js';\nimport type { GameLocation } from '../doc-schemas/game-location.js';\nimport type { GalleryOwnerKind, PictureOwnerKind, PictureSlotOwnerKind } from '../types/picture-owners.js';\nimport { SPECIAL_DOCS } from './collections.js';\nimport { PATH_BUILDERS } from './path-builders.js';\n\nexport const GALLERY_OWNER_PATHS = {\n sportLeague: { ownerDoc: (ownerId: string) => PATH_BUILDERS.sportLeague(ownerId) },\n leagueTeam: { ownerDoc: (ownerId: string) => PATH_BUILDERS.leagueTeam(ownerId) },\n // There is one landing page, and its owner id is its document id.\n landingPage: { ownerDoc: () => PATH_BUILDERS.landingPageConfig() },\n} as const satisfies Record<GalleryOwnerKind, { ownerDoc: (ownerId: string) => [string, string] }>;\n\n// Each slot field is a key of its own document's schema, so a renamed field fails to build here.\nexport const PICTURE_SLOT_OWNERS = {\n gameLocation: {\n ownerDoc: (ownerId: string) => PATH_BUILDERS.gameLocation(ownerId),\n slotField: 'pictureId' satisfies keyof GameLocation,\n },\n awardDefinition: {\n ownerDoc: (ownerId: string) => PATH_BUILDERS.awardDefinition(ownerId),\n slotField: 'badgePictureId' satisfies keyof AwardDefinition,\n },\n} as const satisfies Record<PictureSlotOwnerKind, { ownerDoc: (ownerId: string) => [string, string]; slotField: string }>;\n\nexport const PICTURE_OWNER_PATHS = {\n ...GALLERY_OWNER_PATHS,\n ...PICTURE_SLOT_OWNERS,\n} as const satisfies Record<PictureOwnerKind, { ownerDoc: (ownerId: string) => [string, string] }>;\n\n/**\n * Whether an owner id can name an owner of its kind. Every kind but the landing page takes any\n * document id; the landing page is the one document `SPECIAL_DOCS.LANDING_PAGE` names.\n */\nexport function isPictureOwnerId(kind: PictureOwnerKind, ownerId: string): boolean {\n if (ownerId.length === 0) return false;\n return kind !== 'landingPage' || ownerId === SPECIAL_DOCS.LANDING_PAGE;\n}\n"]}
1
+ {"version":3,"file":"picture-owner-paths.js","sourceRoot":"","sources":["../../src/paths/picture-owner-paths.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,iGAAiG;AACjG,mGAAmG;AACnG,0EAA0E;AAS1E,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;IAClF,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;IAChF,kEAAkE;IAClE,WAAW,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,iBAAiB,EAAE,EAAE;CAC8B,CAAC;AAEnG,iGAAiG;AACjG,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,YAAY,EAAE;QACZ,QAAQ,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC;QAClE,SAAS,EAAE,WAAwC;KACpD;IACD,eAAe,EAAE;QACf,QAAQ,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,aAAa,CAAC,eAAe,CAAC,OAAO,CAAC;QACrE,SAAS,EAAE,gBAAgD;KAC5D;CAIF,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,mBAAmB;IACtB,GAAG,mBAAmB;CAC0E,CAAC;AAEnG;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAsB,EAAE,OAAe;IACtE,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACvC,OAAO,IAAI,KAAK,aAAa,IAAI,OAAO,KAAK,YAAY,CAAC,YAAY,CAAC;AACzE,CAAC","sourcesContent":["// The document each kind of picture owner is (ARCH-104), split by what the picture core writes on\n// it: a gallery owner holds a `pictures` summary, and a slot owner holds one picture in its slot\n// field. A writer indexes the map for the owners it writes, so its target is only those documents;\n// the full map, composed from both, serves the reads that take any owner.\n\nimport type { AwardDefinition } from '../doc-schemas/catalogs.js';\nimport type { GameLocation } from '../doc-schemas/game-location.js';\nimport type {\n GalleryOwnerKind,\n PictureOwnerKind,\n PictureSlotOwnerKind,\n} from '../types/picture-owners.js';\nimport { SPECIAL_DOCS } from './collections.js';\nimport { PATH_BUILDERS } from './path-builders.js';\n\nexport const GALLERY_OWNER_PATHS = {\n sportLeague: { ownerDoc: (ownerId: string) => PATH_BUILDERS.sportLeague(ownerId) },\n leagueTeam: { ownerDoc: (ownerId: string) => PATH_BUILDERS.leagueTeam(ownerId) },\n // There is one landing page, and its owner id is its document id.\n landingPage: { ownerDoc: () => PATH_BUILDERS.landingPageConfig() },\n} as const satisfies Record<GalleryOwnerKind, { ownerDoc: (ownerId: string) => [string, string] }>;\n\n// Each slot field is a key of its own document's schema, so a renamed field fails to build here.\nexport const PICTURE_SLOT_OWNERS = {\n gameLocation: {\n ownerDoc: (ownerId: string) => PATH_BUILDERS.gameLocation(ownerId),\n slotField: 'pictureId' satisfies keyof GameLocation,\n },\n awardDefinition: {\n ownerDoc: (ownerId: string) => PATH_BUILDERS.awardDefinition(ownerId),\n slotField: 'badgePictureId' satisfies keyof AwardDefinition,\n },\n} as const satisfies Record<\n PictureSlotOwnerKind,\n { ownerDoc: (ownerId: string) => [string, string]; slotField: string }\n>;\n\nexport const PICTURE_OWNER_PATHS = {\n ...GALLERY_OWNER_PATHS,\n ...PICTURE_SLOT_OWNERS,\n} as const satisfies Record<PictureOwnerKind, { ownerDoc: (ownerId: string) => [string, string] }>;\n\n/**\n * Whether an owner id can name an owner of its kind. Every kind but the landing page takes any\n * document id; the landing page is the one document `SPECIAL_DOCS.LANDING_PAGE` names.\n */\nexport function isPictureOwnerId(kind: PictureOwnerKind, ownerId: string): boolean {\n if (ownerId.length === 0) return false;\n return kind !== 'landingPage' || ownerId === SPECIAL_DOCS.LANDING_PAGE;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"storage-paths.d.ts","sourceRoot":"","sources":["../../src/paths/storage-paths.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAM1C,kFAAkF;AAClF,eAAO,MAAM,qBAAqB,aAAuB,CAAC;AAE1D,yDAAyD;AACzD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhG;AAED,+FAA+F;AAC/F,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,MAAM,CAER;AAED,0GAA0G;AAC1G,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAErG;AAED,8DAA8D;AAC9D,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAElE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,MAAM,CAE/F;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,EAAE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AAU,0BAA0B,CAAC,MAAc,EAAE,UAAkB,EAAE,MAAc;IAC3F,OAAO,GAAG,iBAAiB,GAAG,MAAM,IAAI,0BAA0B,IAAI,UAAU,IAAI,MAAM,EAAE,CAAC;AAC/F,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,wBAAwB,CAAC,SAAiB;IACxD,OAAO,GAAG,eAAe,IAAI,SAAS,EAAE,CAAC;AAC3C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAAiB,EAAE,UAA6B;IACrF,OAAO,GAAG,wBAAwB,CAAC,SAAS,CAAC,IAAI,UAAU,EAAE,CAAC;AAChE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,UAAsB,EAAE,MAAc,EAAE,SAAiB;IAC9F,OAAO,GAAG,qBAAqB,GAAG,UAAU,IAAI,MAAM,IAAI,SAAS,EAAE,CAAC;AACxE,CAAC;AAQD;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAY;IACjD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,GAAG,QAA4C,CAAC;IAC7F,IAAI,MAAM,KAAK,cAAc,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/F,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC;IACzC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAC3C,CAAC","sourcesContent":["// Cloud Storage path builders. Storage paths are plain slash strings — no SDK takes segments.\n//\n// The staging path is the one path a client writes. Every other path is derived by the server:\n// picture sizes by the picture processor, and signature files — legal artifacts kept under their\n// subject's prefix, with no client grant at all — by the callable that records the signing.\n\nimport { isFileOrigin } from '../media/file-origins.js';\nimport type { FileOrigin } from '../media/file-origins.js';\nimport { isStagingId } from '../ids/picture-ids.js';\nimport type { PictureVariantKey } from '../types/unions.js';\n\nexport const USER_FILES_PREFIX = 'users/';\nconst SIGNED_WAIVERS_FOLDER = 'waiverSigs';\nconst HARDWARE_SIGNATURES_FOLDER = 'hardwareSigs';\nconst PICTURES_FOLDER = 'pictures';\nconst STAGING_FOLDER = 'uploads';\n\n/** Everything a client uploads lands under this prefix, and nothing else does. */\nexport const STAGING_UPLOAD_PREFIX = `${STAGING_FOLDER}/`;\n\n/** A real user's own waiver signature for one league. */\nexport function buildSignedWaiverPath(userId: string, leagueId: string, fileName: string): string {\n return `${USER_FILES_PREFIX}${userId}/${SIGNED_WAIVERS_FOLDER}/${leagueId}/${fileName}`;\n}\n\n/** A ghost player's waiver signature, captured by a witness for the ghost's team, `teamId`. */\nexport function buildGhostSignedWaiverPath(\n ghostUserId: string,\n leagueId: string,\n teamId: string,\n fileName: string,\n): string {\n return `${USER_FILES_PREFIX}${ghostUserId}/${SIGNED_WAIVERS_FOLDER}/${leagueId}/${teamId}/${fileName}`;\n}\n\n/** A referee's signature on one hardware contract, named for its staging id like every kept signature. */\nexport function buildHardwareSignaturePath(userId: string, contractId: string, fileId: string): string {\n return `${USER_FILES_PREFIX}${userId}/${HARDWARE_SIGNATURES_FOLDER}/${contractId}/${fileId}`;\n}\n\n/** The folder holding every processed size of one picture. */\nexport function buildPictureObjectPrefix(pictureId: string): string {\n return `${PICTURES_FOLDER}/${pictureId}`;\n}\n\n/**\n * One processed size of a picture. Every picture kind shares this prefix, and the key carries no\n * extension: the object's own content type says what it is.\n */\nexport function buildPictureObjectPath(pictureId: string, variantKey: PictureVariantKey): string {\n return `${buildPictureObjectPrefix(pictureId)}/${variantKey}`;\n}\n\n/**\n * Where a client stages one upload: its origin, the uploader's own uid, and the id it minted. The\n * callable that accepts the upload rebuilds this from the AUTHENTICATED uid and refuses anything\n * not exactly equal (MEDIA-002), so a client can only ever name its own staged object.\n */\nexport function buildStagingUploadPath(fileOrigin: FileOrigin, userId: string, stagingId: string): string {\n return `${STAGING_UPLOAD_PREFIX}${fileOrigin}/${userId}/${stagingId}`;\n}\n\nexport interface StagingUploadPathParts {\n fileOrigin: FileOrigin;\n userId: string;\n stagingId: string;\n}\n\n/**\n * The parts of a staging path, or `null` for anything that is not one: another prefix, a wrong\n * segment count, an unknown origin, an empty uid, or a staging id that is not a lowercase UUID.\n */\nexport function parseStagingUploadPath(path: string): StagingUploadPathParts | null {\n const segments = path.split('/');\n if (segments.length !== 4) return null;\n const [folder, fileOrigin, userId, stagingId] = segments as [string, string, string, string];\n if (folder !== STAGING_FOLDER || !isFileOrigin(fileOrigin) || userId.length === 0) return null;\n if (!isStagingId(stagingId)) return null;\n return { fileOrigin, userId, stagingId };\n}\n"]}
1
+ {"version":3,"file":"storage-paths.js","sourceRoot":"","sources":["../../src/paths/storage-paths.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,EAAE;AACF,+FAA+F;AAC/F,iGAAiG;AACjG,4FAA4F;AAE5F,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAC1C,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAC3C,MAAM,0BAA0B,GAAG,cAAc,CAAC;AAClD,MAAM,eAAe,GAAG,UAAU,CAAC;AACnC,MAAM,cAAc,GAAG,SAAS,CAAC;AAEjC,kFAAkF;AAClF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,cAAc,GAAG,CAAC;AAE1D,yDAAyD;AACzD,MAAM,UAAU,qBAAqB,CAAC,MAAc,EAAE,QAAgB,EAAE,QAAgB;IACtF,OAAO,GAAG,iBAAiB,GAAG,MAAM,IAA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,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/F,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC;IACzC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAC3C,CAAC","sourcesContent":["// Cloud Storage path builders. Storage paths are plain slash strings — no SDK takes segments.\n//\n// The staging path is the one path a client writes. Every other path is derived by the server:\n// picture sizes by the picture processor, and signature files — legal artifacts kept under their\n// subject's prefix, with no client grant at all — by the callable that records the signing.\n\nimport { isFileOrigin } from '../media/file-origins.js';\nimport type { FileOrigin } from '../media/file-origins.js';\nimport { isStagingId } from '../ids/picture-ids.js';\nimport type { PictureVariantKey } from '../types/unions.js';\n\nexport const USER_FILES_PREFIX = 'users/';\nconst SIGNED_WAIVERS_FOLDER = 'waiverSigs';\nconst HARDWARE_SIGNATURES_FOLDER = 'hardwareSigs';\nconst PICTURES_FOLDER = 'pictures';\nconst STAGING_FOLDER = 'uploads';\n\n/** Everything a client uploads lands under this prefix, and nothing else does. */\nexport const STAGING_UPLOAD_PREFIX = `${STAGING_FOLDER}/`;\n\n/** A real user's own waiver signature for one league. */\nexport function buildSignedWaiverPath(userId: string, leagueId: string, fileName: string): string {\n return `${USER_FILES_PREFIX}${userId}/${SIGNED_WAIVERS_FOLDER}/${leagueId}/${fileName}`;\n}\n\n/** A ghost player's waiver signature, captured by a witness for the ghost's team, `teamId`. */\nexport function buildGhostSignedWaiverPath(\n ghostUserId: string,\n leagueId: string,\n teamId: string,\n fileName: string,\n): string {\n return `${USER_FILES_PREFIX}${ghostUserId}/${SIGNED_WAIVERS_FOLDER}/${leagueId}/${teamId}/${fileName}`;\n}\n\n/** A referee's signature on one hardware contract, named for its staging id like every kept signature. */\nexport function buildHardwareSignaturePath(\n userId: string,\n contractId: string,\n fileId: string,\n): string {\n return `${USER_FILES_PREFIX}${userId}/${HARDWARE_SIGNATURES_FOLDER}/${contractId}/${fileId}`;\n}\n\n/** The folder holding every processed size of one picture. */\nexport function buildPictureObjectPrefix(pictureId: string): string {\n return `${PICTURES_FOLDER}/${pictureId}`;\n}\n\n/**\n * One processed size of a picture. Every picture kind shares this prefix, and the key carries no\n * extension: the object's own content type says what it is.\n */\nexport function buildPictureObjectPath(pictureId: string, variantKey: PictureVariantKey): string {\n return `${buildPictureObjectPrefix(pictureId)}/${variantKey}`;\n}\n\n/**\n * Where a client stages one upload: its origin, the uploader's own uid, and the id it minted. The\n * callable that accepts the upload rebuilds this from the AUTHENTICATED uid and refuses anything\n * not exactly equal (MEDIA-002), so a client can only ever name its own staged object.\n */\nexport function buildStagingUploadPath(\n fileOrigin: FileOrigin,\n userId: string,\n stagingId: string,\n): string {\n return `${STAGING_UPLOAD_PREFIX}${fileOrigin}/${userId}/${stagingId}`;\n}\n\nexport interface StagingUploadPathParts {\n fileOrigin: FileOrigin;\n userId: string;\n stagingId: string;\n}\n\n/**\n * The parts of a staging path, or `null` for anything that is not one: another prefix, a wrong\n * segment count, an unknown origin, an empty uid, or a staging id that is not a lowercase UUID.\n */\nexport function parseStagingUploadPath(path: string): StagingUploadPathParts | null {\n const segments = path.split('/');\n if (segments.length !== 4) return null;\n const [folder, fileOrigin, userId, stagingId] = segments as [string, string, string, string];\n if (folder !== STAGING_FOLDER || !isFileOrigin(fileOrigin) || userId.length === 0) return null;\n if (!isStagingId(stagingId)) return null;\n return { fileOrigin, userId, stagingId };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"admin-notifications.d.ts","sourceRoot":"","sources":["../../src/schemas/admin-notifications.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,yBAAyB,aAAqE,CAAC;AAK5G,eAAO,MAAM,wBAAwB,aAA6B,CAAC;AAInE,eAAO,MAAM,2BAA2B,WAAW,CAAC;AAEpD,eAAO,MAAM,iCAAiC,aAEgD,CAAC;AAE/F,eAAO,MAAM,mCAAmC;;;;k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AG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG,eAAO,MAAM,uCAAuC;;kBAEzC,CAAC;AACZ,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,uCAAuC,CAC/C,CAAC;AACF,eAAO,MAAM,wCAAwC;;kBAE1C,CAAC;AACZ,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,wCAAwC,CAChD,CAAC;AAEF,eAAO,MAAM,+CAA+C;;kBAEjD,CAAC;AACZ,MAAM,MAAM,yCAAyC,GAAG,CAAC,CAAC,KAAK,CAC7D,OAAO,+CAA+C,CACvD,CAAC;AAIF,eAAO,MAAM,gDAAgD;;;;;;;;;;;kBAQlD,CAAC;AACZ,MAAM,MAAM,0CAA0C,GAAG,CAAC,CAAC,KAAK,CAC9D,OAAO,gDAAgD,CACxD,CAAC"}
@@ -5,11 +5,13 @@
5
5
  // (BACKEND-306).
6
6
  import { z } from 'zod';
7
7
  import { parseNotificationArchiveAllJobId } from '../ids/notification-ids.js';
8
- import { ADMIN_NOTIFICATION_CATEGORY, NOTIFICATION_ARCHIVE_ALL_JOB_STATE_KEYS } from '../types/notifications.js';
9
- import { countSchema } from './atoms.js';
8
+ import { ADMIN_NOTIFICATION_CATEGORY, NOTIFICATION_ARCHIVE_ALL_JOB_STATE_KEYS, } from '../types/notifications.js';
9
+ import { countSchema } from '../doc-schemas/atoms.js';
10
10
  // A card's document id as notification-core derives it: a hex digest. Bounding it to letters and
11
11
  // digits keeps a client-sent id from addressing anything but a document of the card collection.
12
- export const adminNotificationIdSchema = z.string().regex(/^[A-Za-z0-9]{1,128}$/, 'Not a notification id.');
12
+ export const adminNotificationIdSchema = z
13
+ .string()
14
+ .regex(/^[A-Za-z0-9]{1,128}$/, 'Not a notification id.');
13
15
  // The opaque generation token a card carried when the admin saw it. An action on the card applies
14
16
  // only while the card still carries it, so activity that arrived after the admin looked is never
15
17
  // archived unseen.
@@ -30,7 +32,9 @@ export const AdminArchiveNotificationInputSchema = z
30
32
  // `archived` is false when there was nothing to archive at the generation named: another admin
31
33
  // archived the card first, or new activity lit it again, and it stays on the list.
32
34
  export const AdminArchiveNotificationResultSchema = z.object({ archived: z.boolean() }).strict();
33
- export const AdminArchiveAllNotificationsInputSchema = z.object({ requestId: notificationRequestIdSchema }).strict();
35
+ export const AdminArchiveAllNotificationsInputSchema = z
36
+ .object({ requestId: notificationRequestIdSchema })
37
+ .strict();
34
38
  export const AdminArchiveAllNotificationsResultSchema = z
35
39
  .object({ jobId: notificationArchiveAllJobIdSchema })
36
40
  .strict();
@@ -1 +1 @@
1
- {"version":3,"file":"admin-notifications.js","sourceRoot":"","sources":["../../src/schemas/admin-notifications.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,qGAAqG;AACrG,oGAAoG;AACpG,0FAA0F;AAC1F,iBAAiB;AAEjB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,uCAAuC,EAAE,MAAM,2BAA2B,CAAC;AACjH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,iGAAiG;AACjG,gGAAgG;AAChG,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,sBAAsB,EAAE,wBAAwB,CAAC,CAAC;AAE5G,kGAAkG;AAClG,iGAAiG;AACjG,mBAAmB;AACnB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEnE,oGAAoG;AACpG,iEAAiE;AACjE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAEpD,MAAM,CAAC,MAAM,iCAAiC,GA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CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the shared admin notifications: archiving one, archiving all of them,\n// and reading how an archive-all is going. The occurrences the delivery worker gave up on are listed\n// and replayed through the operator's dead letters (./dead-letters.ts). Admin only; a card is never\n// created by a client — the callable that owns each notified action writes its occurrence\n// (BACKEND-306).\n\nimport { z } from 'zod';\nimport { parseNotificationArchiveAllJobId } from '../ids/notification-ids.js';\nimport { ADMIN_NOTIFICATION_CATEGORY, NOTIFICATION_ARCHIVE_ALL_JOB_STATE_KEYS } from '../types/notifications.js';\nimport { countSchema } from './atoms.js';\n\n// A card's document id as notification-core derives it: a hex digest. Bounding it to letters and\n// digits keeps a client-sent id from addressing anything but a document of the card collection.\nexport const adminNotificationIdSchema = z.string().regex(/^[A-Za-z0-9]{1,128}$/, 'Not a notification id.');\n\n// The opaque generation token a card carried when the admin saw it. An action on the card applies\n// only while the card still carries it, so activity that arrived after the admin looked is never\n// archived unseen.\nexport const activityGenerationSchema = z.string().min(1).max(128);\n\n// A fresh UUID per click. An archive's history entry and an archive-all's job are keyed by it, so a\n// retry of the same click lands on what the first attempt wrote.\nexport const notificationRequestIdSchema = z.uuid();\n\nexport const notificationArchiveAllJobIdSchema = z\n .string()\n .refine((id) => parseNotificationArchiveAllJobId(id) !== null, 'Not an archive-all job id.');\n\nexport const AdminArchiveNotificationInputSchema = z\n .object({\n requestId: notificationRequestIdSchema,\n notificationId: adminNotificationIdSchema,\n observedActivityGeneration: activityGenerationSchema,\n })\n .strict();\nexport type AdminArchiveNotificationInput = z.infer<typeof AdminArchiveNotificationInputSchema>;\n// `archived` is false when there was nothing to archive at the generation named: another admin\n// archived the card first, or new activity lit it again, and it stays on the list.\nexport const AdminArchiveNotificationResultSchema = z.object({ archived: z.boolean() }).strict();\nexport type AdminArchiveNotificationResult = z.infer<typeof AdminArchiveNotificationResultSchema>;\n\nexport const AdminArchiveAllNotificationsInputSchema = z.object({ requestId: notificationRequestIdSchema }).strict();\nexport type AdminArchiveAllNotificationsInput = z.infer<typeof AdminArchiveAllNotificationsInputSchema>;\nexport const AdminArchiveAllNotificationsResultSchema = z\n .object({ jobId: notificationArchiveAllJobIdSchema })\n .strict();\nexport type AdminArchiveAllNotificationsResult = z.infer<typeof AdminArchiveAllNotificationsResultSchema>;\n\nexport const AdminGetNotificationArchiveAllStatusInputSchema = z\n .object({ jobId: notificationArchiveAllJobIdSchema })\n .strict();\nexport type AdminGetNotificationArchiveAllStatusInput = z.infer<typeof AdminGetNotificationArchiveAllStatusInputSchema>;\n// notification-core's archive-all snapshot: the job's state, the category it drains, how many\n// cards it has archived, and — on a completed job that left cards behind — how many it could not.\n// A job that ran out of attempts with cards left reads as `incomplete`.\nexport const AdminGetNotificationArchiveAllStatusResultSchema = z\n .object({\n state: z.enum(NOTIFICATION_ARCHIVE_ALL_JOB_STATE_KEYS),\n category: z.literal(ADMIN_NOTIFICATION_CATEGORY),\n archived: countSchema,\n notArchived: countSchema.optional(),\n error: z.string().optional(),\n })\n .strict();\nexport type AdminGetNotificationArchiveAllStatusResult = z.infer<typeof AdminGetNotificationArchiveAllStatusResultSchema>;\n"]}
1
+ {"version":3,"file":"admin-notifications.js","sourceRoot":"","sources":["../../src/schemas/admin-notifications.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,qGAAqG;AACrG,oGAAoG;AACpG,0FAA0F;AAC1F,iBAAiB;AAEjB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EACL,2BAA2B,EAC3B,uCAAuC,GACxC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,iGAAiG;AACjG,gGAAgG;AAChG,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,MAAM,EAAE;KACR,KAAK,CAAC,sBAAsB,EAAE,wBAAwB,CAAC,CAAC;AAE3D,kGAAkG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AAM,gDAAgD,GAAG,CAAC;KAC9D,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,uCAAuC,CAAC;IACtD,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,2BAA2B,CAAC;IAChD,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,WAAW,CAAC,QAAQ,EAAE;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the shared admin notifications: archiving one, archiving all of them,\n// and reading how an archive-all is going. The occurrences the delivery worker gave up on are listed\n// and replayed through the operator's dead letters (./dead-letters.ts). Admin only; a card is never\n// created by a client — the callable that owns each notified action writes its occurrence\n// (BACKEND-306).\n\nimport { z } from 'zod';\nimport { parseNotificationArchiveAllJobId } from '../ids/notification-ids.js';\nimport {\n ADMIN_NOTIFICATION_CATEGORY,\n NOTIFICATION_ARCHIVE_ALL_JOB_STATE_KEYS,\n} from '../types/notifications.js';\nimport { countSchema } from '../doc-schemas/atoms.js';\n\n// A card's document id as notification-core derives it: a hex digest. Bounding it to letters and\n// digits keeps a client-sent id from addressing anything but a document of the card collection.\nexport const adminNotificationIdSchema = z\n .string()\n .regex(/^[A-Za-z0-9]{1,128}$/, 'Not a notification id.');\n\n// The opaque generation token a card carried when the admin saw it. An action on the card applies\n// only while the card still carries it, so activity that arrived after the admin looked is never\n// archived unseen.\nexport const activityGenerationSchema = z.string().min(1).max(128);\n\n// A fresh UUID per click. An archive's history entry and an archive-all's job are keyed by it, so a\n// retry of the same click lands on what the first attempt wrote.\nexport const notificationRequestIdSchema = z.uuid();\n\nexport const notificationArchiveAllJobIdSchema = z\n .string()\n .refine((id) => parseNotificationArchiveAllJobId(id) !== null, 'Not an archive-all job id.');\n\nexport const AdminArchiveNotificationInputSchema = z\n .object({\n requestId: notificationRequestIdSchema,\n notificationId: adminNotificationIdSchema,\n observedActivityGeneration: activityGenerationSchema,\n })\n .strict();\nexport type AdminArchiveNotificationInput = z.infer<typeof AdminArchiveNotificationInputSchema>;\n// `archived` is false when there was nothing to archive at the generation named: another admin\n// archived the card first, or new activity lit it again, and it stays on the list.\nexport const AdminArchiveNotificationResultSchema = z.object({ archived: z.boolean() }).strict();\nexport type AdminArchiveNotificationResult = z.infer<typeof AdminArchiveNotificationResultSchema>;\n\nexport const AdminArchiveAllNotificationsInputSchema = z\n .object({ requestId: notificationRequestIdSchema })\n .strict();\nexport type AdminArchiveAllNotificationsInput = z.infer<\n typeof AdminArchiveAllNotificationsInputSchema\n>;\nexport const AdminArchiveAllNotificationsResultSchema = z\n .object({ jobId: notificationArchiveAllJobIdSchema })\n .strict();\nexport type AdminArchiveAllNotificationsResult = z.infer<\n typeof AdminArchiveAllNotificationsResultSchema\n>;\n\nexport const AdminGetNotificationArchiveAllStatusInputSchema = z\n .object({ jobId: notificationArchiveAllJobIdSchema })\n .strict();\nexport type AdminGetNotificationArchiveAllStatusInput = z.infer<\n typeof AdminGetNotificationArchiveAllStatusInputSchema\n>;\n// notification-core's archive-all snapshot: the job's state, the category it drains, how many\n// cards it has archived, and — on a completed job that left cards behind — how many it could not.\n// A job that ran out of attempts with cards left reads as `incomplete`.\nexport const AdminGetNotificationArchiveAllStatusResultSchema = z\n .object({\n state: z.enum(NOTIFICATION_ARCHIVE_ALL_JOB_STATE_KEYS),\n category: z.literal(ADMIN_NOTIFICATION_CATEGORY),\n archived: countSchema,\n notArchived: countSchema.optional(),\n error: z.string().optional(),\n })\n .strict();\nexport type AdminGetNotificationArchiveAllStatusResult = z.infer<\n typeof AdminGetNotificationArchiveAllStatusResultSchema\n>;\n"]}
@@ -3,7 +3,7 @@
3
3
  // and a `data` blob.
4
4
  import { z } from 'zod';
5
5
  import { epochMsSchema, textFieldSchema } from '../doc-schemas/atoms.js';
6
- import { ANNOUNCEMENT_MESSAGE_INPUT_FORMAT, APP_VERSION_INPUT_FORMAT, LANDING_ABOUT_TEXT_INPUT_FORMAT, LANDING_HERO_TITLE_INPUT_FORMAT, MAINTENANCE_MESSAGE_INPUT_FORMAT, } from '../input-formats/index.js';
6
+ import { ANNOUNCEMENT_MESSAGE_INPUT_FORMAT, APP_VERSION_INPUT_FORMAT, LANDING_ABOUT_TEXT_INPUT_FORMAT, LANDING_HERO_TITLE_INPUT_FORMAT, MAINTENANCE_MESSAGE_INPUT_FORMAT, } from '../input-formats/input-formats.js';
7
7
  import { AppConfigSchema } from '../doc-schemas/system.js';
8
8
  // An admin changes one or more levers on `_appConfig/app`. A lever left out keeps its value.
9
9
  export const UpdateAppConfigInputSchema = z
@@ -1 +1 @@
1
- {"version":3,"file":"app-config.js","sourceRoot":"","sources":["../../src/schemas/app-config.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,iGAAiG;AACjG,qBAAqB;AAErB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EACL,iCAAiC,EACjC,wBAAwB,EACxB,+BAA+B,EAC/B,+BAA+B,EAC/B,gCAAgC,GACjC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,6FAA6F;AAC7F,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC;KACxC,MAAM,CAAC;IACN,+FAA+F;IAC/F,UAAU,EAAE,eAAe,CAAC,wBAAwB,CAAC,CAAC,QAAQ,EAAE;IAChE,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvC,kBAAkB,EAAE,eAAe,CAAC,gCAAgC,CAAC,CAAC,QAAQ,EAAE;IAChF,mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC3C,0BAA0B;IAC1B,mBAAmB,EAAE,eAAe,CAAC,iCAAiC,CAAC,CAAC,QAAQ,EAAE;CACnF,CAAC;KACD,MAAM,EAAE;KACR,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,EAAE;IAC5E,OAAO,EAAE,8BAA8B;CACxC,CAAC,CAAC;AAGL,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC;KACzC,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC;KAC3D,MAAM,EAAE,CAAC;AAGZ,8FAA8F;AAC9F,oGAAoG;AACpG,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,SAAS,EAAE,eAAe,CAAC,+BAA+B,CAAC,CAAC,QAAQ,EAAE;IACtE,YAAY,EAAE,eAAe,CAAC,+BAA+B,CAAC,CAAC,QAAQ,EAAE;CAC1E,CAAC;KACD,MAAM,EAAE;KACR,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,EAAE;IAC5E,OAAO,EAAE,4BAA4B;CACtC,CAAC,CAAC;AAGL,oFAAoF;AACpF,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC;KAChD,MAAM,CAAC;IACN,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,SAAS,EAAE,aAAa;CACzB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the `_appConfig` documents an admin edits: the app-wide operational levers\n// and the landing page copy. Each input is a named field set (BACKEND-209) — never a document id\n// and a `data` blob.\n\nimport { z } from 'zod';\nimport { epochMsSchema, textFieldSchema } from '../doc-schemas/atoms.js';\nimport {\n ANNOUNCEMENT_MESSAGE_INPUT_FORMAT,\n APP_VERSION_INPUT_FORMAT,\n LANDING_ABOUT_TEXT_INPUT_FORMAT,\n LANDING_HERO_TITLE_INPUT_FORMAT,\n MAINTENANCE_MESSAGE_INPUT_FORMAT,\n} from '../input-formats/index.js';\nimport { AppConfigSchema } from '../doc-schemas/system.js';\n\n// An admin changes one or more levers on `_appConfig/app`. A lever left out keeps its value.\nexport const UpdateAppConfigInputSchema = z\n .object({\n // A published version is never blank: `''` is only the dormant default of a fresh environment.\n appVersion: textFieldSchema(APP_VERSION_INPUT_FORMAT).optional(),\n maintenanceMode: z.boolean().optional(),\n maintenanceMessage: textFieldSchema(MAINTENANCE_MESSAGE_INPUT_FORMAT).optional(),\n registrationEnabled: z.boolean().optional(),\n // `''` clears the banner.\n announcementMessage: textFieldSchema(ANNOUNCEMENT_MESSAGE_INPUT_FORMAT).optional(),\n })\n .strict()\n .refine((input) => Object.values(input).some((value) => value !== undefined), {\n message: 'Change at least one setting.',\n });\nexport type UpdateAppConfigInput = z.infer<typeof UpdateAppConfigInputSchema>;\n\nexport const UpdateAppConfigResultSchema = z\n .object({ updatedFields: z.array(AppConfigSchema.keyof()) })\n .strict();\nexport type UpdateAppConfigResult = z.infer<typeof UpdateAppConfigResultSchema>;\n\n// An admin edits the landing page copy on `_appConfig/landingPage`. The editor sends only the\n// fields the admin changed, so saving one never rewrites the other with what this editor last read.\n// The landing gallery is not part of this: only the picture core writes it.\nexport const AdminUpdateLandingPageInputSchema = z\n .object({\n heroTitle: textFieldSchema(LANDING_HERO_TITLE_INPUT_FORMAT).optional(),\n aboutCompany: textFieldSchema(LANDING_ABOUT_TEXT_INPUT_FORMAT).optional(),\n })\n .strict()\n .refine((input) => Object.values(input).some((value) => value !== undefined), {\n message: 'Change at least one field.',\n });\nexport type AdminUpdateLandingPageInput = z.infer<typeof AdminUpdateLandingPageInputSchema>;\n\n// The copy as committed, so the caller can apply it to its cached landing document.\nexport const AdminUpdateLandingPageResultSchema = z\n .object({\n heroTitle: z.string(),\n aboutCompany: z.string(),\n updatedAt: epochMsSchema,\n })\n .strict();\nexport type AdminUpdateLandingPageResult = z.infer<typeof AdminUpdateLandingPageResultSchema>;\n"]}
1
+ {"version":3,"file":"app-config.js","sourceRoot":"","sources":["../../src/schemas/app-config.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,iGAAiG;AACjG,qBAAqB;AAErB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EACL,iCAAiC,EACjC,wBAAwB,EACxB,+BAA+B,EAC/B,+BAA+B,EAC/B,gCAAgC,GACjC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,6FAA6F;AAC7F,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC;KACxC,MAAM,CAAC;IACN,+FAA+F;IAC/F,UAAU,EAAE,eAAe,CAAC,wBAAwB,CAAC,CAAC,QAAQ,EAAE;IAChE,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvC,kBAAkB,EAAE,eAAe,CAAC,gCAAgC,CAAC,CAAC,QAAQ,EAAE;IAChF,mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC3C,0BAA0B;IAC1B,mBAAmB,EAAE,eAAe,CAAC,iCAAiC,CAAC,CAAC,QAAQ,EAAE;CACnF,CAAC;KACD,MAAM,EAAE;KACR,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,EAAE;IAC5E,OAAO,EAAE,8BAA8B;CACxC,CAAC,CAAC;AAGL,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC;KACzC,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC;KAC3D,MAAM,EAAE,CAAC;AAGZ,8FAA8F;AAC9F,oGAAoG;AACpG,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,SAAS,EAAE,eAAe,CAAC,+BAA+B,CAAC,CAAC,QAAQ,EAAE;IACtE,YAAY,EAAE,eAAe,CAAC,+BAA+B,CAAC,CAAC,QAAQ,EAAE;CAC1E,CAAC;KACD,MAAM,EAAE;KACR,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,EAAE;IAC5E,OAAO,EAAE,4BAA4B;CACtC,CAAC,CAAC;AAGL,oFAAoF;AACpF,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC;KAChD,MAAM,CAAC;IACN,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,SAAS,EAAE,aAAa;CACzB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the `_appConfig` documents an admin edits: the app-wide operational levers\n// and the landing page copy. Each input is a named field set (BACKEND-209) — never a document id\n// and a `data` blob.\n\nimport { z } from 'zod';\nimport { epochMsSchema, textFieldSchema } from '../doc-schemas/atoms.js';\nimport {\n ANNOUNCEMENT_MESSAGE_INPUT_FORMAT,\n APP_VERSION_INPUT_FORMAT,\n LANDING_ABOUT_TEXT_INPUT_FORMAT,\n LANDING_HERO_TITLE_INPUT_FORMAT,\n MAINTENANCE_MESSAGE_INPUT_FORMAT,\n} from '../input-formats/input-formats.js';\nimport { AppConfigSchema } from '../doc-schemas/system.js';\n\n// An admin changes one or more levers on `_appConfig/app`. A lever left out keeps its value.\nexport const UpdateAppConfigInputSchema = z\n .object({\n // A published version is never blank: `''` is only the dormant default of a fresh environment.\n appVersion: textFieldSchema(APP_VERSION_INPUT_FORMAT).optional(),\n maintenanceMode: z.boolean().optional(),\n maintenanceMessage: textFieldSchema(MAINTENANCE_MESSAGE_INPUT_FORMAT).optional(),\n registrationEnabled: z.boolean().optional(),\n // `''` clears the banner.\n announcementMessage: textFieldSchema(ANNOUNCEMENT_MESSAGE_INPUT_FORMAT).optional(),\n })\n .strict()\n .refine((input) => Object.values(input).some((value) => value !== undefined), {\n message: 'Change at least one setting.',\n });\nexport type UpdateAppConfigInput = z.infer<typeof UpdateAppConfigInputSchema>;\n\nexport const UpdateAppConfigResultSchema = z\n .object({ updatedFields: z.array(AppConfigSchema.keyof()) })\n .strict();\nexport type UpdateAppConfigResult = z.infer<typeof UpdateAppConfigResultSchema>;\n\n// An admin edits the landing page copy on `_appConfig/landingPage`. The editor sends only the\n// fields the admin changed, so saving one never rewrites the other with what this editor last read.\n// The landing gallery is not part of this: only the picture core writes it.\nexport const AdminUpdateLandingPageInputSchema = z\n .object({\n heroTitle: textFieldSchema(LANDING_HERO_TITLE_INPUT_FORMAT).optional(),\n aboutCompany: textFieldSchema(LANDING_ABOUT_TEXT_INPUT_FORMAT).optional(),\n })\n .strict()\n .refine((input) => Object.values(input).some((value) => value !== undefined), {\n message: 'Change at least one field.',\n });\nexport type AdminUpdateLandingPageInput = z.infer<typeof AdminUpdateLandingPageInputSchema>;\n\n// The copy as committed, so the caller can apply it to its cached landing document.\nexport const AdminUpdateLandingPageResultSchema = z\n .object({\n heroTitle: z.string(),\n aboutCompany: z.string(),\n updatedAt: epochMsSchema,\n })\n .strict();\nexport type AdminUpdateLandingPageResult = z.infer<typeof AdminUpdateLandingPageResultSchema>;\n"]}
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- export { countSchema, epochMsSchema, gameIdSchema, gameRosterPlayerIdSchema, statEventIdSchema, leagueIdSchema, leagueModeSchema, repairReasonSchema, sportKeySchema, textFieldSchema, systemRoleSchema, teamIdSchema, teamIconSchema, teamRoleSchema, teamTypeSchema, userIdSchema, } from '../doc-schemas/atoms.js';
3
2
  export declare const actingEntrySchema: z.ZodEnum<{
4
3
  admin: "admin";
5
4
  member: "member";
@@ -1 +1 @@
1
- {"version":3,"file":"atoms.d.ts","sourceRoot":"","sources":["../../src/schemas/atoms.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,cAAc,EACd,YAAY,GACb,MAAM,yBAAyB,CAAC;AAIjC,eAAO,MAAM,iBAAiB;;;EAA8B,CAAC;AAC7D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,sBAAsB,aAA0B,CAAC;AAC9D,eAAO,MAAM,uBAAuB,aAA0B,CAAC;AAI/D,eAAO,MAAM,iBAAiB,wDAA6C,CAAC;AAC5E,eAAO,MAAM,cAAc,wDAA0C,CAAC;AAGtE,eAAO,MAAM,4BAA4B,wDAA0D,CAAC;AAEpG,eAAO,MAAM,2BAA2B,wDAAwD,CAAC;AAEjG,eAAO,MAAM,kBAAkB,wDAA8C,CAAC"}
1
+ {"version":3,"file":"atoms.d.ts","sourceRoot":"","sources":["../../src/schemas/atoms.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,iBAAiB;;;EAA8B,CAAC;AAC7D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,sBAAsB,aAA0B,CAAC;AAC9D,eAAO,MAAM,uBAAuB,aAA0B,CAAC;AAI/D,eAAO,MAAM,iBAAiB,wDAA6C,CAAC;AAC5E,eAAO,MAAM,cAAc,wDAA0C,CAAC;AAGtE,eAAO,MAAM,4BAA4B,wDAA0D,CAAC;AAEpG,eAAO,MAAM,2BAA2B,wDAAwD,CAAC;AAEjG,eAAO,MAAM,kBAAkB,wDAA8C,CAAC"}
@@ -1,10 +1,8 @@
1
- // Atoms for callable wire contracts. Enums, id atoms, the count, and the repair reason are the
2
- // document atoms — one declaration, re-exported here so a callable schema file imports its atoms from
3
- // one place.
1
+ // Atoms only callable wire contracts use. Enums, id atoms, the count, and the repair reason are the
2
+ // document atoms, declared once in doc-schemas/atoms.ts and imported from there.
4
3
  import { z } from 'zod';
5
- import { CONTACT_PHONE_INPUT_FORMAT, DISPLAY_NAME_INPUT_FORMAT, TEAM_INVITATION_MESSAGE_INPUT_FORMAT, TEAM_JOIN_REQUEST_MESSAGE_INPUT_FORMAT, TEAM_NAME_INPUT_FORMAT, } from '../input-formats/index.js';
4
+ import { CONTACT_PHONE_INPUT_FORMAT, DISPLAY_NAME_INPUT_FORMAT, TEAM_INVITATION_MESSAGE_INPUT_FORMAT, TEAM_JOIN_REQUEST_MESSAGE_INPUT_FORMAT, TEAM_NAME_INPUT_FORMAT, } from '../input-formats/input-formats.js';
6
5
  import { documentIdSegmentSchema, textFieldSchema } from '../doc-schemas/atoms.js';
7
- export { countSchema, epochMsSchema, gameIdSchema, gameRosterPlayerIdSchema, statEventIdSchema, leagueIdSchema, leagueModeSchema, repairReasonSchema, sportKeySchema, textFieldSchema, systemRoleSchema, teamIdSchema, teamIconSchema, teamRoleSchema, teamTypeSchema, userIdSchema, } from '../doc-schemas/atoms.js';
8
6
  // Which entry of a member/admin twin pair of callables an action calls: the member entry, which
9
7
  // re-reads the caller's team membership, or the admin entry, which re-reads the role roster.
10
8
  export const actingEntrySchema = z.enum(['member', 'admin']);
@@ -1 +1 @@
1
- {"version":3,"file":"atoms.js","sourceRoot":"","sources":["../../src/schemas/atoms.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,sGAAsG;AACtG,aAAa;AAEb,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,oCAAoC,EACpC,sCAAsC,EACtC,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEnF,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,cAAc,EACd,YAAY,GACb,MAAM,yBAAyB,CAAC;AAEjC,gGAAgG;AAChG,6FAA6F;AAC7F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAG7D,MAAM,CAAC,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,uBAAuB,CAAC;AAE/D,mGAAmG;AACnG,2BAA2B;AAC3B,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,yBAAyB,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAC,sBAAsB,CAAC,CAAC;AACtE,kGAAkG;AAClG,+BAA+B;AAC/B,MAAM,CAAC,MAAM,4BAA4B,GAAG,eAAe,CAAC,sCAAsC,CAAC,CAAC;AACpG,+FAA+F;AAC/F,MAAM,CAAC,MAAM,2BAA2B,GAAG,eAAe,CAAC,oCAAoC,CAAC,CAAC;AACjG,kEAAkE;AAClE,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC,0BAA0B,CAAC,CAAC","sourcesContent":["// Atoms for callable wire contracts. Enums, id atoms, the count, and the repair reason are the\n// document atoms — one declaration, re-exported here so a callable schema file imports its atoms from\n// one place.\n\nimport { z } from 'zod';\nimport {\n CONTACT_PHONE_INPUT_FORMAT,\n DISPLAY_NAME_INPUT_FORMAT,\n TEAM_INVITATION_MESSAGE_INPUT_FORMAT,\n TEAM_JOIN_REQUEST_MESSAGE_INPUT_FORMAT,\n TEAM_NAME_INPUT_FORMAT,\n} from '../input-formats/index.js';\n\nimport { documentIdSegmentSchema, textFieldSchema } from '../doc-schemas/atoms.js';\n\nexport {\n countSchema,\n epochMsSchema,\n gameIdSchema,\n gameRosterPlayerIdSchema,\n statEventIdSchema,\n leagueIdSchema,\n leagueModeSchema,\n repairReasonSchema,\n sportKeySchema,\n textFieldSchema,\n systemRoleSchema,\n teamIdSchema,\n teamIconSchema,\n teamRoleSchema,\n teamTypeSchema,\n userIdSchema,\n} from '../doc-schemas/atoms.js';\n\n// Which entry of a member/admin twin pair of callables an action calls: the member entry, which\n// re-reads the caller's team membership, or the admin entry, which re-reads the role roster.\nexport const actingEntrySchema = z.enum(['member', 'admin']);\nexport type ActingEntry = z.infer<typeof actingEntrySchema>;\n\nexport const teamInvitationIdSchema = documentIdSegmentSchema;\nexport const teamJoinRequestIdSchema = documentIdSegmentSchema;\n\n// A display name and a team name, each built from its field's one declaration, so the form and the\n// wire run the same check.\nexport const displayNameSchema = textFieldSchema(DISPLAY_NAME_INPUT_FORMAT);\nexport const teamNameSchema = textFieldSchema(TEAM_NAME_INPUT_FORMAT);\n// A player's message with a join request, built from the field's one declaration, so the form and\n// the wire run the same check.\nexport const teamJoinRequestMessageSchema = textFieldSchema(TEAM_JOIN_REQUEST_MESSAGE_INPUT_FORMAT);\n// A captain's note on an invitation is optional — an empty note is stored as the empty string.\nexport const teamInvitationMessageSchema = textFieldSchema(TEAM_INVITATION_MESSAGE_INPUT_FORMAT);\n// A team's contact phone, built from its field's one declaration.\nexport const contactPhoneSchema = textFieldSchema(CONTACT_PHONE_INPUT_FORMAT);\n"]}
1
+ {"version":3,"file":"atoms.js","sourceRoot":"","sources":["../../src/schemas/atoms.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,iFAAiF;AAEjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,oCAAoC,EACpC,sCAAsC,EACtC,sBAAsB,GACvB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEnF,gGAAgG;AAChG,6FAA6F;AAC7F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAG7D,MAAM,CAAC,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,uBAAuB,CAAC;AAE/D,mGAAmG;AACnG,2BAA2B;AAC3B,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,yBAAyB,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAC,sBAAsB,CAAC,CAAC;AACtE,kGAAkG;AAClG,+BAA+B;AAC/B,MAAM,CAAC,MAAM,4BAA4B,GAAG,eAAe,CAAC,sCAAsC,CAAC,CAAC;AACpG,+FAA+F;AAC/F,MAAM,CAAC,MAAM,2BAA2B,GAAG,eAAe,CAAC,oCAAoC,CAAC,CAAC;AACjG,kEAAkE;AAClE,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC,0BAA0B,CAAC,CAAC","sourcesContent":["// Atoms only callable wire contracts use. Enums, id atoms, the count, and the repair reason are the\n// document atoms, declared once in doc-schemas/atoms.ts and imported from there.\n\nimport { z } from 'zod';\nimport {\n CONTACT_PHONE_INPUT_FORMAT,\n DISPLAY_NAME_INPUT_FORMAT,\n TEAM_INVITATION_MESSAGE_INPUT_FORMAT,\n TEAM_JOIN_REQUEST_MESSAGE_INPUT_FORMAT,\n TEAM_NAME_INPUT_FORMAT,\n} from '../input-formats/input-formats.js';\n\nimport { documentIdSegmentSchema, textFieldSchema } from '../doc-schemas/atoms.js';\n\n// Which entry of a member/admin twin pair of callables an action calls: the member entry, which\n// re-reads the caller's team membership, or the admin entry, which re-reads the role roster.\nexport const actingEntrySchema = z.enum(['member', 'admin']);\nexport type ActingEntry = z.infer<typeof actingEntrySchema>;\n\nexport const teamInvitationIdSchema = documentIdSegmentSchema;\nexport const teamJoinRequestIdSchema = documentIdSegmentSchema;\n\n// A display name and a team name, each built from its field's one declaration, so the form and the\n// wire run the same check.\nexport const displayNameSchema = textFieldSchema(DISPLAY_NAME_INPUT_FORMAT);\nexport const teamNameSchema = textFieldSchema(TEAM_NAME_INPUT_FORMAT);\n// A player's message with a join request, built from the field's one declaration, so the form and\n// the wire run the same check.\nexport const teamJoinRequestMessageSchema = textFieldSchema(TEAM_JOIN_REQUEST_MESSAGE_INPUT_FORMAT);\n// A captain's note on an invitation is optional — an empty note is stored as the empty string.\nexport const teamInvitationMessageSchema = textFieldSchema(TEAM_INVITATION_MESSAGE_INPUT_FORMAT);\n// A team's contact phone, built from its field's one declaration.\nexport const contactPhoneSchema = textFieldSchema(CONTACT_PHONE_INPUT_FORMAT);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"awards.d.ts","sourceRoot":"","sources":["../../src/schemas/awards.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,iCAAiC;;;;kBAc3C,CAAC;AACJ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F,eAAO,MAAM,oBAAo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AAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAIpF,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;kBAMxC,CAAC;AACZ,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,sCAAsC,CAC9C,CAAC;AAGF,eAAO,MAAM,wCAAwC;;;;;;;;;kBAE1C,CAAC;AACZ,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,wCAAwC,CAChD,CAAC;AACF,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;kBAE3C,CAAC;AACZ,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,yCAAyC,CACjD,CAAC;AAGF,eAAO,MAAM,qCAAqC;;kBAAgD,CAAC;AACnG,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAGpG,eAAO,MAAM,sCAAsC;;;kBAExC,CAAC;AACZ,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,sCAAsC,CAC9C,CAAC;AAOF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;8BAM1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,eAAO,MAAM,gCAAgC;;;;;kBAOlC,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
@@ -7,10 +7,9 @@
7
7
  import { z } from 'zod';
8
8
  import { MAX_AWARD_GRANT_TARGETS } from '../constants/business.js';
9
9
  import { awardGroupGrantActionSchema, awardGroupGrantDecisionSchema, awardGroupGrantStatusSchema, awardGroupTypeSchema, } from '../doc-schemas/award-group-grant.js';
10
- import { countSchema, documentIdSegmentSchema, epochMsSchema } from '../doc-schemas/atoms.js';
10
+ import { countSchema, documentIdSegmentSchema, epochMsSchema, userIdSchema, } from '../doc-schemas/atoms.js';
11
11
  import { awardIdSchema } from '../doc-schemas/catalogs.js';
12
12
  import { AWARD_GRANT_SKIP_REASON_KEYS, FEATURED_AWARD_SLOT_KEYS } from '../types/unions.js';
13
- import { userIdSchema } from './atoms.js';
14
13
  const targetList = (atom) => z.array(atom).max(MAX_AWARD_GRANT_TARGETS).optional();
15
14
  // An admin grants an award to named accounts and revokes it from named accounts, in one commit.
16
15
  // Recipients are deduplicated on the server; a ghost holds no account and is skipped.
@@ -22,7 +21,10 @@ export const AdminUpdateAwardGrantsInputSchema = z
22
21
  })
23
22
  .strict()
24
23
  .refine((input) => [input.grantUserIds, input.revokeUserIds].some((list) => list !== undefined && list.length > 0), { message: 'Name someone to grant the award to or revoke it from.' })
25
- .refine((input) => !(input.grantUserIds ?? []).some((userId) => (input.revokeUserIds ?? []).includes(userId)), { message: 'An account cannot be granted and revoked the award in one change.', path: ['revokeUserIds'] });
24
+ .refine((input) => !(input.grantUserIds ?? []).some((userId) => (input.revokeUserIds ?? []).includes(userId)), {
25
+ message: 'An account cannot be granted and revoked the award in one change.',
26
+ path: ['revokeUserIds'],
27
+ });
26
28
  export const AwardGrantSkipSchema = z
27
29
  .object({ userId: userIdSchema, reason: z.enum(AWARD_GRANT_SKIP_REASON_KEYS) })
28
30
  .strict();
@@ -70,7 +72,11 @@ export const AwardGroupGrantProgressSchema = z
70
72
  // `opened` is false when the group's latest decision already settled the request; `grant` is then that
71
73
  // decision, or null when the group has none.
72
74
  export const AdminUpdateAwardGroupGrantResultSchema = z
73
- .object({ awardId: awardIdSchema, opened: z.boolean(), grant: AwardGroupGrantProgressSchema.nullable() })
75
+ .object({
76
+ awardId: awardIdSchema,
77
+ opened: z.boolean(),
78
+ grant: AwardGroupGrantProgressSchema.nullable(),
79
+ })
74
80
  .strict();
75
81
  // An admin reads the latest decision on an award for a group, so the progress survives a closed page.
76
82
  export const AdminGetAwardGroupGrantStatusInputSchema = z
@@ -91,7 +97,9 @@ export const AdminDeleteAwardDefinitionResultSchema = z
91
97
  // change to one slot never writes back a stale value of the other. No user id is ever sent.
92
98
  const featuredAwardSlotSchema = z.enum(FEATURED_AWARD_SLOT_KEYS);
93
99
  export const UpdateFeaturedAwardsInputSchema = z.discriminatedUnion('action', [
94
- z.object({ action: z.literal('set'), slot: featuredAwardSlotSchema, awardId: awardIdSchema }).strict(),
100
+ z
101
+ .object({ action: z.literal('set'), slot: featuredAwardSlotSchema, awardId: awardIdSchema })
102
+ .strict(),
95
103
  z.object({ action: z.literal('clear'), slot: featuredAwardSlotSchema }).strict(),
96
104
  z.object({ action: z.literal('swap') }).strict(),
97
105
  ]);
@@ -1 +1 @@
1
- {"version":3,"file":"awards.js","sourceRoot":"","sources":["../../src/schemas/awards.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,EAAE;AACF,oGAAoG;AACpG,iGAAiG;AACjG,mGAAmG;AACnG,8EAA8E;AAE9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,2BAA2B,EAC3B,oBAAoB,GACrB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,UAAU,GAAG,CAAyB,IAAO,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE,CA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AAM,EAAE;IAChF,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;CACjD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,MAAM,EAAE,YAAY;IACpB,cAAc,EAAE,aAAa,CAAC,QAAQ,EAAE;IACxC,gBAAgB,EAAE,aAAa,CAAC,QAAQ,EAAE;IAC1C,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the award catalog, award grants, and the badges an account features.\n//\n// An award is created by its first badge's publication (the `award-badge` upload, ./uploads.ts), so\n// no callable here creates one. Grants and revokes to named accounts share one input — two named\n// lists, never an action discriminator (BACKEND-002) — like the role roster's. A team's or a whole\n// league's grant is its own decision, carried out a page of people at a time.\n\nimport { z } from 'zod';\nimport { MAX_AWARD_GRANT_TARGETS } from '../constants/business.js';\nimport {\n awardGroupGrantActionSchema,\n awardGroupGrantDecisionSchema,\n awardGroupGrantStatusSchema,\n awardGroupTypeSchema,\n} from '../doc-schemas/award-group-grant.js';\nimport { countSchema, documentIdSegmentSchema, epochMsSchema } from '../doc-schemas/atoms.js';\nimport { awardIdSchema } from '../doc-schemas/catalogs.js';\nimport { AWARD_GRANT_SKIP_REASON_KEYS, FEATURED_AWARD_SLOT_KEYS } from '../types/unions.js';\nimport { userIdSchema } from './atoms.js';\n\nconst targetList = <T extends z.ZodTypeAny>(atom: T) => z.array(atom).max(MAX_AWARD_GRANT_TARGETS).optional();\n\n// An admin grants an award to named accounts and revokes it from named accounts, in one commit.\n// Recipients are deduplicated on the server; a ghost holds no account and is skipped.\nexport const AdminUpdateAwardGrantsInputSchema = z\n .object({\n awardId: awardIdSchema,\n grantUserIds: targetList(userIdSchema),\n revokeUserIds: targetList(userIdSchema),\n })\n .strict()\n .refine(\n (input) => [input.grantUserIds, input.revokeUserIds].some((list) => list !== undefined && list.length > 0),\n { message: 'Name someone to grant the award to or revoke it from.' },\n )\n .refine(\n (input) => !(input.grantUserIds ?? []).some((userId) => (input.revokeUserIds ?? []).includes(userId)),\n { message: 'An account cannot be granted and revoked the award in one change.', path: ['revokeUserIds'] },\n );\nexport type AdminUpdateAwardGrantsInput = z.infer<typeof AdminUpdateAwardGrantsInputSchema>;\n\nexport const AwardGrantSkipSchema = z\n .object({ userId: userIdSchema, reason: z.enum(AWARD_GRANT_SKIP_REASON_KEYS) })\n .strict();\nexport type AwardGrantSkip = z.infer<typeof AwardGrantSkipSchema>;\n\n// What the change did for each account it reached: granted now, already held, revoked now, not held\n// to begin with, or skipped with its reason. A retried call reports the accounts its first call\n// changed as already held or not held, and writes nothing again.\nexport const AdminUpdateAwardGrantsResultSchema = z\n .object({\n awardId: awardIdSchema,\n granted: z.array(userIdSchema),\n alreadyHeld: z.array(userIdSchema),\n revoked: z.array(userIdSchema),\n notHeld: z.array(userIdSchema),\n skipped: z.array(AwardGrantSkipSchema),\n })\n .strict();\nexport type AdminUpdateAwardGrantsResult = z.infer<typeof AdminUpdateAwardGrantsResultSchema>;\n\n// The group a group grant reaches: every active member of one team, or of one whole league.\n// `groupId` is that team's or league's id.\nexport const AwardGroupSchema = z\n .object({ groupType: awardGroupTypeSchema, groupId: documentIdSegmentSchema })\n .strict();\nexport type AwardGroup = z.infer<typeof AwardGroupSchema>;\n\n// An admin grants an award to a group, or takes back what the group's grants gave. The decision opens\n// at once and its people are reached a page at a time after the answer; a request the group's latest\n// decision already settles (granting what is granted, taking back what is not) opens nothing.\nexport const AdminUpdateAwardGroupGrantInputSchema = z\n .object({ awardId: awardIdSchema, action: awardGroupGrantActionSchema, group: AwardGroupSchema })\n .strict();\nexport type AdminUpdateAwardGroupGrantInput = z.infer<typeof AdminUpdateAwardGroupGrantInputSchema>;\n\n// Where one decision on an award for a group stands. `peopleReached` is how many people it has dealt\n// with so far: a grant's recorded people, or the people a revoke has taken the award back from or left\n// holding it. A pending decision that failed carries its failure and how many times it has tried; the\n// scheduled resume tries it again.\nexport const AwardGroupGrantProgressSchema = z\n .object({\n grantId: z.string().min(1),\n action: awardGroupGrantActionSchema,\n decision: awardGroupGrantDecisionSchema,\n status: awardGroupGrantStatusSchema,\n peopleReached: countSchema,\n attemptCount: countSchema,\n lastError: z.string().nullable(),\n createdAt: epochMsSchema,\n completedAt: epochMsSchema.nullable(),\n })\n .strict();\nexport type AwardGroupGrantProgress = z.infer<typeof AwardGroupGrantProgressSchema>;\n\n// `opened` is false when the group's latest decision already settled the request; `grant` is then that\n// decision, or null when the group has none.\nexport const AdminUpdateAwardGroupGrantResultSchema = z\n .object({ awardId: awardIdSchema, opened: z.boolean(), grant: AwardGroupGrantProgressSchema.nullable() })\n .strict();\nexport type AdminUpdateAwardGroupGrantResult = z.infer<typeof AdminUpdateAwardGroupGrantResultSchema>;\n\n// An admin reads the latest decision on an award for a group, so the progress survives a closed page.\nexport const AdminGetAwardGroupGrantStatusInputSchema = z\n .object({ awardId: awardIdSchema, group: AwardGroupSchema })\n .strict();\nexport type AdminGetAwardGroupGrantStatusInput = z.infer<typeof AdminGetAwardGroupGrantStatusInputSchema>;\nexport const AdminGetAwardGroupGrantStatusResultSchema = z\n .object({ grant: AwardGroupGrantProgressSchema.nullable() })\n .strict();\nexport type AdminGetAwardGroupGrantStatusResult = z.infer<typeof AdminGetAwardGroupGrantStatusResultSchema>;\n\n// An admin deletes an award nobody holds. Its badge's files are retired with it.\nexport const AdminDeleteAwardDefinitionInputSchema = z.object({ awardId: awardIdSchema }).strict();\nexport type AdminDeleteAwardDefinitionInput = z.infer<typeof AdminDeleteAwardDefinitionInputSchema>;\n\n// `deleted` is false when the award was already gone: nothing was written.\nexport const AdminDeleteAwardDefinitionResultSchema = z\n .object({ awardId: awardIdSchema, deleted: z.boolean() })\n .strict();\nexport type AdminDeleteAwardDefinitionResult = z.infer<typeof AdminDeleteAwardDefinitionResultSchema>;\n\n// The signed-in account chooses which of its own awards to show beside its name: a primary and a\n// secondary badge, each an award it holds, or none. The input is the one change the person made —\n// set a slot, clear a slot, or swap the two — and the core applies it to the pair as stored, so a\n// change to one slot never writes back a stale value of the other. No user id is ever sent.\nconst featuredAwardSlotSchema = z.enum(FEATURED_AWARD_SLOT_KEYS);\nexport const UpdateFeaturedAwardsInputSchema = z.discriminatedUnion('action', [\n z.object({ action: z.literal('set'), slot: featuredAwardSlotSchema, awardId: awardIdSchema }).strict(),\n z.object({ action: z.literal('clear'), slot: featuredAwardSlotSchema }).strict(),\n z.object({ action: z.literal('swap') }).strict(),\n]);\nexport type UpdateFeaturedAwardsInput = z.infer<typeof UpdateFeaturedAwardsInputSchema>;\n\nexport const UpdateFeaturedAwardsResultSchema = z\n .object({\n userId: userIdSchema,\n primaryAwardId: awardIdSchema.nullable(),\n secondaryAwardId: awardIdSchema.nullable(),\n changed: z.boolean(),\n })\n .strict();\nexport type UpdateFeaturedAwardsResult = z.infer<typeof UpdateFeaturedAwardsResultSchema>;\n"]}
1
+ {"version":3,"file":"awards.js","sourceRoot":"","sources":["../../src/schemas/awards.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,EAAE;AACF,oGAAoG;AACpG,iGAAiG;AACjG,mGAAmG;AACnG,8EAA8E;AAE9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,2BAA2B,EAC3B,oBAAoB,GACrB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,aAAa,EACb,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE5F,MAAM,UAAU,GAA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C,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE;IAChF,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;CACjD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,MAAM,EAAE,YAAY;IACpB,cAAc,EAAE,aAAa,CAAC,QAAQ,EAAE;IACxC,gBAAgB,EAAE,aAAa,CAAC,QAAQ,EAAE;IAC1C,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the award catalog, award grants, and the badges an account features.\n//\n// An award is created by its first badge's publication (the `award-badge` upload, ./uploads.ts), so\n// no callable here creates one. Grants and revokes to named accounts share one input — two named\n// lists, never an action discriminator (BACKEND-002) — like the role roster's. A team's or a whole\n// league's grant is its own decision, carried out a page of people at a time.\n\nimport { z } from 'zod';\nimport { MAX_AWARD_GRANT_TARGETS } from '../constants/business.js';\nimport {\n awardGroupGrantActionSchema,\n awardGroupGrantDecisionSchema,\n awardGroupGrantStatusSchema,\n awardGroupTypeSchema,\n} from '../doc-schemas/award-group-grant.js';\nimport {\n countSchema,\n documentIdSegmentSchema,\n epochMsSchema,\n userIdSchema,\n} from '../doc-schemas/atoms.js';\nimport { awardIdSchema } from '../doc-schemas/catalogs.js';\nimport { AWARD_GRANT_SKIP_REASON_KEYS, FEATURED_AWARD_SLOT_KEYS } from '../types/unions.js';\n\nconst targetList = <T extends z.ZodTypeAny>(atom: T) =>\n z.array(atom).max(MAX_AWARD_GRANT_TARGETS).optional();\n\n// An admin grants an award to named accounts and revokes it from named accounts, in one commit.\n// Recipients are deduplicated on the server; a ghost holds no account and is skipped.\nexport const AdminUpdateAwardGrantsInputSchema = z\n .object({\n awardId: awardIdSchema,\n grantUserIds: targetList(userIdSchema),\n revokeUserIds: targetList(userIdSchema),\n })\n .strict()\n .refine(\n (input) =>\n [input.grantUserIds, input.revokeUserIds].some(\n (list) => list !== undefined && list.length > 0,\n ),\n { message: 'Name someone to grant the award to or revoke it from.' },\n )\n .refine(\n (input) =>\n !(input.grantUserIds ?? []).some((userId) => (input.revokeUserIds ?? []).includes(userId)),\n {\n message: 'An account cannot be granted and revoked the award in one change.',\n path: ['revokeUserIds'],\n },\n );\nexport type AdminUpdateAwardGrantsInput = z.infer<typeof AdminUpdateAwardGrantsInputSchema>;\n\nexport const AwardGrantSkipSchema = z\n .object({ userId: userIdSchema, reason: z.enum(AWARD_GRANT_SKIP_REASON_KEYS) })\n .strict();\nexport type AwardGrantSkip = z.infer<typeof AwardGrantSkipSchema>;\n\n// What the change did for each account it reached: granted now, already held, revoked now, not held\n// to begin with, or skipped with its reason. A retried call reports the accounts its first call\n// changed as already held or not held, and writes nothing again.\nexport const AdminUpdateAwardGrantsResultSchema = z\n .object({\n awardId: awardIdSchema,\n granted: z.array(userIdSchema),\n alreadyHeld: z.array(userIdSchema),\n revoked: z.array(userIdSchema),\n notHeld: z.array(userIdSchema),\n skipped: z.array(AwardGrantSkipSchema),\n })\n .strict();\nexport type AdminUpdateAwardGrantsResult = z.infer<typeof AdminUpdateAwardGrantsResultSchema>;\n\n// The group a group grant reaches: every active member of one team, or of one whole league.\n// `groupId` is that team's or league's id.\nexport const AwardGroupSchema = z\n .object({ groupType: awardGroupTypeSchema, groupId: documentIdSegmentSchema })\n .strict();\nexport type AwardGroup = z.infer<typeof AwardGroupSchema>;\n\n// An admin grants an award to a group, or takes back what the group's grants gave. The decision opens\n// at once and its people are reached a page at a time after the answer; a request the group's latest\n// decision already settles (granting what is granted, taking back what is not) opens nothing.\nexport const AdminUpdateAwardGroupGrantInputSchema = z\n .object({ awardId: awardIdSchema, action: awardGroupGrantActionSchema, group: AwardGroupSchema })\n .strict();\nexport type AdminUpdateAwardGroupGrantInput = z.infer<typeof AdminUpdateAwardGroupGrantInputSchema>;\n\n// Where one decision on an award for a group stands. `peopleReached` is how many people it has dealt\n// with so far: a grant's recorded people, or the people a revoke has taken the award back from or left\n// holding it. A pending decision that failed carries its failure and how many times it has tried; the\n// scheduled resume tries it again.\nexport const AwardGroupGrantProgressSchema = z\n .object({\n grantId: z.string().min(1),\n action: awardGroupGrantActionSchema,\n decision: awardGroupGrantDecisionSchema,\n status: awardGroupGrantStatusSchema,\n peopleReached: countSchema,\n attemptCount: countSchema,\n lastError: z.string().nullable(),\n createdAt: epochMsSchema,\n completedAt: epochMsSchema.nullable(),\n })\n .strict();\nexport type AwardGroupGrantProgress = z.infer<typeof AwardGroupGrantProgressSchema>;\n\n// `opened` is false when the group's latest decision already settled the request; `grant` is then that\n// decision, or null when the group has none.\nexport const AdminUpdateAwardGroupGrantResultSchema = z\n .object({\n awardId: awardIdSchema,\n opened: z.boolean(),\n grant: AwardGroupGrantProgressSchema.nullable(),\n })\n .strict();\nexport type AdminUpdateAwardGroupGrantResult = z.infer<\n typeof AdminUpdateAwardGroupGrantResultSchema\n>;\n\n// An admin reads the latest decision on an award for a group, so the progress survives a closed page.\nexport const AdminGetAwardGroupGrantStatusInputSchema = z\n .object({ awardId: awardIdSchema, group: AwardGroupSchema })\n .strict();\nexport type AdminGetAwardGroupGrantStatusInput = z.infer<\n typeof AdminGetAwardGroupGrantStatusInputSchema\n>;\nexport const AdminGetAwardGroupGrantStatusResultSchema = z\n .object({ grant: AwardGroupGrantProgressSchema.nullable() })\n .strict();\nexport type AdminGetAwardGroupGrantStatusResult = z.infer<\n typeof AdminGetAwardGroupGrantStatusResultSchema\n>;\n\n// An admin deletes an award nobody holds. Its badge's files are retired with it.\nexport const AdminDeleteAwardDefinitionInputSchema = z.object({ awardId: awardIdSchema }).strict();\nexport type AdminDeleteAwardDefinitionInput = z.infer<typeof AdminDeleteAwardDefinitionInputSchema>;\n\n// `deleted` is false when the award was already gone: nothing was written.\nexport const AdminDeleteAwardDefinitionResultSchema = z\n .object({ awardId: awardIdSchema, deleted: z.boolean() })\n .strict();\nexport type AdminDeleteAwardDefinitionResult = z.infer<\n typeof AdminDeleteAwardDefinitionResultSchema\n>;\n\n// The signed-in account chooses which of its own awards to show beside its name: a primary and a\n// secondary badge, each an award it holds, or none. The input is the one change the person made —\n// set a slot, clear a slot, or swap the two — and the core applies it to the pair as stored, so a\n// change to one slot never writes back a stale value of the other. No user id is ever sent.\nconst featuredAwardSlotSchema = z.enum(FEATURED_AWARD_SLOT_KEYS);\nexport const UpdateFeaturedAwardsInputSchema = z.discriminatedUnion('action', [\n z\n .object({ action: z.literal('set'), slot: featuredAwardSlotSchema, awardId: awardIdSchema })\n .strict(),\n z.object({ action: z.literal('clear'), slot: featuredAwardSlotSchema }).strict(),\n z.object({ action: z.literal('swap') }).strict(),\n]);\nexport type UpdateFeaturedAwardsInput = z.infer<typeof UpdateFeaturedAwardsInputSchema>;\n\nexport const UpdateFeaturedAwardsResultSchema = z\n .object({\n userId: userIdSchema,\n primaryAwardId: awardIdSchema.nullable(),\n secondaryAwardId: awardIdSchema.nullable(),\n changed: z.boolean(),\n })\n .strict();\nexport type UpdateFeaturedAwardsResult = z.infer<typeof UpdateFeaturedAwardsResultSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dead-letters.d.ts","sourceRoot":"","sources":["../../src/schemas/dead-letters.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,oDAAoD;AACpD,eAAO,MAAM,2BAA2B,qCAAsC,CAAC;AAC/E,eAAO,MAAM,0BAA0B;;EAAsC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,gFAAgF;AAChF,eAAO,MAAM,6BAA6B,EAAE;IAAE,QAAQ,EAAE,CAAC,IAAI,oBAAo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G3C,eAAO,MAAM,yBAAyB;;;;;oBAM1B,CAAC;AACb,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAI5E,eAAO,MAAM,mBAAmB;;;;;;;;kBAQrB,CAAC;AACZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAGhE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;kBAM5B,CAAC;AACZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAG9E,eAAO,MAAM,gCAAgC;;;;;;;kBAOlC,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAI1F,eAAO,MAAM,iCAAiC;;;;;;;;;;kBAUnC,CAAC;AACZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC"}
@@ -4,8 +4,7 @@
4
4
  // and a row id, never a Firestore path: the backend's lane registry derives the document from them
5
5
  // (ARCH-106).
6
6
  import { z } from 'zod';
7
- import { countSchema, documentIdSegmentSchema, epochMsSchema } from '../doc-schemas/atoms.js';
8
- import { repairReasonSchema } from './atoms.js';
7
+ import { countSchema, documentIdSegmentSchema, epochMsSchema, repairReasonSchema, } from '../doc-schemas/atoms.js';
9
8
  /** Every ledger the dead-letter replay supports. */
10
9
  export const DEAD_LETTER_COLLECTION_KEYS = ['notificationDeliveries'];
11
10
  export const DeadLetterCollectionSchema = z.enum(DEAD_LETTER_COLLECTION_KEYS);
@@ -36,7 +35,11 @@ export const DeadLetterRowSchema = z
36
35
  .strict();
37
36
  // `truncated` is true when any lane hit the row cap: more parked rows exist than shown.
38
37
  export const GetDeadLettersResultSchema = z
39
- .object({ generatedAt: epochMsSchema, rows: z.array(DeadLetterRowSchema), truncated: z.boolean() })
38
+ .object({
39
+ generatedAt: epochMsSchema,
40
+ rows: z.array(DeadLetterRowSchema),
41
+ truncated: z.boolean(),
42
+ })
40
43
  .strict();
41
44
  // `dryRun` inspects the row — its status, and what a replay would reset it to — and writes nothing.
42
45
  export const AdminReplayDeadLetterInputSchema = z