@ttt-productions/q-core 0.1.1 → 0.1.3

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 (135) hide show
  1. package/dist/constants/business.d.ts +12 -0
  2. package/dist/constants/business.d.ts.map +1 -1
  3. package/dist/constants/business.js +24 -0
  4. package/dist/constants/business.js.map +1 -1
  5. package/dist/constants/media.d.ts +1 -0
  6. package/dist/constants/media.d.ts.map +1 -1
  7. package/dist/constants/media.js +5 -0
  8. package/dist/constants/media.js.map +1 -1
  9. package/dist/doc-schemas/admin-notifications.d.ts +1 -0
  10. package/dist/doc-schemas/admin-notifications.d.ts.map +1 -1
  11. package/dist/doc-schemas/admin-notifications.js +4 -0
  12. package/dist/doc-schemas/admin-notifications.js.map +1 -1
  13. package/dist/doc-schemas/atoms.d.ts +2 -0
  14. package/dist/doc-schemas/atoms.d.ts.map +1 -1
  15. package/dist/doc-schemas/audit-event.d.ts +2 -0
  16. package/dist/doc-schemas/audit-event.d.ts.map +1 -1
  17. package/dist/doc-schemas/gallery.d.ts +1 -0
  18. package/dist/doc-schemas/gallery.d.ts.map +1 -1
  19. package/dist/doc-schemas/gallery.js +3 -0
  20. package/dist/doc-schemas/gallery.js.map +1 -1
  21. package/dist/doc-schemas/migration-console.d.ts +2 -0
  22. package/dist/doc-schemas/migration-console.d.ts.map +1 -1
  23. package/dist/doc-schemas/migration-console.js +5 -0
  24. package/dist/doc-schemas/migration-console.js.map +1 -1
  25. package/dist/doc-schemas/pending-media.d.ts +1 -0
  26. package/dist/doc-schemas/pending-media.d.ts.map +1 -1
  27. package/dist/doc-schemas/pending-media.js +8 -0
  28. package/dist/doc-schemas/pending-media.js.map +1 -1
  29. package/dist/doc-schemas/registry.d.ts +12 -0
  30. package/dist/doc-schemas/registry.d.ts.map +1 -1
  31. package/dist/doc-schemas/stats-operation.d.ts.map +1 -1
  32. package/dist/doc-schemas/stats-operation.js +6 -11
  33. package/dist/doc-schemas/stats-operation.js.map +1 -1
  34. package/dist/doc-schemas/system.d.ts +7 -0
  35. package/dist/doc-schemas/system.d.ts.map +1 -1
  36. package/dist/doc-schemas/system.js +4 -1
  37. package/dist/doc-schemas/system.js.map +1 -1
  38. package/dist/doc-schemas/user-profile.d.ts +1 -0
  39. package/dist/doc-schemas/user-profile.d.ts.map +1 -1
  40. package/dist/doc-schemas/user-profile.js +5 -0
  41. package/dist/doc-schemas/user-profile.js.map +1 -1
  42. package/dist/doc-schemas/waiver-template.d.ts +1 -0
  43. package/dist/doc-schemas/waiver-template.d.ts.map +1 -1
  44. package/dist/doc-schemas/waiver-template.js +10 -1
  45. package/dist/doc-schemas/waiver-template.js.map +1 -1
  46. package/dist/doc-schemas/waivers-and-hardware.d.ts +1 -0
  47. package/dist/doc-schemas/waivers-and-hardware.d.ts.map +1 -1
  48. package/dist/doc-schemas/waivers-and-hardware.js +17 -9
  49. package/dist/doc-schemas/waivers-and-hardware.js.map +1 -1
  50. package/dist/ids/minted-ids.d.ts +1 -0
  51. package/dist/ids/minted-ids.d.ts.map +1 -1
  52. package/dist/ids/minted-ids.js +6 -0
  53. package/dist/ids/minted-ids.js.map +1 -1
  54. package/dist/input-formats/index.d.ts +2 -2
  55. package/dist/input-formats/index.d.ts.map +1 -1
  56. package/dist/input-formats/index.js +2 -2
  57. package/dist/input-formats/index.js.map +1 -1
  58. package/dist/migration-console/manifest.d.ts.map +1 -1
  59. package/dist/migration-console/manifest.js +11 -10
  60. package/dist/migration-console/manifest.js.map +1 -1
  61. package/dist/notifications/archive-all.d.ts +2 -0
  62. package/dist/notifications/archive-all.d.ts.map +1 -0
  63. package/dist/notifications/archive-all.js +6 -0
  64. package/dist/notifications/archive-all.js.map +1 -0
  65. package/dist/notifications/index.d.ts +1 -0
  66. package/dist/notifications/index.d.ts.map +1 -1
  67. package/dist/notifications/index.js +1 -0
  68. package/dist/notifications/index.js.map +1 -1
  69. package/dist/schemas/admin-notifications.d.ts +1 -0
  70. package/dist/schemas/admin-notifications.d.ts.map +1 -1
  71. package/dist/schemas/admin-notifications.js +4 -2
  72. package/dist/schemas/admin-notifications.js.map +1 -1
  73. package/dist/schemas/app-config.d.ts +2 -2
  74. package/dist/schemas/app-config.d.ts.map +1 -1
  75. package/dist/schemas/app-config.js +9 -5
  76. package/dist/schemas/app-config.js.map +1 -1
  77. package/dist/schemas/awards.d.ts +16 -4
  78. package/dist/schemas/awards.d.ts.map +1 -1
  79. package/dist/schemas/awards.js +10 -6
  80. package/dist/schemas/awards.js.map +1 -1
  81. package/dist/schemas/game-locations.d.ts +4 -4
  82. package/dist/schemas/game-locations.d.ts.map +1 -1
  83. package/dist/schemas/game-locations.js +11 -3
  84. package/dist/schemas/game-locations.js.map +1 -1
  85. package/dist/schemas/migration-console.d.ts +1 -0
  86. package/dist/schemas/migration-console.d.ts.map +1 -1
  87. package/dist/schemas/pictures.d.ts +3 -0
  88. package/dist/schemas/pictures.d.ts.map +1 -1
  89. package/dist/schemas/stats.d.ts +2 -0
  90. package/dist/schemas/stats.d.ts.map +1 -1
  91. package/dist/schemas/teams.d.ts +3 -2
  92. package/dist/schemas/teams.d.ts.map +1 -1
  93. package/dist/schemas/teams.js +22 -11
  94. package/dist/schemas/teams.js.map +1 -1
  95. package/dist/schemas/users.d.ts +7 -3
  96. package/dist/schemas/users.d.ts.map +1 -1
  97. package/dist/schemas/users.js +10 -3
  98. package/dist/schemas/users.js.map +1 -1
  99. package/dist/schemas/waiver-templates.d.ts +1 -0
  100. package/dist/schemas/waiver-templates.d.ts.map +1 -1
  101. package/dist/schemas/waiver-templates.js +4 -1
  102. package/dist/schemas/waiver-templates.js.map +1 -1
  103. package/dist/sports/index.d.ts +1 -0
  104. package/dist/sports/index.d.ts.map +1 -1
  105. package/dist/sports/index.js +1 -0
  106. package/dist/sports/index.js.map +1 -1
  107. package/dist/sports/ledger-continuity.d.ts +13 -0
  108. package/dist/sports/ledger-continuity.d.ts.map +1 -0
  109. package/dist/sports/ledger-continuity.js +19 -0
  110. package/dist/sports/ledger-continuity.js.map +1 -0
  111. package/dist/types/audit.d.ts +1 -1
  112. package/dist/types/audit.d.ts.map +1 -1
  113. package/dist/types/audit.js +5 -2
  114. package/dist/types/audit.js.map +1 -1
  115. package/dist/types/unions.d.ts +4 -2
  116. package/dist/types/unions.d.ts.map +1 -1
  117. package/dist/types/unions.js +6 -0
  118. package/dist/types/unions.js.map +1 -1
  119. package/dist/upload-variables/index.d.ts +3 -0
  120. package/dist/upload-variables/index.d.ts.map +1 -0
  121. package/dist/upload-variables/index.js +3 -0
  122. package/dist/upload-variables/index.js.map +1 -0
  123. package/dist/upload-variables/on-progress.d.ts +4 -0
  124. package/dist/upload-variables/on-progress.d.ts.map +1 -0
  125. package/dist/upload-variables/on-progress.js +10 -0
  126. package/dist/upload-variables/on-progress.js.map +1 -0
  127. package/dist/upload-variables/picture-upload-variables.d.ts +32 -0
  128. package/dist/upload-variables/picture-upload-variables.d.ts.map +1 -0
  129. package/dist/upload-variables/picture-upload-variables.js +21 -0
  130. package/dist/upload-variables/picture-upload-variables.js.map +1 -0
  131. package/dist/utils/app-config.d.ts +17 -3
  132. package/dist/utils/app-config.d.ts.map +1 -1
  133. package/dist/utils/app-config.js +21 -14
  134. package/dist/utils/app-config.js.map +1 -1
  135. package/package.json +6 -2
@@ -1 +1 @@
1
- {"version":3,"file":"teams.js","sourceRoot":"","sources":["../../src/schemas/teams.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,kGAAkG;AAClG,6EAA6E;AAE7E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,kCAAkC,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,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;AAGZ,mGAAmG;AACnG,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC;KACrD,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,CAAC;KAClE,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,wCAAwC,GAAG,iCAAiC,CAAC;AAG1F,kGAAkG;AAClG,oGAAoG;AACpG,sDAAsD;AACtD,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAG5F,iGAAiG;AACjG,qGAAqG;AACrG,0BAA0B;AAC1B,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,MAAM,EAAE,YAAY;IACpB,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,kBAAkB,EAAE,WAAW;CAChC,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for teams and team membership. The acting user is always `request.auth.uid` —\n// never an input field (ARCH-106). The entry, never a field of the payload, decides the authority\n// (BACKEND-004); an admin entry's schema adds only what its authority needs.\n\nimport { z } from 'zod';\nimport {\n leagueJoinWarningActedOnSchema,\n leagueJoinWarningFindingSchema,\n} from '../utils/league-join-warning.js';\nimport { membershipRosterSyncStatusSchema } from '../doc-schemas/atoms.js';\nimport { isGhostUserId } from '../ids/minted-ids.js';\nimport { GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS } from '../types/stats.js';\nimport { MEMBER_ASSIGNABLE_TEAM_ROLES } from '../types/unions.js';\nimport {\n contactPhoneSchema,\n countSchema,\n displayNameSchema,\n gameIdSchema,\n leagueIdSchema,\n repairReasonSchema,\n teamIconSchema,\n teamIdSchema,\n teamNameSchema,\n teamRoleSchema,\n teamTypeSchema,\n userIdSchema,\n} from './atoms.js';\n\n// ---------------------------------------------------------------------------------------------\n// Team creation — `createLeagueTeam` (the creator becomes captain) and `adminCreateLeagueTeam`\n// (an admin creates the team with a newly minted ghost captain). Both write the team's contact\n// phone; `teamType` is read only in a Competitive/Recreational league, which requires it.\n// ---------------------------------------------------------------------------------------------\n\nconst teamCreationFields = {\n leagueId: leagueIdSchema,\n name: teamNameSchema,\n icon: teamIconSchema,\n teamType: teamTypeSchema.optional(),\n contactPhone: contactPhoneSchema,\n};\n\nexport const CreateLeagueTeamInputSchema = z.object(teamCreationFields).strict();\nexport type CreateLeagueTeamInput = z.infer<typeof CreateLeagueTeamInputSchema>;\n\nexport const AdminCreateLeagueTeamInputSchema = z\n .object({ ...teamCreationFields, captainDisplayName: displayNameSchema })\n .strict();\nexport type AdminCreateLeagueTeamInput = z.infer<typeof AdminCreateLeagueTeamInputSchema>;\n\nexport const CreateLeagueTeamResultSchema = z\n .object({ leagueId: leagueIdSchema, teamId: teamIdSchema, captainUserId: userIdSchema })\n .strict();\nexport type CreateLeagueTeamResult = z.infer<typeof CreateLeagueTeamResultSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// Ghost add — one core behind two doors. The team page door (`createTeamGhostPlayer` /\n// `adminCreateTeamGhostPlayer`) needs authority over the team; the game page door\n// (`createGameGhostPlayer` / `adminCreateGameGhostPlayer`) needs scoring authority over the game\n// and adds to one of its two teams. The ghost id is always minted by the server.\n// ---------------------------------------------------------------------------------------------\n\nexport const CreateTeamGhostPlayerInputSchema = z\n .object({ teamId: teamIdSchema, displayName: displayNameSchema })\n .strict();\nexport type CreateTeamGhostPlayerInput = z.infer<typeof CreateTeamGhostPlayerInputSchema>;\n\nexport const CreateGameGhostPlayerInputSchema = z\n .object({ gameId: gameIdSchema, teamId: teamIdSchema, displayName: displayNameSchema })\n .strict();\nexport type CreateGameGhostPlayerInput = z.infer<typeof CreateGameGhostPlayerInputSchema>;\n\n// `rosterSyncStatus` is where the new membership's roster work stood when the call returned: the\n// membership is committed either way, and `pending` finishes in the background.\nexport const CreateGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n rosterSyncStatus: membershipRosterSyncStatusSchema,\n })\n .strict();\nexport type CreateGhostPlayerResult = z.infer<typeof CreateGhostPlayerResultSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// The join warning — `getLeagueJoinWarning` (the person, or a captain or co-captain of the target\n// team) and `adminGetLeagueJoinWarning` (an admin, about anyone).\n// ---------------------------------------------------------------------------------------------\n\n// `targetTeamId` is the team the door acts for; a free-agent signup and a team being created have\n// none. `actedOn` is the item the door answers, which the warning leaves out.\nexport const GetLeagueJoinWarningInputSchema = z\n .object({\n leagueId: leagueIdSchema,\n userId: userIdSchema,\n targetTeamId: teamIdSchema.optional(),\n actedOn: leagueJoinWarningActedOnSchema.optional(),\n })\n .strict();\nexport type GetLeagueJoinWarningInput = z.infer<typeof GetLeagueJoinWarningInputSchema>;\n\nexport const GetLeagueJoinWarningResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n userId: userIdSchema,\n findings: z.array(leagueJoinWarningFindingSchema),\n })\n .strict();\nexport type GetLeagueJoinWarningResult = z.infer<typeof GetLeagueJoinWarningResultSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// Roster reconciliation recovery — an admin puts a team's failed roster obligations back to work.\n// ---------------------------------------------------------------------------------------------\n\nexport const AdminRetryLeagueTeamRosterSyncInputSchema = z.object({ teamId: teamIdSchema }).strict();\nexport type AdminRetryLeagueTeamRosterSyncInput = z.infer<typeof AdminRetryLeagueTeamRosterSyncInputSchema>;\n\nexport const AdminRetryLeagueTeamRosterSyncResultSchema = z\n .object({\n teamId: teamIdSchema,\n // Failed obligations put back to pending.\n retried: countSchema,\n // Of those and any already pending, how many the call itself finished.\n reconciled: countSchema,\n // Failed obligations left as they are because they fail their schema, by document id; a\n // damaged document's id is reported as stored, so it is not held to the membership id format.\n damagedTeamMembershipIds: z.array(z.string().min(1)),\n })\n .strict();\nexport type AdminRetryLeagueTeamRosterSyncResult = z.infer<typeof AdminRetryLeagueTeamRosterSyncResultSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// Linking a ghost to a real account — `linkGhostPlayerToUser` in a league that is not closed, and\n// `adminLinkClosedLeagueGhostPlayer` in a closed one. Both are admin-only, act on one team, and take\n// a reason, because a link rewrites completed records (BACKEND-212). The ghost and the account are\n// ids the core checks itself, so a ghost id named as the account, or a real id named as the ghost,\n// is refused with a failure record rather than at the parse. Every name the link records is read\n// server-side, never sent.\n// ---------------------------------------------------------------------------------------------\n\nexport const LinkGhostPlayerInputSchema = z\n .object({\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n userId: userIdSchema,\n reason: repairReasonSchema,\n })\n .strict();\nexport type LinkGhostPlayerInput = z.infer<typeof LinkGhostPlayerInputSchema>;\n\n// `complete` is false when the call ran out of time part-way: the link stays under way, and the same\n// call by the same account continues it. `membershipOutcome` is present once it is complete.\n// `publicUserDeleted` is false when something else still names the ghost.\nexport const LinkGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n userId: userIdSchema,\n complete: z.boolean(),\n gamesMoved: countSchema,\n membershipOutcome: z.enum(GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS).optional(),\n publicUserDeleted: z.boolean(),\n })\n .strict();\nexport type LinkGhostPlayerResult = z.infer<typeof LinkGhostPlayerResultSchema>;\n\nexport const AdminLinkClosedLeagueGhostPlayerInputSchema = LinkGhostPlayerInputSchema;\nexport type AdminLinkClosedLeagueGhostPlayerInput = LinkGhostPlayerInput;\nexport const AdminLinkClosedLeagueGhostPlayerResultSchema = LinkGhostPlayerResultSchema;\nexport type AdminLinkClosedLeagueGhostPlayerResult = LinkGhostPlayerResult;\n\n// ---------------------------------------------------------------------------------------------\n// Managing a team's members. A role change and a removal each have a member entry — the team's\n// captain or a co-captain, read from their membership — and an admin entry; changing the captain,\n// renaming the team, changing its type, setting its contact phone, and deleting it are admin-only.\n// Every target is named by id and read server-side; nothing here names who is acting (ARCH-106).\n// ---------------------------------------------------------------------------------------------\n\n/** A ghost id, refused for any other id, so a removal input cannot name a real account. */\nexport const ghostUserIdSchema = userIdSchema.refine(isGhostUserId, 'Not a ghost player.');\n\n// `updateTeamMembershipRole` (the captain) / `adminUpdateTeamMembershipRole`: promote a player to\n// co-captain, or demote a co-captain to player.\nexport const UpdateTeamMembershipRoleInputSchema = z\n .object({ teamId: teamIdSchema, userId: userIdSchema, role: z.enum(MEMBER_ASSIGNABLE_TEAM_ROLES) })\n .strict();\nexport type UpdateTeamMembershipRoleInput = z.infer<typeof UpdateTeamMembershipRoleInputSchema>;\n\n// `changed` is false when the member already held the role: nothing was written or recorded.\nexport const UpdateTeamMembershipRoleResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n role: teamRoleSchema,\n changed: z.boolean(),\n })\n .strict();\nexport type UpdateTeamMembershipRoleResult = z.infer<typeof UpdateTeamMembershipRoleResultSchema>;\n\n// `deleteTeamMembership` (the captain or a co-captain) / `adminDeleteTeamMembership`: remove a real\n// player from the team. A ghost is removed through its own action, below.\nexport const DeleteTeamMembershipInputSchema = z\n .object({\n teamId: teamIdSchema,\n userId: userIdSchema.refine((userId) => !isGhostUserId(userId), 'A ghost player is removed as a ghost player.'),\n })\n .strict();\nexport type DeleteTeamMembershipInput = z.infer<typeof DeleteTeamMembershipInputSchema>;\n\n// `deleted` is false when the person held no membership on the team: nothing was written. The\n// membership is gone either way; `rosterSyncStatus` is where its roster work stood on return.\nexport const DeleteTeamMembershipResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n deleted: z.boolean(),\n rosterSyncStatus: membershipRosterSyncStatusSchema,\n })\n .strict();\nexport type DeleteTeamMembershipResult = z.infer<typeof DeleteTeamMembershipResultSchema>;\n\n// `deleteTeamGhostPlayer` (the captain or a co-captain) / `adminDeleteTeamGhostPlayer`: remove a ghost\n// that has never played, completely. A never-played ghost holds no stat, so its removal is not a\n// repair and takes no reason; its audit event still records who removed what (BACKEND-212).\nexport const DeleteTeamGhostPlayerInputSchema = z\n .object({ teamId: teamIdSchema, ghostUserId: ghostUserIdSchema })\n .strict();\nexport type DeleteTeamGhostPlayerInput = z.infer<typeof DeleteTeamGhostPlayerInputSchema>;\n\n// `complete` is false when the call ran out of time part-way: the ghost's games stay held and the\n// same call finishes the removal. `publicUserDeleted` is false when something else still names the\n// ghost, so its name stays until that reference goes.\nexport const DeleteTeamGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n complete: z.boolean(),\n finishedGameEntriesRemoved: countSchema,\n publicUserDeleted: z.boolean(),\n })\n .strict();\nexport type DeleteTeamGhostPlayerResult = z.infer<typeof DeleteTeamGhostPlayerResultSchema>;\n\n// `adminUpdateLeagueTeamCaptain`: make a member of the team its captain. Every other captain the team\n// holds becomes a player.\nexport const AdminUpdateLeagueTeamCaptainInputSchema = z\n .object({ teamId: teamIdSchema, captainUserId: userIdSchema })\n .strict();\nexport type AdminUpdateLeagueTeamCaptainInput = z.infer<typeof AdminUpdateLeagueTeamCaptainInputSchema>;\n\nexport const AdminUpdateLeagueTeamCaptainResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n captainUserId: userIdSchema,\n demotedUserIds: z.array(userIdSchema),\n changed: z.boolean(),\n })\n .strict();\nexport type AdminUpdateLeagueTeamCaptainResult = z.infer<typeof AdminUpdateLeagueTeamCaptainResultSchema>;\n\n// `adminUpdateLeagueTeamName`: rename a team. The name lives on the team alone; nothing copies it.\nexport const AdminUpdateLeagueTeamNameInputSchema = z\n .object({ teamId: teamIdSchema, name: teamNameSchema })\n .strict();\nexport type AdminUpdateLeagueTeamNameInput = z.infer<typeof AdminUpdateLeagueTeamNameInputSchema>;\n\n// `adminUpdateLeagueTeamType`: change a team's type in a league that sorts its teams by type.\nexport const AdminUpdateLeagueTeamTypeInputSchema = z\n .object({ teamId: teamIdSchema, teamType: teamTypeSchema })\n .strict();\nexport type AdminUpdateLeagueTeamTypeInput = z.infer<typeof AdminUpdateLeagueTeamTypeInputSchema>;\n\n// The answer to either edit: `changed` is false when the team already held the value.\nexport const AdminUpdateLeagueTeamResultSchema = z\n .object({ leagueId: leagueIdSchema, teamId: teamIdSchema, changed: z.boolean() })\n .strict();\nexport type AdminUpdateLeagueTeamResult = z.infer<typeof AdminUpdateLeagueTeamResultSchema>;\n\n// `adminUpdateLeagueTeamContact`: set the team's contact phone on its admin-only contact document.\nexport const AdminUpdateLeagueTeamContactInputSchema = z\n .object({ teamId: teamIdSchema, contactPhone: contactPhoneSchema })\n .strict();\nexport type AdminUpdateLeagueTeamContactInput = z.infer<typeof AdminUpdateLeagueTeamContactInputSchema>;\n\nexport const AdminUpdateLeagueTeamContactResultSchema = AdminUpdateLeagueTeamResultSchema;\nexport type AdminUpdateLeagueTeamContactResult = AdminUpdateLeagueTeamResult;\n\n// `adminDeleteLeagueTeam`: delete a team that has never played, with everything that is only its.\n// A never-played team holds no stat, so its deletion is not a repair and takes no reason; its audit\n// event still records who deleted what (BACKEND-212).\nexport const AdminDeleteLeagueTeamInputSchema = z.object({ teamId: teamIdSchema }).strict();\nexport type AdminDeleteLeagueTeamInput = z.infer<typeof AdminDeleteLeagueTeamInputSchema>;\n\n// `complete` is false when the call ran out of time part-way: what is left stays, the team still\n// stands, and the same call finishes the deletion. `remainingGameCount` is the team's games still to\n// delete when it stopped.\nexport const AdminDeleteLeagueTeamResultSchema = z\n .object({\n teamId: teamIdSchema,\n complete: z.boolean(),\n remainingGameCount: countSchema,\n })\n .strict();\nexport type AdminDeleteLeagueTeamResult = z.infer<typeof AdminDeleteLeagueTeamResultSchema>;\n"]}
1
+ {"version":3,"file":"teams.js","sourceRoot":"","sources":["../../src/schemas/teams.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,kGAAkG;AAClG,6EAA6E;AAE7E,OAAO,EAAE,CAAC,EA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M,EAAE,CAAC","sourcesContent":["// Callable contracts for teams and team membership. The acting user is always `request.auth.uid` —\n// never an input field (ARCH-106). The entry, never a field of the payload, decides the authority\n// (BACKEND-004); an admin entry's schema adds only what its authority needs.\n\nimport { z } from 'zod';\nimport {\n leagueJoinWarningActedOnSchema,\n leagueJoinWarningFindingSchema,\n} from '../utils/league-join-warning.js';\nimport { documentIdSegmentSchema, membershipRosterSyncStatusSchema } from '../doc-schemas/atoms.js';\nimport { buildGhostUserIdForRequest, isGhostUserId } from '../ids/minted-ids.js';\nimport { isDocumentIdSegment } from '../paths/utils.js';\nimport { GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS } from '../types/stats.js';\nimport { MEMBER_ASSIGNABLE_TEAM_ROLES } from '../types/unions.js';\nimport {\n contactPhoneSchema,\n countSchema,\n displayNameSchema,\n gameIdSchema,\n leagueIdSchema,\n teamIconSchema,\n teamIdSchema,\n teamNameSchema,\n teamRoleSchema,\n teamTypeSchema,\n userIdSchema,\n} from './atoms.js';\n\n// ---------------------------------------------------------------------------------------------\n// Team creation — `createLeagueTeam` (the creator becomes captain) and `adminCreateLeagueTeam`\n// (an admin creates the team with a newly minted ghost captain). Both write the team's contact\n// phone; `teamType` is read only in a Competitive/Recreational league, which requires it.\n// ---------------------------------------------------------------------------------------------\n\nconst teamCreationFields = {\n leagueId: leagueIdSchema,\n name: teamNameSchema,\n icon: teamIconSchema,\n teamType: teamTypeSchema.optional(),\n contactPhone: contactPhoneSchema,\n};\n\nexport const CreateLeagueTeamInputSchema = z.object(teamCreationFields).strict();\nexport type CreateLeagueTeamInput = z.infer<typeof CreateLeagueTeamInputSchema>;\n\nexport const AdminCreateLeagueTeamInputSchema = z\n .object({ ...teamCreationFields, captainDisplayName: displayNameSchema })\n .strict();\nexport type AdminCreateLeagueTeamInput = z.infer<typeof AdminCreateLeagueTeamInputSchema>;\n\nexport const CreateLeagueTeamResultSchema = z\n .object({ leagueId: leagueIdSchema, teamId: teamIdSchema, captainUserId: userIdSchema })\n .strict();\nexport type CreateLeagueTeamResult = z.infer<typeof CreateLeagueTeamResultSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// Ghost add — one core behind two doors. The team page door (`createTeamGhostPlayer` /\n// `adminCreateTeamGhostPlayer`) needs authority over the team; the game page door\n// (`createGameGhostPlayer` / `adminCreateGameGhostPlayer`) needs scoring authority over the game\n// and adds to one of its two teams. The ghost id is derived by the server from the add's\n// `requestId`, which the client mints once when the add starts and re-sends on every retry, so a\n// retry after an unknown outcome is recognised as the same add (`buildGhostUserIdForRequest`).\n// ---------------------------------------------------------------------------------------------\n\n// One document-id segment (ARCH-106), short enough that the ghost id derived from it is one too.\nexport const ghostCreateRequestIdSchema = documentIdSegmentSchema.refine(\n (requestId) => isDocumentIdSegment(buildGhostUserIdForRequest(requestId)),\n 'Not a ghost add request id.',\n);\n\nexport const CreateTeamGhostPlayerInputSchema = z\n .object({ teamId: teamIdSchema, displayName: displayNameSchema, requestId: ghostCreateRequestIdSchema })\n .strict();\nexport type CreateTeamGhostPlayerInput = z.infer<typeof CreateTeamGhostPlayerInputSchema>;\n\nexport const CreateGameGhostPlayerInputSchema = z\n .object({\n gameId: gameIdSchema,\n teamId: teamIdSchema,\n displayName: displayNameSchema,\n requestId: ghostCreateRequestIdSchema,\n })\n .strict();\nexport type CreateGameGhostPlayerInput = z.infer<typeof CreateGameGhostPlayerInputSchema>;\n\n// `rosterSyncStatus` is where the new membership's roster work stood when the call returned: the\n// membership is committed either way, and `pending` finishes in the background.\nexport const CreateGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n rosterSyncStatus: membershipRosterSyncStatusSchema,\n })\n .strict();\nexport type CreateGhostPlayerResult = z.infer<typeof CreateGhostPlayerResultSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// The join warning — `getLeagueJoinWarning` (the person, or a captain or co-captain of the target\n// team) and `adminGetLeagueJoinWarning` (an admin, about anyone).\n// ---------------------------------------------------------------------------------------------\n\n// `targetTeamId` is the team the door acts for; a free-agent signup and a team being created have\n// none. `actedOn` is the item the door answers, which the warning leaves out.\nexport const GetLeagueJoinWarningInputSchema = z\n .object({\n leagueId: leagueIdSchema,\n userId: userIdSchema,\n targetTeamId: teamIdSchema.optional(),\n actedOn: leagueJoinWarningActedOnSchema.optional(),\n })\n .strict();\nexport type GetLeagueJoinWarningInput = z.infer<typeof GetLeagueJoinWarningInputSchema>;\n\nexport const GetLeagueJoinWarningResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n userId: userIdSchema,\n findings: z.array(leagueJoinWarningFindingSchema),\n })\n .strict();\nexport type GetLeagueJoinWarningResult = z.infer<typeof GetLeagueJoinWarningResultSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// Roster reconciliation recovery — an admin puts a team's failed roster obligations back to work.\n// ---------------------------------------------------------------------------------------------\n\nexport const AdminRetryLeagueTeamRosterSyncInputSchema = z.object({ teamId: teamIdSchema }).strict();\nexport type AdminRetryLeagueTeamRosterSyncInput = z.infer<typeof AdminRetryLeagueTeamRosterSyncInputSchema>;\n\nexport const AdminRetryLeagueTeamRosterSyncResultSchema = z\n .object({\n teamId: teamIdSchema,\n // Failed obligations put back to pending.\n retried: countSchema,\n // Of those and any already pending, how many the call itself finished.\n reconciled: countSchema,\n // Failed obligations left as they are because they fail their schema, by document id; a\n // damaged document's id is reported as stored, so it is not held to the membership id format.\n damagedTeamMembershipIds: z.array(z.string().min(1)),\n })\n .strict();\nexport type AdminRetryLeagueTeamRosterSyncResult = z.infer<typeof AdminRetryLeagueTeamRosterSyncResultSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// Linking a ghost to a real account — `linkGhostPlayerToUser` in a league that is not closed, and\n// `adminLinkClosedLeagueGhostPlayer` in a closed one. Both are admin-only and act on one team. A link\n// takes no reason: the admin chooses the account and confirms, and the link's audit event records\n// who linked which ghost to whom and what moved (BACKEND-212). The ghost and the account are\n// ids the core checks itself, so a ghost id named as the account, or a real id named as the ghost,\n// is refused with a failure record rather than at the parse. Every name the link records is read\n// server-side, never sent.\n// ---------------------------------------------------------------------------------------------\n\nexport const LinkGhostPlayerInputSchema = z\n .object({\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n userId: userIdSchema,\n })\n .strict();\nexport type LinkGhostPlayerInput = z.infer<typeof LinkGhostPlayerInputSchema>;\n\n// `complete` is false when the call ran out of time part-way: the link stays under way, and the same\n// call by the same account continues it. `membershipOutcome` is present once it is complete.\n// `publicUserDeleted` is false when something else still names the ghost.\nexport const LinkGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n userId: userIdSchema,\n complete: z.boolean(),\n gamesMoved: countSchema,\n membershipOutcome: z.enum(GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS).optional(),\n publicUserDeleted: z.boolean(),\n })\n .strict();\nexport type LinkGhostPlayerResult = z.infer<typeof LinkGhostPlayerResultSchema>;\n\nexport const AdminLinkClosedLeagueGhostPlayerInputSchema = LinkGhostPlayerInputSchema;\nexport type AdminLinkClosedLeagueGhostPlayerInput = LinkGhostPlayerInput;\nexport const AdminLinkClosedLeagueGhostPlayerResultSchema = LinkGhostPlayerResultSchema;\nexport type AdminLinkClosedLeagueGhostPlayerResult = LinkGhostPlayerResult;\n\n// ---------------------------------------------------------------------------------------------\n// Managing a team's members. A role change and a removal each have a member entry — the team's\n// captain or a co-captain, read from their membership — and an admin entry; changing the captain,\n// renaming the team, changing its type, setting its contact phone, and deleting it are admin-only.\n// Every target is named by id and read server-side; nothing here names who is acting (ARCH-106).\n// ---------------------------------------------------------------------------------------------\n\n/** A ghost id, refused for any other id, so a removal input cannot name a real account. */\nexport const ghostUserIdSchema = userIdSchema.refine(isGhostUserId, 'Not a ghost player.');\n\n// `updateTeamMembershipRole` (the captain) / `adminUpdateTeamMembershipRole`: promote a player to\n// co-captain, or demote a co-captain to player.\nexport const UpdateTeamMembershipRoleInputSchema = z\n .object({ teamId: teamIdSchema, userId: userIdSchema, role: z.enum(MEMBER_ASSIGNABLE_TEAM_ROLES) })\n .strict();\nexport type UpdateTeamMembershipRoleInput = z.infer<typeof UpdateTeamMembershipRoleInputSchema>;\n\n// `changed` is false when the member already held the role: nothing was written or recorded.\nexport const UpdateTeamMembershipRoleResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n role: teamRoleSchema,\n changed: z.boolean(),\n })\n .strict();\nexport type UpdateTeamMembershipRoleResult = z.infer<typeof UpdateTeamMembershipRoleResultSchema>;\n\n// `deleteTeamMembership` (the captain or a co-captain) / `adminDeleteTeamMembership`: remove a real\n// player from the team. A ghost is removed through its own action, below.\nexport const DeleteTeamMembershipInputSchema = z\n .object({\n teamId: teamIdSchema,\n userId: userIdSchema.refine((userId) => !isGhostUserId(userId), 'A ghost player is removed as a ghost player.'),\n })\n .strict();\nexport type DeleteTeamMembershipInput = z.infer<typeof DeleteTeamMembershipInputSchema>;\n\n// `deleted` is false when the person held no membership on the team: nothing was written. The\n// membership is gone either way; `rosterSyncStatus` is where its roster work stood on return.\nexport const DeleteTeamMembershipResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n deleted: z.boolean(),\n rosterSyncStatus: membershipRosterSyncStatusSchema,\n })\n .strict();\nexport type DeleteTeamMembershipResult = z.infer<typeof DeleteTeamMembershipResultSchema>;\n\n// `deleteTeamGhostPlayer` (the captain or a co-captain) / `adminDeleteTeamGhostPlayer`: remove a ghost\n// that has never played, completely. A never-played ghost holds no stat, so its removal is not a\n// repair and takes no reason; its audit event still records who removed what (BACKEND-212).\nexport const DeleteTeamGhostPlayerInputSchema = z\n .object({ teamId: teamIdSchema, ghostUserId: ghostUserIdSchema })\n .strict();\nexport type DeleteTeamGhostPlayerInput = z.infer<typeof DeleteTeamGhostPlayerInputSchema>;\n\n// `complete` is false when the call ran out of time part-way: the ghost's games stay held and the\n// same call finishes the removal. `finishedGameEntriesRemoved` is the whole removal's count so far,\n// never one call's share, so a later response replaces an earlier one. `publicUserDeleted` is false\n// when something else still names the ghost, so its name stays until that reference goes.\nexport const DeleteTeamGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n complete: z.boolean(),\n finishedGameEntriesRemoved: countSchema,\n publicUserDeleted: z.boolean(),\n })\n .strict();\nexport type DeleteTeamGhostPlayerResult = z.infer<typeof DeleteTeamGhostPlayerResultSchema>;\n\n// `adminUpdateLeagueTeamCaptain`: make a member of the team its captain. Every other captain the team\n// holds becomes a player.\nexport const AdminUpdateLeagueTeamCaptainInputSchema = z\n .object({ teamId: teamIdSchema, captainUserId: userIdSchema })\n .strict();\nexport type AdminUpdateLeagueTeamCaptainInput = z.infer<typeof AdminUpdateLeagueTeamCaptainInputSchema>;\n\nexport const AdminUpdateLeagueTeamCaptainResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n captainUserId: userIdSchema,\n demotedUserIds: z.array(userIdSchema),\n changed: z.boolean(),\n })\n .strict();\nexport type AdminUpdateLeagueTeamCaptainResult = z.infer<typeof AdminUpdateLeagueTeamCaptainResultSchema>;\n\n// `adminUpdateLeagueTeamName`: rename a team. The name lives on the team alone; nothing copies it.\nexport const AdminUpdateLeagueTeamNameInputSchema = z\n .object({ teamId: teamIdSchema, name: teamNameSchema })\n .strict();\nexport type AdminUpdateLeagueTeamNameInput = z.infer<typeof AdminUpdateLeagueTeamNameInputSchema>;\n\n// `adminUpdateLeagueTeamType`: change a team's type in a league that sorts its teams by type.\nexport const AdminUpdateLeagueTeamTypeInputSchema = z\n .object({ teamId: teamIdSchema, teamType: teamTypeSchema })\n .strict();\nexport type AdminUpdateLeagueTeamTypeInput = z.infer<typeof AdminUpdateLeagueTeamTypeInputSchema>;\n\n// The answer to either edit: `changed` is false when the team already held the value.\nexport const AdminUpdateLeagueTeamResultSchema = z\n .object({ leagueId: leagueIdSchema, teamId: teamIdSchema, changed: z.boolean() })\n .strict();\nexport type AdminUpdateLeagueTeamResult = z.infer<typeof AdminUpdateLeagueTeamResultSchema>;\n\n// `adminUpdateLeagueTeamContact`: set the team's contact phone on its admin-only contact document.\nexport const AdminUpdateLeagueTeamContactInputSchema = z\n .object({ teamId: teamIdSchema, contactPhone: contactPhoneSchema })\n .strict();\nexport type AdminUpdateLeagueTeamContactInput = z.infer<typeof AdminUpdateLeagueTeamContactInputSchema>;\n\nexport const AdminUpdateLeagueTeamContactResultSchema = AdminUpdateLeagueTeamResultSchema;\nexport type AdminUpdateLeagueTeamContactResult = AdminUpdateLeagueTeamResult;\n\n// `adminDeleteLeagueTeam`: delete a team that has never played, with everything that is only its.\n// A never-played team holds no stat, so its deletion is not a repair and takes no reason; its audit\n// event still records who deleted what (BACKEND-212).\nexport const AdminDeleteLeagueTeamInputSchema = z.object({ teamId: teamIdSchema }).strict();\nexport type AdminDeleteLeagueTeamInput = z.infer<typeof AdminDeleteLeagueTeamInputSchema>;\n\n// `complete` is false when the call ran out of time part-way: what is left stays, the team still\n// stands, and the same call finishes the deletion. `remainingGameCount` is the team's games still to\n// delete when it stopped.\nexport const AdminDeleteLeagueTeamResultSchema = z\n .object({\n teamId: teamIdSchema,\n complete: z.boolean(),\n remainingGameCount: countSchema,\n })\n .strict();\nexport type AdminDeleteLeagueTeamResult = z.infer<typeof AdminDeleteLeagueTeamResultSchema>;\n"]}
@@ -4,10 +4,13 @@ export declare const RegisterUserInputSchema: z.ZodObject<{
4
4
  acceptedTerms: z.ZodLiteral<true>;
5
5
  }, z.core.$strict>;
6
6
  export type RegisterUserInput = z.infer<typeof RegisterUserInputSchema>;
7
- export declare const RegisterUserResultSchema: z.ZodObject<{
7
+ export declare const RegisterUserResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
8
+ status: z.ZodLiteral<"registered">;
8
9
  userId: z.ZodString;
9
10
  displayName: z.ZodString;
10
- }, z.core.$strict>;
11
+ }, z.core.$strict>, z.ZodObject<{
12
+ status: z.ZodLiteral<"registrationExpired">;
13
+ }, z.core.$strict>], "status">;
11
14
  export type RegisterUserResult = z.infer<typeof RegisterUserResultSchema>;
12
15
  export declare const CheckDisplayNameAvailableInputSchema: z.ZodObject<{
13
16
  displayName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
@@ -129,10 +132,11 @@ export type AdminUpdateUserStatusResult = z.infer<typeof AdminUpdateUserStatusRe
129
132
  export declare const ADMIN_STANDING_BAN_REFUSAL_REASON = "adminStandingTarget";
130
133
  export declare const CreateRegistrationStartInputSchema: z.ZodObject<{}, z.core.$strict>;
131
134
  export type CreateRegistrationStartInput = z.infer<typeof CreateRegistrationStartInputSchema>;
132
- export declare const REGISTRATION_START_OUTCOMES: readonly ["started", "alreadyStarted"];
135
+ export declare const REGISTRATION_START_OUTCOMES: readonly ["started", "alreadyStarted", "registrationExpired"];
133
136
  export type RegistrationStartOutcome = (typeof REGISTRATION_START_OUTCOMES)[number];
134
137
  export declare const CreateRegistrationStartResultSchema: z.ZodObject<{
135
138
  outcome: z.ZodEnum<{
139
+ registrationExpired: "registrationExpired";
136
140
  started: "started";
137
141
  alreadyStarted: "alreadyStarted";
138
142
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/schemas/users.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,uBAAuB;;;kBAMzB,CAAC;AACZ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,eAAO,MAAM,wBAAwB;;;kBAAuE,CAAC;AAC7G,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAM1E,eAAO,MAAM,oCAAoC;;kBAAwD,CAAC;AAC1G,MAAM,MAAM,8BAA8B,GAAG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C,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAG1F,eAAO,MAAM,iCAAiC;;;;;;;;;;;kBAOnC,CAAC;AACZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAI5F,eAAO,MAAM,iCAAiC,wBAAwB,CAAC;AAKvE,eAAO,MAAM,kCAAkC,iCAAwB,CAAC;AACxE,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAI9F,eAAO,MAAM,2BAA2B,+DAAgE,CAAC;AACzG,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AACpF,eAAO,MAAM,mCAAmC;;;;;;kBAErC,CAAC;AACZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC"}
@@ -12,7 +12,13 @@ export const RegisterUserInputSchema = z
12
12
  acceptedTerms: z.literal(true),
13
13
  })
14
14
  .strict();
15
- export const RegisterUserResultSchema = z.object({ userId: userIdSchema, displayName: z.string() }).strict();
15
+ export const RegisterUserResultSchema = z.discriminatedUnion('status', [
16
+ // The account is registered (or already was — an idempotent replay).
17
+ z.object({ status: z.literal('registered'), userId: userIdSchema, displayName: z.string() }).strict(),
18
+ // The orphan-registration cleanup claimed this login for deletion, so the registration cannot
19
+ // finish on it; nothing is written and the person signs up again.
20
+ z.object({ status: z.literal('registrationExpired') }).strict(),
21
+ ]);
16
22
  // The register form's check before the login is created: is the name free? It runs before any
17
23
  // account exists, over the same name rule `registerUser` takes, and is a soft answer — the claim
18
24
  // itself is `registerUser`'s transaction, which refuses `already-exists` when two registrations
@@ -113,8 +119,9 @@ export const ADMIN_STANDING_BAN_REFUSAL_REASON = 'adminStandingTarget';
113
119
  // caller is `request.auth.uid` and the email comes from its token, so it takes no input.
114
120
  export const CreateRegistrationStartInputSchema = z.object({}).strict();
115
121
  // `started` wrote both records; `alreadyStarted` found the registration already started and wrote
116
- // nothing — a retry, or a resume after a later step failed.
117
- export const REGISTRATION_START_OUTCOMES = ['started', 'alreadyStarted'];
122
+ // nothing — a retry, or a resume after a later step failed; `registrationExpired` found the login
123
+ // claimed by the orphan-registration cleanup and wrote nothing — the person signs up again.
124
+ export const REGISTRATION_START_OUTCOMES = ['started', 'alreadyStarted', 'registrationExpired'];
118
125
  export const CreateRegistrationStartResultSchema = z
119
126
  .object({ outcome: z.enum(REGISTRATION_START_OUTCOMES) })
120
127
  .strict();
@@ -1 +1 @@
1
- {"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/schemas/users.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE9F,6FAA6F;AAC7F,iGAAiG;AACjG,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN,WAAW,EAAE,iBAAiB;IAC9B,qEAAqE;IACrE,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;CAC/B,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAG7G,8FAA8F;AAC9F,iGAAiG;AACjG,gGAAgG;AAChG,2BAA2B;AAC3B,MAAM,CAAC,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;AAEvE,mGAAmG;AACnG,mGAAmG;AACnG,yFAAyF;AACzF,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAExE,kGAAkG;AAClG,4DAA4D;AAC5D,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,SAAS,EAAE,gBAAgB,CAAU,CAAC;AAElF,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC;KACjD,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC,EAAE,CAAC;KACxD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for user accounts and the global role rosters.\n\nimport { z } from 'zod';\nimport { MAX_ADMIN_LIST_CHANGES } from '../constants/business.js';\nimport { userStatusSchema } from '../doc-schemas/atoms.js';\nimport { countSchema, displayNameSchema, repairReasonSchema, userIdSchema } from './atoms.js';\n\n// The signed-in caller finishes registration: profile, public identity, and the display-name\n// reservation are created for `request.auth.uid`. Email comes from the token, never the payload.\nexport const RegisterUserInputSchema = z\n .object({\n displayName: displayNameSchema,\n // The terms checkbox, re-checked server-side: only `true` registers.\n acceptedTerms: z.literal(true),\n })\n .strict();\nexport type RegisterUserInput = z.infer<typeof RegisterUserInputSchema>;\nexport const RegisterUserResultSchema = z.object({ userId: userIdSchema, displayName: z.string() }).strict();\nexport type RegisterUserResult = z.infer<typeof RegisterUserResultSchema>;\n\n// The register form's check before the login is created: is the name free? It runs before any\n// account exists, over the same name rule `registerUser` takes, and is a soft answer — the claim\n// itself is `registerUser`'s transaction, which refuses `already-exists` when two registrations\n// pass this check at once.\nexport const CheckDisplayNameAvailableInputSchema = z.object({ displayName: displayNameSchema }).strict();\nexport type CheckDisplayNameAvailableInput = z.infer<typeof CheckDisplayNameAvailableInputSchema>;\n// Why a name is not available. Uniqueness is the only rule a Q-Sports name is held to beyond its\n// input format.\nexport const DISPLAY_NAME_UNAVAILABLE_REASONS = ['taken'] as const;\nexport type DisplayNameUnavailableReason = (typeof DISPLAY_NAME_UNAVAILABLE_REASONS)[number];\nexport const CheckDisplayNameAvailableResultSchema = z\n .object({ available: z.boolean(), reason: z.enum(DISPLAY_NAME_UNAVAILABLE_REASONS).optional() })\n .strict();\nexport type CheckDisplayNameAvailableResult = z.infer<typeof CheckDisplayNameAvailableResultSchema>;\n\n/** The longest text an admin's account search takes: a name, a full email address, or a uid. */\nexport const MAX_USER_SEARCH_QUERY_LENGTH = 100;\n\n// Which read an admin's account search routes to: a full email address or a 28-character Firebase\n// Auth uid is an exact lookup (`lookupUserByEmailOrUid`), anything else a name search. Declared once:\n// the search box routes by it and the lookup callable re-derives the same answer, so a mis-routed\n// request never looks an email up as a uid or the other way round.\nexport const USER_LOOKUP_EMAIL_PATTERN = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\nexport const USER_LOOKUP_UID_PATTERN = /^[A-Za-z0-9]{28}$/;\nexport type UserSearchKind = 'email' | 'uid' | 'name';\nexport function detectUserSearchKind(query: string): UserSearchKind {\n const trimmed = query.trim();\n if (USER_LOOKUP_EMAIL_PATTERN.test(trimmed)) return 'email';\n if (USER_LOOKUP_UID_PATTERN.test(trimmed)) return 'uid';\n return 'name';\n}\n\n// An admin finds one account by its exact email address or its uid. The answer carries the\n// owner-only email, so it is admin only.\nexport const LookupUserByEmailOrUidInputSchema = z\n .object({ query: z.string().trim().min(1).max(MAX_USER_SEARCH_QUERY_LENGTH) })\n .strict();\nexport type LookupUserByEmailOrUidInput = z.infer<typeof LookupUserByEmailOrUidInputSchema>;\nexport const LookedUpUserSchema = z\n .object({\n uid: userIdSchema,\n displayName: z.string(),\n email: z.string(),\n userStatus: userStatusSchema,\n // Present, and true, only for an account on the admin roster.\n isAdmin: z.literal(true).optional(),\n })\n .strict();\nexport type LookedUpUser = z.infer<typeof LookedUpUserSchema>;\n// The one exact match, or `null` when no account with a profile resolves.\nexport const LookupUserByEmailOrUidResultSchema = z.object({ user: LookedUpUserSchema.nullable() }).strict();\nexport type LookupUserByEmailOrUidResult = z.infer<typeof LookupUserByEmailOrUidResultSchema>;\n\n// An admin searches accounts by the start of their name, over public display identity. Ghosts are\n// not accounts and are left out; a banned account is found, with its status.\nexport const SearchPublicUsersInputSchema = z\n .object({ query: z.string().trim().min(1).max(MAX_USER_SEARCH_QUERY_LENGTH) })\n .strict();\nexport type SearchPublicUsersInput = z.infer<typeof SearchPublicUsersInputSchema>;\nexport const PublicUserSearchResultSchema = z\n .object({ uid: userIdSchema, displayName: z.string(), userStatus: userStatusSchema })\n .strict();\nexport type PublicUserSearchResult = z.infer<typeof PublicUserSearchResultSchema>;\nexport const SearchPublicUsersResultSchema = z.object({ users: z.array(PublicUserSearchResultSchema) }).strict();\nexport type SearchPublicUsersResult = z.infer<typeof SearchPublicUsersResultSchema>;\n\n// An admin renames a user. Self-service rename is not a Q-Sports feature.\nexport const UpdateDisplayNameInputSchema = z\n .object({ userId: userIdSchema, newDisplayName: displayNameSchema })\n .strict();\nexport type UpdateDisplayNameInput = z.infer<typeof UpdateDisplayNameInputSchema>;\nexport const UpdateDisplayNameResultSchema = z.object({ userId: userIdSchema, displayName: z.string() }).strict();\nexport type UpdateDisplayNameResult = z.infer<typeof UpdateDisplayNameResultSchema>;\n\n// An admin grants or revokes the two global roles on `_systemData/adminList`. Four named lists —\n// never a role/action discriminator (BACKEND-002).\nconst adminListChangeSchema = z.array(userIdSchema).max(MAX_ADMIN_LIST_CHANGES).optional();\nexport const UpdateAdminListInputSchema = z\n .object({\n addAdmins: adminListChangeSchema,\n removeAdmins: adminListChangeSchema,\n addReferees: adminListChangeSchema,\n removeReferees: adminListChangeSchema,\n })\n .strict();\nexport type UpdateAdminListInput = z.infer<typeof UpdateAdminListInputSchema>;\nexport const UpdateAdminListResultSchema = z\n .object({\n adminsGranted: countSchema,\n adminsRevoked: countSchema,\n refereesGranted: countSchema,\n refereesRevoked: countSchema,\n })\n .strict();\nexport type UpdateAdminListResult = z.infer<typeof UpdateAdminListResultSchema>;\n\n// An admin bans an account or lifts its ban. The reason is internal — recorded on the audit event,\n// never shown to the account (BACKEND-212). Banning or unbanning to the status the account already\n// holds changes nothing.\nexport const AdminUpdateUserStatusInputSchema = z\n .object({ userId: userIdSchema, userStatus: userStatusSchema, reason: repairReasonSchema })\n .strict();\nexport type AdminUpdateUserStatusInput = z.infer<typeof AdminUpdateUserStatusInputSchema>;\n\n// `changed` is whether the status moved.\nexport const AdminUpdateUserStatusResultSchema = z\n .object({\n userId: userIdSchema,\n userStatus: userStatusSchema,\n previousStatus: userStatusSchema,\n changed: z.boolean(),\n })\n .strict();\nexport type AdminUpdateUserStatusResult = z.infer<typeof AdminUpdateUserStatusResultSchema>;\n\n// The `details.reason` of the refusal to ban an account that holds admin standing (BACKEND-210), so\n// a client can tell it from every other refusal.\nexport const ADMIN_STANDING_BAN_REFUSAL_REASON = 'adminStandingTarget';\n\n// A signed-in login with no profile starts its registration, before `registerUser`: the record the\n// orphan-login cleanup finds it by, and the owner-only private record `registerUser` requires. The\n// caller is `request.auth.uid` and the email comes from its token, so it takes no input.\nexport const CreateRegistrationStartInputSchema = z.object({}).strict();\nexport type CreateRegistrationStartInput = z.infer<typeof CreateRegistrationStartInputSchema>;\n// `started` wrote both records; `alreadyStarted` found the registration already started and wrote\n// nothing — a retry, or a resume after a later step failed.\nexport const REGISTRATION_START_OUTCOMES = ['started', 'alreadyStarted'] as const;\nexport type RegistrationStartOutcome = (typeof REGISTRATION_START_OUTCOMES)[number];\nexport const CreateRegistrationStartResultSchema = z\n .object({ outcome: z.enum(REGISTRATION_START_OUTCOMES) })\n .strict();\nexport type CreateRegistrationStartResult = z.infer<typeof CreateRegistrationStartResultSchema>;\n"]}
1
+ {"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/schemas/users.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,0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AAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC,EAAE,CAAC;KACxD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for user accounts and the global role rosters.\n\nimport { z } from 'zod';\nimport { MAX_ADMIN_LIST_CHANGES } from '../constants/business.js';\nimport { userStatusSchema } from '../doc-schemas/atoms.js';\nimport { countSchema, displayNameSchema, repairReasonSchema, userIdSchema } from './atoms.js';\n\n// The signed-in caller finishes registration: profile, public identity, and the display-name\n// reservation are created for `request.auth.uid`. Email comes from the token, never the payload.\nexport const RegisterUserInputSchema = z\n .object({\n displayName: displayNameSchema,\n // The terms checkbox, re-checked server-side: only `true` registers.\n acceptedTerms: z.literal(true),\n })\n .strict();\nexport type RegisterUserInput = z.infer<typeof RegisterUserInputSchema>;\nexport const RegisterUserResultSchema = z.discriminatedUnion('status', [\n // The account is registered (or already was — an idempotent replay).\n z.object({ status: z.literal('registered'), userId: userIdSchema, displayName: z.string() }).strict(),\n // The orphan-registration cleanup claimed this login for deletion, so the registration cannot\n // finish on it; nothing is written and the person signs up again.\n z.object({ status: z.literal('registrationExpired') }).strict(),\n]);\nexport type RegisterUserResult = z.infer<typeof RegisterUserResultSchema>;\n\n// The register form's check before the login is created: is the name free? It runs before any\n// account exists, over the same name rule `registerUser` takes, and is a soft answer — the claim\n// itself is `registerUser`'s transaction, which refuses `already-exists` when two registrations\n// pass this check at once.\nexport const CheckDisplayNameAvailableInputSchema = z.object({ displayName: displayNameSchema }).strict();\nexport type CheckDisplayNameAvailableInput = z.infer<typeof CheckDisplayNameAvailableInputSchema>;\n// Why a name is not available. Uniqueness is the only rule a Q-Sports name is held to beyond its\n// input format.\nexport const DISPLAY_NAME_UNAVAILABLE_REASONS = ['taken'] as const;\nexport type DisplayNameUnavailableReason = (typeof DISPLAY_NAME_UNAVAILABLE_REASONS)[number];\nexport const CheckDisplayNameAvailableResultSchema = z\n .object({ available: z.boolean(), reason: z.enum(DISPLAY_NAME_UNAVAILABLE_REASONS).optional() })\n .strict();\nexport type CheckDisplayNameAvailableResult = z.infer<typeof CheckDisplayNameAvailableResultSchema>;\n\n/** The longest text an admin's account search takes: a name, a full email address, or a uid. */\nexport const MAX_USER_SEARCH_QUERY_LENGTH = 100;\n\n// Which read an admin's account search routes to: a full email address or a 28-character Firebase\n// Auth uid is an exact lookup (`lookupUserByEmailOrUid`), anything else a name search. Declared once:\n// the search box routes by it and the lookup callable re-derives the same answer, so a mis-routed\n// request never looks an email up as a uid or the other way round.\nexport const USER_LOOKUP_EMAIL_PATTERN = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\nexport const USER_LOOKUP_UID_PATTERN = /^[A-Za-z0-9]{28}$/;\nexport type UserSearchKind = 'email' | 'uid' | 'name';\nexport function detectUserSearchKind(query: string): UserSearchKind {\n const trimmed = query.trim();\n if (USER_LOOKUP_EMAIL_PATTERN.test(trimmed)) return 'email';\n if (USER_LOOKUP_UID_PATTERN.test(trimmed)) return 'uid';\n return 'name';\n}\n\n// An admin finds one account by its exact email address or its uid. The answer carries the\n// owner-only email, so it is admin only.\nexport const LookupUserByEmailOrUidInputSchema = z\n .object({ query: z.string().trim().min(1).max(MAX_USER_SEARCH_QUERY_LENGTH) })\n .strict();\nexport type LookupUserByEmailOrUidInput = z.infer<typeof LookupUserByEmailOrUidInputSchema>;\nexport const LookedUpUserSchema = z\n .object({\n uid: userIdSchema,\n displayName: z.string(),\n email: z.string(),\n userStatus: userStatusSchema,\n // Present, and true, only for an account on the admin roster.\n isAdmin: z.literal(true).optional(),\n })\n .strict();\nexport type LookedUpUser = z.infer<typeof LookedUpUserSchema>;\n// The one exact match, or `null` when no account with a profile resolves.\nexport const LookupUserByEmailOrUidResultSchema = z.object({ user: LookedUpUserSchema.nullable() }).strict();\nexport type LookupUserByEmailOrUidResult = z.infer<typeof LookupUserByEmailOrUidResultSchema>;\n\n// An admin searches accounts by the start of their name, over public display identity. Ghosts are\n// not accounts and are left out; a banned account is found, with its status.\nexport const SearchPublicUsersInputSchema = z\n .object({ query: z.string().trim().min(1).max(MAX_USER_SEARCH_QUERY_LENGTH) })\n .strict();\nexport type SearchPublicUsersInput = z.infer<typeof SearchPublicUsersInputSchema>;\nexport const PublicUserSearchResultSchema = z\n .object({ uid: userIdSchema, displayName: z.string(), userStatus: userStatusSchema })\n .strict();\nexport type PublicUserSearchResult = z.infer<typeof PublicUserSearchResultSchema>;\nexport const SearchPublicUsersResultSchema = z.object({ users: z.array(PublicUserSearchResultSchema) }).strict();\nexport type SearchPublicUsersResult = z.infer<typeof SearchPublicUsersResultSchema>;\n\n// An admin renames a user. Self-service rename is not a Q-Sports feature.\nexport const UpdateDisplayNameInputSchema = z\n .object({ userId: userIdSchema, newDisplayName: displayNameSchema })\n .strict();\nexport type UpdateDisplayNameInput = z.infer<typeof UpdateDisplayNameInputSchema>;\nexport const UpdateDisplayNameResultSchema = z.object({ userId: userIdSchema, displayName: z.string() }).strict();\nexport type UpdateDisplayNameResult = z.infer<typeof UpdateDisplayNameResultSchema>;\n\n// An admin grants or revokes the two global roles on `_systemData/adminList`. Four named lists —\n// never a role/action discriminator (BACKEND-002).\nconst adminListChangeSchema = z.array(userIdSchema).max(MAX_ADMIN_LIST_CHANGES).optional();\nexport const UpdateAdminListInputSchema = z\n .object({\n addAdmins: adminListChangeSchema,\n removeAdmins: adminListChangeSchema,\n addReferees: adminListChangeSchema,\n removeReferees: adminListChangeSchema,\n })\n .strict();\nexport type UpdateAdminListInput = z.infer<typeof UpdateAdminListInputSchema>;\nexport const UpdateAdminListResultSchema = z\n .object({\n adminsGranted: countSchema,\n adminsRevoked: countSchema,\n refereesGranted: countSchema,\n refereesRevoked: countSchema,\n })\n .strict();\nexport type UpdateAdminListResult = z.infer<typeof UpdateAdminListResultSchema>;\n\n// An admin bans an account or lifts its ban. The reason is internal — recorded on the audit event,\n// never shown to the account (BACKEND-212). Banning or unbanning to the status the account already\n// holds changes nothing.\nexport const AdminUpdateUserStatusInputSchema = z\n .object({ userId: userIdSchema, userStatus: userStatusSchema, reason: repairReasonSchema })\n .strict();\nexport type AdminUpdateUserStatusInput = z.infer<typeof AdminUpdateUserStatusInputSchema>;\n\n// `changed` is whether the status moved.\nexport const AdminUpdateUserStatusResultSchema = z\n .object({\n userId: userIdSchema,\n userStatus: userStatusSchema,\n previousStatus: userStatusSchema,\n changed: z.boolean(),\n })\n .strict();\nexport type AdminUpdateUserStatusResult = z.infer<typeof AdminUpdateUserStatusResultSchema>;\n\n// The `details.reason` of the refusal to ban an account that holds admin standing (BACKEND-210), so\n// a client can tell it from every other refusal.\nexport const ADMIN_STANDING_BAN_REFUSAL_REASON = 'adminStandingTarget';\n\n// A signed-in login with no profile starts its registration, before `registerUser`: the record the\n// orphan-login cleanup finds it by, and the owner-only private record `registerUser` requires. The\n// caller is `request.auth.uid` and the email comes from its token, so it takes no input.\nexport const CreateRegistrationStartInputSchema = z.object({}).strict();\nexport type CreateRegistrationStartInput = z.infer<typeof CreateRegistrationStartInputSchema>;\n// `started` wrote both records; `alreadyStarted` found the registration already started and wrote\n// nothing — a retry, or a resume after a later step failed; `registrationExpired` found the login\n// claimed by the orphan-registration cleanup and wrote nothing — the person signs up again.\nexport const REGISTRATION_START_OUTCOMES = ['started', 'alreadyStarted', 'registrationExpired'] as const;\nexport type RegistrationStartOutcome = (typeof REGISTRATION_START_OUTCOMES)[number];\nexport const CreateRegistrationStartResultSchema = z\n .object({ outcome: z.enum(REGISTRATION_START_OUTCOMES) })\n .strict();\nexport type CreateRegistrationStartResult = z.infer<typeof CreateRegistrationStartResultSchema>;\n"]}
@@ -13,6 +13,7 @@ export declare const AdminCreateWaiverTemplateResultSchema: z.ZodObject<{
13
13
  export type AdminCreateWaiverTemplateResult = z.infer<typeof AdminCreateWaiverTemplateResultSchema>;
14
14
  export declare const AdminUpdateWaiverTemplateInputSchema: z.ZodObject<{
15
15
  waiverTemplateId: z.ZodString;
16
+ expectedVersion: z.ZodNumber;
16
17
  title: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
17
18
  waiverText: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
18
19
  }, z.core.$strict>;
@@ -1 +1 @@
1
- {"version":3,"file":"waiver-templates.d.ts","sourceRoot":"","sources":["../../src/schemas/waiver-templates.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,yBAAyB,wDAAsD,CAAC;AAC7F,eAAO,MAAM,wBAAwB,wDAAqD,CAAC;AAE3F,eAAO,MAAM,oCAAoC;;;kBAEtC,CAAC;AACZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAClG,eAAO,MAAM,qCAAqC;;;kBAEvC,CAAC;AACZ,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAIpG,eAAO,MAAM,oCAAoC;;;;kBAMtC,CAAC;AACZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAClG,eAAO,MAAM,qCAAqC;;;;kBAQvC,CAAC;AACZ,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG,eAAO,MAAM,oCAAoC;;kBAEtC,CAAC;AACZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAClG,eAAO,MAAM,qCAAqC;;;;;;kBAKvC,CAAC;AACZ,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC"}
1
+ {"version":3,"file":"waiver-templates.d.ts","sourceRoot":"","sources":["../../src/schemas/waiver-templates.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,yBAAyB,wDAAsD,CAAC;AAC7F,eAAO,MAAM,wBAAwB,wDAAqD,CAAC;AAE3F,eAAO,MAAM,oCAAoC;;;kBAEtC,CAAC;AACZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAClG,eAAO,MAAM,qCAAqC;;;kBAEvC,CAAC;AACZ,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAMpG,eAAO,MAAM,oCAAoC;;;;;kBAOtC,CAAC;AACZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAClG,eAAO,MAAM,qCAAqC;;;;kBAQvC,CAAC;AACZ,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG,eAAO,MAAM,oCAAoC;;kBAEtC,CAAC;AACZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAClG,eAAO,MAAM,qCAAqC;;;;;;kBAKvC,CAAC;AACZ,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC"}
@@ -13,10 +13,13 @@ export const AdminCreateWaiverTemplateResultSchema = z
13
13
  .object({ waiverTemplateId: waiverTemplateIdSchema, version: waiverTemplateVersionNumberSchema })
14
14
  .strict();
15
15
  // The template's whole wording as the admin wants it to read. Wording that differs from the current
16
- // version publishes the next version; the same wording changes nothing.
16
+ // version publishes the next version; the same wording changes nothing. `expectedVersion` is the
17
+ // version the editor loaded: a save whose base is no longer current is refused, so a publication
18
+ // never brings back wording another admin has since replaced.
17
19
  export const AdminUpdateWaiverTemplateInputSchema = z
18
20
  .object({
19
21
  waiverTemplateId: waiverTemplateIdSchema,
22
+ expectedVersion: waiverTemplateVersionNumberSchema,
20
23
  title: waiverTemplateTitleSchema,
21
24
  waiverText: waiverTemplateTextSchema,
22
25
  })
@@ -1 +1 @@
1
- {"version":3,"file":"waiver-templates.js","sourceRoot":"","sources":["../../src/schemas/waiver-templates.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAE7F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,mCAAmC,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EACL,iCAAiC,EACjC,kCAAkC,GACnC,MAAM,2BAA2B,CAAC;AAEnC,MAAM,CAAC,MAAM,yBAAyB,GAAG,eAAe,CAAC,kCAAkC,CAAC,CAAC;AAC7F,MAAM,CAAC,MAAM,wBAAwB,GAAG,eAAe,CAAC,iCAAiC,CAAC,CAAC;AAE3F,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC,EAAE,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,wBAAwB,EAAE,CAAC;KAClF,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC;KACnD,MAAM,CAAC,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;KAChG,MAAM,EAAE,CAAC;AAGZ,oGAAoG;AACpG,wEAAwE;AACxE,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC;IACN,gBAAgB,EAAE,sBAAsB;IACxC,KAAK,EAAE,yBAAyB;IAChC,UAAU,EAAE,wBAAwB;CACrC,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC;KACnD,MAAM,CAAC;IACN,gBAAgB,EAAE,sBAAsB;IACxC,iDAAiD;IACjD,OAAO,EAAE,iCAAiC;IAC1C,8EAA8E;IAC9E,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;CACvB,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,CAAC;KACpD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC;KACnD,MAAM,CAAC;IACN,gBAAgB,EAAE,sBAAsB;IACxC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,mCAAmC,CAAC;CACrD,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for waiver templates: create, save new wording, and delete. Admin only.\n\nimport { z } from 'zod';\nimport { textFieldSchema } from '../doc-schemas/atoms.js';\nimport {\n waiverTemplateIdSchema,\n waiverTemplateVersionNumberSchema,\n} from '../doc-schemas/waiver-template.js';\nimport { WAIVER_TEMPLATE_DELETE_OUTCOME_KEYS } from '../types/unions.js';\nimport {\n WAIVER_TEMPLATE_TEXT_INPUT_FORMAT,\n WAIVER_TEMPLATE_TITLE_INPUT_FORMAT,\n} from '../input-formats/index.js';\n\nexport const waiverTemplateTitleSchema = textFieldSchema(WAIVER_TEMPLATE_TITLE_INPUT_FORMAT);\nexport const waiverTemplateTextSchema = textFieldSchema(WAIVER_TEMPLATE_TEXT_INPUT_FORMAT);\n\nexport const AdminCreateWaiverTemplateInputSchema = z\n .object({ title: waiverTemplateTitleSchema, waiverText: waiverTemplateTextSchema })\n .strict();\nexport type AdminCreateWaiverTemplateInput = z.infer<typeof AdminCreateWaiverTemplateInputSchema>;\nexport const AdminCreateWaiverTemplateResultSchema = z\n .object({ waiverTemplateId: waiverTemplateIdSchema, version: waiverTemplateVersionNumberSchema })\n .strict();\nexport type AdminCreateWaiverTemplateResult = z.infer<typeof AdminCreateWaiverTemplateResultSchema>;\n\n// The template's whole wording as the admin wants it to read. Wording that differs from the current\n// version publishes the next version; the same wording changes nothing.\nexport const AdminUpdateWaiverTemplateInputSchema = z\n .object({\n waiverTemplateId: waiverTemplateIdSchema,\n title: waiverTemplateTitleSchema,\n waiverText: waiverTemplateTextSchema,\n })\n .strict();\nexport type AdminUpdateWaiverTemplateInput = z.infer<typeof AdminUpdateWaiverTemplateInputSchema>;\nexport const AdminUpdateWaiverTemplateResultSchema = z\n .object({\n waiverTemplateId: waiverTemplateIdSchema,\n // The template's current version after the save.\n version: waiverTemplateVersionNumberSchema,\n // False when the wording matched the current version and nothing was written.\n published: z.boolean(),\n })\n .strict();\nexport type AdminUpdateWaiverTemplateResult = z.infer<typeof AdminUpdateWaiverTemplateResultSchema>;\n\nexport const AdminDeleteWaiverTemplateInputSchema = z\n .object({ waiverTemplateId: waiverTemplateIdSchema })\n .strict();\nexport type AdminDeleteWaiverTemplateInput = z.infer<typeof AdminDeleteWaiverTemplateInputSchema>;\nexport const AdminDeleteWaiverTemplateResultSchema = z\n .object({\n waiverTemplateId: waiverTemplateIdSchema,\n outcome: z.enum(WAIVER_TEMPLATE_DELETE_OUTCOME_KEYS),\n })\n .strict();\nexport type AdminDeleteWaiverTemplateResult = z.infer<typeof AdminDeleteWaiverTemplateResultSchema>;\n"]}
1
+ {"version":3,"file":"waiver-templates.js","sourceRoot":"","sources":["../../src/schemas/waiver-templates.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAE7F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,mCAAmC,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EACL,iCAAiC,EACjC,kCAAkC,GACnC,MAAM,2BAA2B,CAAC;AAEnC,MAAM,CAAC,MAAM,yBAAyB,GAAG,eAAe,CAAC,kCAAk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and delete. Admin only.\n\nimport { z } from 'zod';\nimport { textFieldSchema } from '../doc-schemas/atoms.js';\nimport {\n waiverTemplateIdSchema,\n waiverTemplateVersionNumberSchema,\n} from '../doc-schemas/waiver-template.js';\nimport { WAIVER_TEMPLATE_DELETE_OUTCOME_KEYS } from '../types/unions.js';\nimport {\n WAIVER_TEMPLATE_TEXT_INPUT_FORMAT,\n WAIVER_TEMPLATE_TITLE_INPUT_FORMAT,\n} from '../input-formats/index.js';\n\nexport const waiverTemplateTitleSchema = textFieldSchema(WAIVER_TEMPLATE_TITLE_INPUT_FORMAT);\nexport const waiverTemplateTextSchema = textFieldSchema(WAIVER_TEMPLATE_TEXT_INPUT_FORMAT);\n\nexport const AdminCreateWaiverTemplateInputSchema = z\n .object({ title: waiverTemplateTitleSchema, waiverText: waiverTemplateTextSchema })\n .strict();\nexport type AdminCreateWaiverTemplateInput = z.infer<typeof AdminCreateWaiverTemplateInputSchema>;\nexport const AdminCreateWaiverTemplateResultSchema = z\n .object({ waiverTemplateId: waiverTemplateIdSchema, version: waiverTemplateVersionNumberSchema })\n .strict();\nexport type AdminCreateWaiverTemplateResult = z.infer<typeof AdminCreateWaiverTemplateResultSchema>;\n\n// The template's whole wording as the admin wants it to read. Wording that differs from the current\n// version publishes the next version; the same wording changes nothing. `expectedVersion` is the\n// version the editor loaded: a save whose base is no longer current is refused, so a publication\n// never brings back wording another admin has since replaced.\nexport const AdminUpdateWaiverTemplateInputSchema = z\n .object({\n waiverTemplateId: waiverTemplateIdSchema,\n expectedVersion: waiverTemplateVersionNumberSchema,\n title: waiverTemplateTitleSchema,\n waiverText: waiverTemplateTextSchema,\n })\n .strict();\nexport type AdminUpdateWaiverTemplateInput = z.infer<typeof AdminUpdateWaiverTemplateInputSchema>;\nexport const AdminUpdateWaiverTemplateResultSchema = z\n .object({\n waiverTemplateId: waiverTemplateIdSchema,\n // The template's current version after the save.\n version: waiverTemplateVersionNumberSchema,\n // False when the wording matched the current version and nothing was written.\n published: z.boolean(),\n })\n .strict();\nexport type AdminUpdateWaiverTemplateResult = z.infer<typeof AdminUpdateWaiverTemplateResultSchema>;\n\nexport const AdminDeleteWaiverTemplateInputSchema = z\n .object({ waiverTemplateId: waiverTemplateIdSchema })\n .strict();\nexport type AdminDeleteWaiverTemplateInput = z.infer<typeof AdminDeleteWaiverTemplateInputSchema>;\nexport const AdminDeleteWaiverTemplateResultSchema = z\n .object({\n waiverTemplateId: waiverTemplateIdSchema,\n outcome: z.enum(WAIVER_TEMPLATE_DELETE_OUTCOME_KEYS),\n })\n .strict();\nexport type AdminDeleteWaiverTemplateResult = z.infer<typeof AdminDeleteWaiverTemplateResultSchema>;\n"]}
@@ -5,6 +5,7 @@ export * from './scoring.js';
5
5
  export * from './scoring-display.js';
6
6
  export * from './bulk-entry.js';
7
7
  export * from './replay.js';
8
+ export * from './ledger-continuity.js';
8
9
  export * from './store-driver.js';
9
10
  export * from './contribution.js';
10
11
  export * from './finalized-record.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sports/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC3G,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sports/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC3G,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
@@ -7,6 +7,7 @@ export * from './scoring.js';
7
7
  export * from './scoring-display.js';
8
8
  export * from './bulk-entry.js';
9
9
  export * from './replay.js';
10
+ export * from './ledger-continuity.js';
10
11
  export * from './store-driver.js';
11
12
  export * from './contribution.js';
12
13
  export * from './finalized-record.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sports/index.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,6BAA6B;AAE7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["// The sport adapters. A sport is selected only through the registry (SPORT-002), so the individual\n// adapters are not exported.\n\nexport * from './column-catalog.js';\nexport * from './sport-adapter.js';\nexport * from './shared-columns.js';\nexport * from './scoring.js';\nexport * from './scoring-display.js';\nexport * from './bulk-entry.js';\nexport * from './replay.js';\nexport * from './store-driver.js';\nexport * from './contribution.js';\nexport * from './finalized-record.js';\nexport * from './rankings.js';\nexport * from './rollup-check.js';\nexport type { LifetimeSummary, LifetimeSummaryAverage, LifetimeSummaryTotal } from './lifetime-summary.js';\nexport { basketballFantasyPoints } from './basketball-scoring.js';\nexport { SPORT_ADAPTERS, SPORT_ADAPTER_LIST, UnknownSportError, getSportAdapter } from './registry.js';\nexport { gameScoreMirror } from './score-mirror.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sports/index.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,6BAA6B;AAE7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["// The sport adapters. A sport is selected only through the registry (SPORT-002), so the individual\n// adapters are not exported.\n\nexport * from './column-catalog.js';\nexport * from './sport-adapter.js';\nexport * from './shared-columns.js';\nexport * from './scoring.js';\nexport * from './scoring-display.js';\nexport * from './bulk-entry.js';\nexport * from './replay.js';\nexport * from './ledger-continuity.js';\nexport * from './store-driver.js';\nexport * from './contribution.js';\nexport * from './finalized-record.js';\nexport * from './rankings.js';\nexport * from './rollup-check.js';\nexport type { LifetimeSummary, LifetimeSummaryAverage, LifetimeSummaryTotal } from './lifetime-summary.js';\nexport { basketballFantasyPoints } from './basketball-scoring.js';\nexport { SPORT_ADAPTERS, SPORT_ADAPTER_LIST, UnknownSportError, getSportAdapter } from './registry.js';\nexport { gameScoreMirror } from './score-mirror.js';\n"]}
@@ -0,0 +1,13 @@
1
+ /** The first place a ledger departs from 1..n: a sequence missing, or one held by two events. */
2
+ export type LedgerContinuityBreak = {
3
+ readonly kind: 'gap';
4
+ readonly missingSequence: number;
5
+ } | {
6
+ readonly kind: 'duplicate';
7
+ readonly sequence: number;
8
+ };
9
+ /** `null` when the events hold exactly the sequences 1..n (an empty ledger included); otherwise the first break. */
10
+ export declare function findLedgerContinuityBreak(events: readonly {
11
+ readonly sequence: number;
12
+ }[]): LedgerContinuityBreak | null;
13
+ //# sourceMappingURL=ledger-continuity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ledger-continuity.d.ts","sourceRoot":"","sources":["../../src/sports/ledger-continuity.ts"],"names":[],"mappings":"AAKA,iGAAiG;AACjG,MAAM,MAAM,qBAAqB,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,oHAAoH;AACpH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,qBAAqB,GAAG,IAAI,CAUxH"}
@@ -0,0 +1,19 @@
1
+ // Whether a game's event ledger holds exactly the sequences 1..n. `statEventSequence` is both the
2
+ // number of events and the last sequence given, so a gap or a duplicate is out-of-band damage: the
3
+ // check reports it, and finalize and the restore refuse it. The event documents are the source of
4
+ // truth (SPORT-101), so nothing renumbers them to close a gap.
5
+ /** `null` when the events hold exactly the sequences 1..n (an empty ledger included); otherwise the first break. */
6
+ export function findLedgerContinuityBreak(events) {
7
+ const sequences = events.map((event) => event.sequence).sort((left, right) => left - right);
8
+ for (let index = 0; index < sequences.length; index += 1) {
9
+ const expected = index + 1;
10
+ const sequence = sequences[index];
11
+ if (sequence === expected)
12
+ continue;
13
+ if (index > 0 && sequence === sequences[index - 1])
14
+ return { kind: 'duplicate', sequence };
15
+ return { kind: 'gap', missingSequence: expected };
16
+ }
17
+ return null;
18
+ }
19
+ //# sourceMappingURL=ledger-continuity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ledger-continuity.js","sourceRoot":"","sources":["../../src/sports/ledger-continuity.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,mGAAmG;AACnG,kGAAkG;AAClG,+DAA+D;AAO/D,oHAAoH;AACpH,MAAM,UAAU,yBAAyB,CAAC,MAAgD;IACxF,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;IAC5F,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACzD,MAAM,QAAQ,GAAG,KAAK,GAAG,CAAC,CAAC;QAC3B,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,QAAQ,KAAK,QAAQ;YAAE,SAAS;QACpC,IAAI,KAAK,GAAG,CAAC,IAAI,QAAQ,KAAK,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC;YAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;QAC3F,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC;IACpD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["// Whether a game's event ledger holds exactly the sequences 1..n. `statEventSequence` is both the\n// number of events and the last sequence given, so a gap or a duplicate is out-of-band damage: the\n// check reports it, and finalize and the restore refuse it. The event documents are the source of\n// truth (SPORT-101), so nothing renumbers them to close a gap.\n\n/** The first place a ledger departs from 1..n: a sequence missing, or one held by two events. */\nexport type LedgerContinuityBreak =\n | { readonly kind: 'gap'; readonly missingSequence: number }\n | { readonly kind: 'duplicate'; readonly sequence: number };\n\n/** `null` when the events hold exactly the sequences 1..n (an empty ledger included); otherwise the first break. */\nexport function findLedgerContinuityBreak(events: readonly { readonly sequence: number }[]): LedgerContinuityBreak | null {\n const sequences = events.map((event) => event.sequence).sort((left, right) => left - right);\n for (let index = 0; index < sequences.length; index += 1) {\n const expected = index + 1;\n const sequence = sequences[index];\n if (sequence === expected) continue;\n if (index > 0 && sequence === sequences[index - 1]) return { kind: 'duplicate', sequence };\n return { kind: 'gap', missingSequence: expected };\n }\n return null;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { SystemRole } from './unions.js';
2
2
  import { CAPTAIN_TEAM_ROLES } from './unions.js';
3
- export declare const AUDIT_EVENT_TYPE_KEYS: readonly ["user.accountRegistered", "user.displayNameChanged", "user.abandonedRegistrationDeleted", "user.accountBanned", "user.accountUnbanned", "admin.systemRoleGranted", "admin.systemRoleRevoked", "admin.systemRoleClaimSynced", "appConfig.updated", "landingPage.updated", "league.created", "league.updated", "league.statusChanged", "league.modeSwitched", "waiverTemplate.created", "waiverTemplate.versionPublished", "waiverTemplate.retired", "waiverTemplate.deleted", "gameLocation.created", "gameLocation.updated", "gameLocation.deleted", "picture.added", "picture.replaced", "picture.moved", "picture.featuredChanged", "picture.removed", "award.created", "award.badgeReplaced", "award.deleted", "award.granted", "award.revoked", "hardwareLoanContract.created", "hardwareLoanContract.signed", "hardwareLoanContract.returned", "hardwareLoanContract.deleted", "leagueTeam.created", "ghostPlayer.created", "teamRoster.syncRetried", "teamMembership.roleChanged", "leagueTeam.captainChanged", "leagueTeam.updated", "leagueTeamContact.updated", "teamMembership.removed", "ghostPlayer.removed", "ghostPlayer.linked", "ghostPlayer.closedLeagueLinked", "leagueTeam.deleted", "ghostPlayer.removalStopped", "teamInvitation.created", "teamInvitation.cancelled", "teamInvitation.accepted", "teamInvitation.rejected", "teamJoinRequest.created", "teamJoinRequest.cancelled", "teamJoinRequest.accepted", "teamJoinRequest.rejected", "leagueFreeAgent.created", "leagueFreeAgent.deleted", "leagueFreeAgent.assigned", "signedWaiver.created", "scheduleWeek.created", "scheduleWeek.updated", "sportGame.created", "sportGame.updated", "sportGame.deleted", "sportGame.statEventsRejected", "sportGame.absenceChanged", "sportGame.memoUpdated", "sportGame.jumpBallChanged", "sportGame.finalized", "sportGame.reopened", "sportGame.statsCorrected", "sportGame.statsRecalculated", "stats.aggregateRecalculated", "stats.historicalStatsUpdated", "stats.validationRun", "stats.validationReportDeleted", "stats.unrosteredStatLineResolved", "adminNotification.archived", "adminNotification.archiveAllRequested", "system.manualIntervention", "migrationAction.pageRun", "migrationAction.controlRecorded", "migrationAction.checkpointRecorded", "migrationConsole.cutoverRecorded"];
3
+ export declare const AUDIT_EVENT_TYPE_KEYS: readonly ["user.accountRegistered", "user.displayNameChanged", "user.abandonedRegistrationDeleted", "user.accountBanned", "user.accountUnbanned", "admin.systemRoleGranted", "admin.systemRoleRevoked", "admin.systemRoleClaimSynced", "appConfig.updated", "landingPage.updated", "league.created", "league.updated", "league.statusChanged", "league.modeSwitched", "waiverTemplate.created", "waiverTemplate.versionPublished", "waiverTemplate.retired", "waiverTemplate.deleted", "gameLocation.created", "gameLocation.updated", "gameLocation.deleted", "picture.added", "picture.replaced", "picture.moved", "picture.featuredChanged", "picture.removed", "award.created", "award.badgeReplaced", "award.deleted", "award.granted", "award.revoked", "hardwareLoanContract.created", "hardwareLoanContract.signed", "hardwareLoanContract.returned", "hardwareLoanContract.deleted", "leagueTeam.created", "ghostPlayer.created", "teamRoster.syncRetried", "teamMembership.roleChanged", "leagueTeam.captainChanged", "leagueTeam.updated", "leagueTeamContact.updated", "teamMembership.removed", "ghostPlayer.removed", "ghostPlayer.linked", "ghostPlayer.closedLeagueLinked", "leagueTeam.deleted", "ghostPlayer.removalStopped", "teamInvitation.created", "teamInvitation.cancelled", "teamInvitation.accepted", "teamInvitation.rejected", "teamJoinRequest.created", "teamJoinRequest.cancelled", "teamJoinRequest.accepted", "teamJoinRequest.rejected", "leagueFreeAgent.created", "leagueFreeAgent.deleted", "leagueFreeAgent.assigned", "signedWaiver.created", "scheduleWeek.created", "scheduleWeek.updated", "sportGame.created", "sportGame.updated", "sportGame.deleted", "sportGame.statEventsRejected", "sportGame.absenceChanged", "sportGame.memoUpdated", "sportGame.jumpBallChanged", "sportGame.finalized", "sportGame.reopened", "sportGame.statsCorrected", "sportGame.statsRecalculated", "stats.aggregateRecalculated", "stats.historicalStatsUpdated", "stats.validationRun", "stats.validationReportDeleted", "stats.unrosteredStatLineResolved", "adminNotification.archived", "adminNotification.archiveAllRequested", "system.manualIntervention", "migrationAction.pageRun", "migrationAction.writesCommitted", "migrationAction.controlRecorded", "migrationAction.checkpointRecorded", "migrationConsole.cutoverRecorded"];
4
4
  export type AuditEventType = (typeof AUDIT_EVENT_TYPE_KEYS)[number];
5
5
  export declare const GHOST_LINK_AUDIT_EVENT_TYPE_KEYS: readonly ["ghostPlayer.linked", "ghostPlayer.closedLeagueLinked"];
6
6
  export type GhostLinkAuditEventType = (typeof GHOST_LINK_AUDIT_EVENT_TYPE_KEYS)[number];
@@ -1 +1 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/types/audit.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,qBAAqB,usEAoIxB,CAAC;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAIpE,eAAO,MAAM,gCAAgC,mEAGC,CAAC;AAC/C,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,gCAAgC,CAAC,CAAC,MAAM,CAAC,CAAC;AAUxF,eAAO,MAAM,qBAAqB,4EAA6E,CAAC;AAChH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,eAAO,MAAM,2BAA2B,2CAAgF,CAAC;AACzH,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/E,eAAO,MAAM,+BAA+B,4CAAiF,CAAC;AAC9H,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtF,eAAO,MAAM,wBAAwB,mDAAoD,CAAC;AAC1F,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CA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AAC,MAAM,CAAC,CAAC;AAE/E,eAAO,MAAM,+BAA+B,4CAAiF,CAAC;AAC9H,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtF,eAAO,MAAM,wBAAwB,mDAAoD,CAAC;AAC1F,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAMlE,MAAM,MAAM,UAAU,GAClB;IAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,sBAAsB,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,GAC/F;IAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,mBAAmB,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAE,CAAC;AAErG,MAAM,WAAW,WAAW;IAE1B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAED,eAAO,MAAM,iBAAiB,iCAAkC,CAAC;AACjE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -129,9 +129,12 @@ export const AUDIT_EVENT_TYPE_KEYS = [
129
129
  // or a refused attempt at one — with the reason the operator gave
130
130
  'system.manualIntervention',
131
131
  // The migration console — one page of a cutover action run, with what it read, wrote, and found;
132
- // a product control's run recorded once its evidence checked; an operator checkpoint recorded with
133
- // its evidence; and the cutover, after which the product owns every destination
132
+ // the documents an action core wrote and removed, committed in the same batch or transaction as
133
+ // those writes (its action id, operation id, and document ids only — BACKEND-203); a product
134
+ // control's run recorded once its evidence checked; an operator checkpoint recorded with its
135
+ // evidence; and the cutover, after which the product owns every destination
134
136
  'migrationAction.pageRun',
137
+ 'migrationAction.writesCommitted',
135
138
  'migrationAction.controlRecorded',
136
139
  'migrationAction.checkpointRecorded',
137
140
  'migrationConsole.cutoverRecorded',
@@ -1 +1 @@
1
- {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/types/audit.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0EAA0E;AAC1E,EAAE;AACF,4FAA4F;AAC5F,iBAAiB;AAKjB,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,WAAW;IACX,wBAAwB;IACxB,yBAAyB;IACzB,6FAA6F;IAC7F,mCAAmC;IACnC,gEAAgE;IAChE,oBAAoB;IACpB,sBAAsB;IACtB,oFAAoF;IACpF,yBAAyB;IACzB,yBAAyB;IACzB,6BAA6B;IAC7B,4FAA4F;IAC5F,mBAAmB;IACnB,qBAAqB;IACrB,kEAAkE;IAClE,gBAAgB;IAChB,gBAAgB;IAChB,sBAAsB;IACtB,qBAAqB;IACrB,0EAA0E;IAC1E,wBAAwB;IACxB,iCAAiC;IACjC,wBAAwB;IACxB,wBAAwB;IACxB,iBAAiB;IACjB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,gGAAgG;IAChG,sFAAsF;IACtF,eAAe;IACf,kBAAkB;IAClB,eAAe;IACf,yBAAyB;IACzB,iBAAiB;IACjB,4FAA4F;IAC5F,oFAAoF;IACpF,eAAe;IACf,qBAAqB;IACrB,eAAe;IACf,eAAe;IACf,eAAe;IACf,mGAAmG;IACnG,gCAAgC;IAChC,8BAA8B;IAC9B,6BAA6B;IAC7B,+BAA+B;IAC/B,8BAA8B;IAC9B,8FAA8F;IAC9F,oBAAoB;IACpB,qBAAqB;IACrB,wBAAwB;IACxB,iGAAiG;IACjG,8FAA8F;IAC9F,4BAA4B;IAC5B,2BAA2B;IAC3B,oBAAoB;IACpB,2BAA2B;IAC3B,mGAAmG;IAC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C/D,6FAA6F;AAC7F,sFAAsF;AACtF,4FAA4F;AAC5F,0DAA0D;AAC1D,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,QAAQ,CAAU,CAAC;AAGhH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,aAAa,EAAE,eAAe,CAA8C,CAAC;AAGzH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,CAA8C,CAAC;AAG9H,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,SAAS,EAAE,cAAc,EAAE,WAAW,CAAU,CAAC;AAoB1F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,SAAS,CAAU,CAAC","sourcesContent":["// The audit vocabulary: the closed event-type union (BACKEND-202) and how an actor was acting\n// (BACKEND-205). The document schema is in ../doc-schemas/audit-event.ts.\n//\n// The union is closed: a new sensitive action adds its event types here, in the same change\n// (BACKEND-202).\n\nimport type { SystemRole } from './unions.js';\nimport { CAPTAIN_TEAM_ROLES } from './unions.js';\n\nexport const AUDIT_EVENT_TYPE_KEYS = [\n // Accounts\n 'user.accountRegistered',\n 'user.displayNameChanged',\n // The scheduled sweep deleted a sign-in account that never finished registering (no profile)\n 'user.abandonedRegistrationDeleted',\n // Account status — an admin banned an account or lifted its ban\n 'user.accountBanned',\n 'user.accountUnbanned',\n // Global roles — the policy decision (callable) and the claim propagation (trigger)\n 'admin.systemRoleGranted',\n 'admin.systemRoleRevoked',\n 'admin.systemRoleClaimSynced',\n // App configuration — the operational levers on `_appConfig/app`, and the landing page copy\n 'appConfig.updated',\n 'landingPage.updated',\n // Leagues — created, settings edited, status moved, mode switched\n 'league.created',\n 'league.updated',\n 'league.statusChanged',\n 'league.modeSwitched',\n // Waiver templates — created, a new wording published, retired or deleted\n 'waiverTemplate.created',\n 'waiverTemplate.versionPublished',\n 'waiverTemplate.retired',\n 'waiverTemplate.deleted',\n // Game locations\n 'gameLocation.created',\n 'gameLocation.updated',\n 'gameLocation.deleted',\n // Pictures — published to a gallery or a slot by the picture processor (attributed to the admin\n // who uploaded it), and ordered, featured, and removed by the admin picture callables\n 'picture.added',\n 'picture.replaced',\n 'picture.moved',\n 'picture.featuredChanged',\n 'picture.removed',\n // Awards — an award created by its first badge's publication, its badge replaced, the award\n // deleted once nobody holds it, and an award granted to or revoked from one account\n 'award.created',\n 'award.badgeReplaced',\n 'award.deleted',\n 'award.granted',\n 'award.revoked',\n // Hardware contracts — a loan created for a referee, signed by them, its equipment returned, and a\n // contract never signed deleted\n 'hardwareLoanContract.created',\n 'hardwareLoanContract.signed',\n 'hardwareLoanContract.returned',\n 'hardwareLoanContract.deleted',\n // Teams — created with its captain, a ghost player added, a team's failed roster work retried\n 'leagueTeam.created',\n 'ghostPlayer.created',\n 'teamRoster.syncRetried',\n // Team management — a member promoted to co-captain or demoted to player, the captain changed by\n // an admin, the team's name or type edited by an admin, and its contact phone set by an admin\n 'teamMembership.roleChanged',\n 'leagueTeam.captainChanged',\n 'leagueTeam.updated',\n 'leagueTeamContact.updated',\n // Exits — a membership removed, a never-played ghost removed, a ghost linked by either link, and a\n // never-played team deleted; each targets what it deleted, which the migration's live\n // verifications read as proof the product removed it\n 'teamMembership.removed',\n 'ghostPlayer.removed',\n 'ghostPlayer.linked',\n 'ghostPlayer.closedLeagueLinked',\n 'leagueTeam.deleted',\n // A ghost's removal stopped part-way because the ghost came to have played: the games it held are\n // released, and the finished-game entries it had already taken off are named\n 'ghostPlayer.removalStopped',\n // Joining a team — an invitation sent, withdrawn, accepted, or declined; a join request sent,\n // withdrawn, accepted, or rejected; a free-agent signup made, withdrawn, or answered by an admin\n // placing the player on a team\n 'teamInvitation.created',\n 'teamInvitation.cancelled',\n 'teamInvitation.accepted',\n 'teamInvitation.rejected',\n 'teamJoinRequest.created',\n 'teamJoinRequest.cancelled',\n 'teamJoinRequest.accepted',\n 'teamJoinRequest.rejected',\n 'leagueFreeAgent.created',\n 'leagueFreeAgent.deleted',\n 'leagueFreeAgent.assigned',\n // Signed waivers — a legal record, signed by its subject or witnessed for a ghost\n 'signedWaiver.created',\n // Schedules — a week created with its games or its shared fields edited; one game added, edited\n // (moved, rescheduled, or its teams replaced), or deleted with its events and roster\n 'scheduleWeek.created',\n 'scheduleWeek.updated',\n 'sportGame.created',\n 'sportGame.updated',\n 'sportGame.deleted',\n // Live scoring — a scoring write refused its caller's authority (a click writes no success event:\n // the stat event document is its own record), a roster entry marked absent or present, a\n // scorer's note on one person changed, and the jump-ball possession arrow moved\n 'sportGame.statEventsRejected',\n 'sportGame.absenceChanged',\n 'sportGame.memoUpdated',\n 'sportGame.jumpBallChanged',\n // Finalizing — a game finalized, its numbers made permanent in every derived destination, and an\n // admin's reopening of a finalized game, which takes them back out\n 'sportGame.finalized',\n 'sportGame.reopened',\n // Fix stats — a game's numbers corrected (targets, or the stored numbers kept) or restored from\n // its events; a derived aggregate rebuilt; and a person's pre-Q-Sports baseline written\n 'sportGame.statsCorrected',\n 'sportGame.statsRecalculated',\n 'stats.aggregateRecalculated',\n 'stats.historicalStatsUpdated',\n // A stats check ran to its end: its scope, its summary, and its counts by kind.\n 'stats.validationRun',\n // An admin deleted a stats check's report: its id, scope, summary, and counts by kind.\n 'stats.validationReportDeleted',\n // The migration's placement of a recorded stat line no roster entry or play could place: the\n // admin names the team, and the game's copy places the line there\n 'stats.unrosteredStatLineResolved',\n // Admin notifications — a shared card archived, which takes it off every admin's list; and an\n // admin's archive-all decision, recorded once when the job is written, with the request's origin\n 'adminNotification.archived',\n 'adminNotification.archiveAllRequested',\n // An operator's manual intervention in a durable pipeline — a dead-lettered row put back to work,\n // or a refused attempt at one — with the reason the operator gave\n 'system.manualIntervention',\n // The migration console — one page of a cutover action run, with what it read, wrote, and found;\n // a product control's run recorded once its evidence checked; an operator checkpoint recorded with\n // its evidence; and the cutover, after which the product owns every destination\n 'migrationAction.pageRun',\n 'migrationAction.controlRecorded',\n 'migrationAction.checkpointRecorded',\n 'migrationConsole.cutoverRecorded',\n] as const;\nexport type AuditEventType = (typeof AUDIT_EVENT_TYPE_KEYS)[number];\n\n// The two ways a ghost is linked to an account — the normal link and the closed-league link — each\n// committing its own event over the one artifact-moving core.\nexport const GHOST_LINK_AUDIT_EVENT_TYPE_KEYS = [\n 'ghostPlayer.linked',\n 'ghostPlayer.closedLeagueLinked',\n] as const satisfies readonly AuditEventType[];\nexport type GhostLinkAuditEventType = (typeof GHOST_LINK_AUDIT_EVENT_TYPE_KEYS)[number];\n\n// How the actor was acting for the write — never merely which authorities they happen to hold. It is\n// orthogonal to the event type: one event type is produced under several modes, and the mode is what\n// tells an ordinary action from an admin override.\n// user a signed-in account acting on its own behalf\n// teamManager a captain or co-captain acting through their team's membership permissions\n// adminReview an admin or referee doing admin work that no team permission covers\n// adminOverride an admin or referee superseding the team permission a normal entry checks\n// system backend automation with no human caller\nexport const AUDIT_ACTOR_MODE_KEYS = ['user', 'teamManager', 'adminReview', 'adminOverride', 'system'] as const;\nexport type AuditActorMode = (typeof AUDIT_ACTOR_MODE_KEYS)[number];\n\nexport const AUDIT_ADMIN_ACTOR_MODE_KEYS = ['adminReview', 'adminOverride'] as const satisfies readonly AuditActorMode[];\nexport type AuditAdminActorMode = (typeof AUDIT_ADMIN_ACTOR_MODE_KEYS)[number];\n\nexport const AUDIT_NON_ADMIN_ACTOR_MODE_KEYS = ['user', 'teamManager', 'system'] as const satisfies readonly AuditActorMode[];\nexport type AuditNonAdminActorMode = (typeof AUDIT_NON_ADMIN_ACTOR_MODE_KEYS)[number];\n\nexport const AUDIT_SYSTEM_REASON_KEYS = ['trigger', 'scheduledJob', 'migration'] as const;\nexport type AuditSystemReason = (typeof AUDIT_SYSTEM_REASON_KEYS)[number];\n\nexport type CaptainTeamRole = (typeof CAPTAIN_TEAM_ROLES)[number];\n\n// `isAdmin` is metadata only: it records that the caller's token carried a global-role claim (admin\n// or referee) when they acted, and grants nothing. `systemRole` is required on the admin modes and\n// forbidden on the others, so an admin action is never recorded without the authority it used and a\n// non-admin action never carries one.\nexport type AuditActor =\n | { uid: string | null; isAdmin: boolean; actorMode: AuditNonAdminActorMode; systemRole?: never }\n | { uid: string | null; isAdmin: boolean; actorMode: AuditAdminActorMode; systemRole: SystemRole };\n\nexport interface AuditTarget {\n // The user the action was performed on, when there is one.\n uid: string | null;\n // The slash path of the document the action changed, when there is one.\n ref: string | null;\n}\n\nexport const AUDIT_RESULT_KEYS = ['success', 'failure'] as const;\nexport type AuditResult = (typeof AUDIT_RESULT_KEYS)[number];\n"]}
1
+ {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/types/audit.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0EAA0E;AAC1E,EAAE;AACF,4FAA4F;AAC5F,iBAAiB;AAKjB,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,WAAW;IACX,wBAAwB;IACxB,yBAAyB;IACzB,6FAA6F;IAC7F,mCAAmC;IACnC,gEAAgE;IAChE,oBAAoB;IACpB,sBAAsB;IACtB,oFAAoF;IACpF,yBAAyB;IACzB,yBAAyB;IACzB,6BAA6B;IAC7B,4FAA4F;IAC5F,mBAAmB;IACnB,qBAAqB;IACrB,kEAAkE;IAClE,gBAAgB;IAChB,gBAAgB;IAChB,sBAAsB;IACtB,qBAAqB;IACrB,0EAA0E;IAC1E,wBAAwB;IACxB,iCAAiC;IACjC,wBAAwB;IACxB,wBAAwB;IACxB,iBAAiB;IACjB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,gGAAgG;IAChG,sFAAsF;IACtF,eAAe;IACf,kBAAkB;IAClB,eAAe;IACf,yBAAyB;IACzB,iBAAiB;IACjB,4FAA4F;IAC5F,oFAAoF;IACpF,eAAe;IACf,qBAAqB;IACrB,eAAe;IACf,eAAe;IACf,eAAe;IACf,mGAAmG;IACnG,gCAAgC;IAChC,8BAA8B;IAC9B,6BAA6B;IAC7B,+BAA+B;IAC/B,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C,iCAAiC;IACjC,oCAAoC;IACpC,kCAAkC;CAC1B,CAAC;AAGX,mGAAmG;AACnG,8DAA8D;AAC9D,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,oBAAoB;IACpB,gCAAgC;CACY,CAAC;AAG/C,qGAAqG;AACrG,qGAAqG;AACrG,mDAAmD;AACnD,+DAA+D;AAC/D,6FAA6F;AAC7F,sFAAsF;AACtF,4FAA4F;AAC5F,0DAA0D;AAC1D,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,QAAQ,CAAU,CAAC;AAGhH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,aAAa,EAAE,eAAe,CAA8C,CAAC;AAGzH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,CAA8C,CAAC;AAG9H,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,SAAS,EAAE,cAAc,EAAE,WAAW,CAAU,CAAC;AAoB1F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,SAAS,CAAU,CAAC","sourcesContent":["// The audit vocabulary: the closed event-type union (BACKEND-202) and how an actor was acting\n// (BACKEND-205). The document schema is in ../doc-schemas/audit-event.ts.\n//\n// The union is closed: a new sensitive action adds its event types here, in the same change\n// (BACKEND-202).\n\nimport type { SystemRole } from './unions.js';\nimport { CAPTAIN_TEAM_ROLES } from './unions.js';\n\nexport const AUDIT_EVENT_TYPE_KEYS = [\n // Accounts\n 'user.accountRegistered',\n 'user.displayNameChanged',\n // The scheduled sweep deleted a sign-in account that never finished registering (no profile)\n 'user.abandonedRegistrationDeleted',\n // Account status — an admin banned an account or lifted its ban\n 'user.accountBanned',\n 'user.accountUnbanned',\n // Global roles — the policy decision (callable) and the claim propagation (trigger)\n 'admin.systemRoleGranted',\n 'admin.systemRoleRevoked',\n 'admin.systemRoleClaimSynced',\n // App configuration — the operational levers on `_appConfig/app`, and the landing page copy\n 'appConfig.updated',\n 'landingPage.updated',\n // Leagues — created, settings edited, status moved, mode switched\n 'league.created',\n 'league.updated',\n 'league.statusChanged',\n 'league.modeSwitched',\n // Waiver templates — created, a new wording published, retired or deleted\n 'waiverTemplate.created',\n 'waiverTemplate.versionPublished',\n 'waiverTemplate.retired',\n 'waiverTemplate.deleted',\n // Game locations\n 'gameLocation.created',\n 'gameLocation.updated',\n 'gameLocation.deleted',\n // Pictures — published to a gallery or a slot by the picture processor (attributed to the admin\n // who uploaded it), and ordered, featured, and removed by the admin picture callables\n 'picture.added',\n 'picture.replaced',\n 'picture.moved',\n 'picture.featuredChanged',\n 'picture.removed',\n // Awards — an award created by its first badge's publication, its badge replaced, the award\n // deleted once nobody holds it, and an award granted to or revoked from one account\n 'award.created',\n 'award.badgeReplaced',\n 'award.deleted',\n 'award.granted',\n 'award.revoked',\n // Hardware contracts — a loan created for a referee, signed by them, its equipment returned, and a\n // contract never signed deleted\n 'hardwareLoanContract.created',\n 'hardwareLoanContract.signed',\n 'hardwareLoanContract.returned',\n 'hardwareLoanContract.deleted',\n // Teams — created with its captain, a ghost player added, a team's failed roster work retried\n 'leagueTeam.created',\n 'ghostPlayer.created',\n 'teamRoster.syncRetried',\n // Team management — a member promoted to co-captain or demoted to player, the captain changed by\n // an admin, the team's name or type edited by an admin, and its contact phone set by an admin\n 'teamMembership.roleChanged',\n 'leagueTeam.captainChanged',\n 'leagueTeam.updated',\n 'leagueTeamContact.updated',\n // Exits — a membership removed, a never-played ghost removed, a ghost linked by either link, and a\n // never-played team deleted; each targets what it deleted, which the migration's live\n // verifications read as proof the product removed it\n 'teamMembership.removed',\n 'ghostPlayer.removed',\n 'ghostPlayer.linked',\n 'ghostPlayer.closedLeagueLinked',\n 'leagueTeam.deleted',\n // A ghost's removal stopped part-way because the ghost came to have played: the games it held are\n // released, and the finished-game entries it had already taken off are named\n 'ghostPlayer.removalStopped',\n // Joining a team — an invitation sent, withdrawn, accepted, or declined; a join request sent,\n // withdrawn, accepted, or rejected; a free-agent signup made, withdrawn, or answered by an admin\n // placing the player on a team\n 'teamInvitation.created',\n 'teamInvitation.cancelled',\n 'teamInvitation.accepted',\n 'teamInvitation.rejected',\n 'teamJoinRequest.created',\n 'teamJoinRequest.cancelled',\n 'teamJoinRequest.accepted',\n 'teamJoinRequest.rejected',\n 'leagueFreeAgent.created',\n 'leagueFreeAgent.deleted',\n 'leagueFreeAgent.assigned',\n // Signed waivers — a legal record, signed by its subject or witnessed for a ghost\n 'signedWaiver.created',\n // Schedules — a week created with its games or its shared fields edited; one game added, edited\n // (moved, rescheduled, or its teams replaced), or deleted with its events and roster\n 'scheduleWeek.created',\n 'scheduleWeek.updated',\n 'sportGame.created',\n 'sportGame.updated',\n 'sportGame.deleted',\n // Live scoring — a scoring write refused its caller's authority (a click writes no success event:\n // the stat event document is its own record), a roster entry marked absent or present, a\n // scorer's note on one person changed, and the jump-ball possession arrow moved\n 'sportGame.statEventsRejected',\n 'sportGame.absenceChanged',\n 'sportGame.memoUpdated',\n 'sportGame.jumpBallChanged',\n // Finalizing — a game finalized, its numbers made permanent in every derived destination, and an\n // admin's reopening of a finalized game, which takes them back out\n 'sportGame.finalized',\n 'sportGame.reopened',\n // Fix stats — a game's numbers corrected (targets, or the stored numbers kept) or restored from\n // its events; a derived aggregate rebuilt; and a person's pre-Q-Sports baseline written\n 'sportGame.statsCorrected',\n 'sportGame.statsRecalculated',\n 'stats.aggregateRecalculated',\n 'stats.historicalStatsUpdated',\n // A stats check ran to its end: its scope, its summary, and its counts by kind.\n 'stats.validationRun',\n // An admin deleted a stats check's report: its id, scope, summary, and counts by kind.\n 'stats.validationReportDeleted',\n // The migration's placement of a recorded stat line no roster entry or play could place: the\n // admin names the team, and the game's copy places the line there\n 'stats.unrosteredStatLineResolved',\n // Admin notifications — a shared card archived, which takes it off every admin's list; and an\n // admin's archive-all decision, recorded once when the job is written, with the request's origin\n 'adminNotification.archived',\n 'adminNotification.archiveAllRequested',\n // An operator's manual intervention in a durable pipeline — a dead-lettered row put back to work,\n // or a refused attempt at one — with the reason the operator gave\n 'system.manualIntervention',\n // The migration console — one page of a cutover action run, with what it read, wrote, and found;\n // the documents an action core wrote and removed, committed in the same batch or transaction as\n // those writes (its action id, operation id, and document ids only — BACKEND-203); a product\n // control's run recorded once its evidence checked; an operator checkpoint recorded with its\n // evidence; and the cutover, after which the product owns every destination\n 'migrationAction.pageRun',\n 'migrationAction.writesCommitted',\n 'migrationAction.controlRecorded',\n 'migrationAction.checkpointRecorded',\n 'migrationConsole.cutoverRecorded',\n] as const;\nexport type AuditEventType = (typeof AUDIT_EVENT_TYPE_KEYS)[number];\n\n// The two ways a ghost is linked to an account — the normal link and the closed-league link — each\n// committing its own event over the one artifact-moving core.\nexport const GHOST_LINK_AUDIT_EVENT_TYPE_KEYS = [\n 'ghostPlayer.linked',\n 'ghostPlayer.closedLeagueLinked',\n] as const satisfies readonly AuditEventType[];\nexport type GhostLinkAuditEventType = (typeof GHOST_LINK_AUDIT_EVENT_TYPE_KEYS)[number];\n\n// How the actor was acting for the write — never merely which authorities they happen to hold. It is\n// orthogonal to the event type: one event type is produced under several modes, and the mode is what\n// tells an ordinary action from an admin override.\n// user a signed-in account acting on its own behalf\n// teamManager a captain or co-captain acting through their team's membership permissions\n// adminReview an admin or referee doing admin work that no team permission covers\n// adminOverride an admin or referee superseding the team permission a normal entry checks\n// system backend automation with no human caller\nexport const AUDIT_ACTOR_MODE_KEYS = ['user', 'teamManager', 'adminReview', 'adminOverride', 'system'] as const;\nexport type AuditActorMode = (typeof AUDIT_ACTOR_MODE_KEYS)[number];\n\nexport const AUDIT_ADMIN_ACTOR_MODE_KEYS = ['adminReview', 'adminOverride'] as const satisfies readonly AuditActorMode[];\nexport type AuditAdminActorMode = (typeof AUDIT_ADMIN_ACTOR_MODE_KEYS)[number];\n\nexport const AUDIT_NON_ADMIN_ACTOR_MODE_KEYS = ['user', 'teamManager', 'system'] as const satisfies readonly AuditActorMode[];\nexport type AuditNonAdminActorMode = (typeof AUDIT_NON_ADMIN_ACTOR_MODE_KEYS)[number];\n\nexport const AUDIT_SYSTEM_REASON_KEYS = ['trigger', 'scheduledJob', 'migration'] as const;\nexport type AuditSystemReason = (typeof AUDIT_SYSTEM_REASON_KEYS)[number];\n\nexport type CaptainTeamRole = (typeof CAPTAIN_TEAM_ROLES)[number];\n\n// `isAdmin` is metadata only: it records that the caller's token carried a global-role claim (admin\n// or referee) when they acted, and grants nothing. `systemRole` is required on the admin modes and\n// forbidden on the others, so an admin action is never recorded without the authority it used and a\n// non-admin action never carries one.\nexport type AuditActor =\n | { uid: string | null; isAdmin: boolean; actorMode: AuditNonAdminActorMode; systemRole?: never }\n | { uid: string | null; isAdmin: boolean; actorMode: AuditAdminActorMode; systemRole: SystemRole };\n\nexport interface AuditTarget {\n // The user the action was performed on, when there is one.\n uid: string | null;\n // The slash path of the document the action changed, when there is one.\n ref: string | null;\n}\n\nexport const AUDIT_RESULT_KEYS = ['success', 'failure'] as const;\nexport type AuditResult = (typeof AUDIT_RESULT_KEYS)[number];\n"]}
@@ -60,6 +60,8 @@ export declare const HARDWARE_LOAN_CONTRACT_STATUS_KEYS: readonly ["pending", "l
60
60
  export type HardwareLoanContractStatus = (typeof HARDWARE_LOAN_CONTRACT_STATUS_KEYS)[number];
61
61
  export declare const AWARD_GRANT_SKIP_REASON_KEYS: readonly ["noProfile", "ghost"];
62
62
  export type AwardGrantSkipReason = (typeof AWARD_GRANT_SKIP_REASON_KEYS)[number];
63
+ export declare const FEATURED_AWARD_SLOT_KEYS: readonly ["primary", "secondary"];
64
+ export type FeaturedAwardSlot = (typeof FEATURED_AWARD_SLOT_KEYS)[number];
63
65
  export declare const PENDING_HARDWARE_LOAN_CONTRACT_STATUS: "pending";
64
66
  export declare const LOANED_HARDWARE_LOAN_CONTRACT_STATUS: "loaned";
65
67
  export declare const RETURNED_HARDWARE_LOAN_CONTRACT_STATUS: "returned";
@@ -85,8 +87,8 @@ export declare const TEAM_ICON_KEYS: readonly ["Shield", "Swords", "Skull", "Gho
85
87
  export type TeamIcon = (typeof TEAM_ICON_KEYS)[number];
86
88
  export declare const PICTURE_VARIANT_KEYS: readonly ["sm", "md", "lg"];
87
89
  export type PictureVariantKey = (typeof PICTURE_VARIANT_KEYS)[number];
88
- export declare const GAME_TIER_DISCREPANCY_KIND_KEYS: readonly ["invalidEvent", "eventSequenceMismatch", "rollupMismatch", "scoreMirrorMismatch", "unrosteredStatLine", "fantasyPointsStale", "finalRecordMissing", "finalRecordMismatch", "participationSnapshotMismatch", "gameHeld"];
90
+ export declare const GAME_TIER_DISCREPANCY_KIND_KEYS: readonly ["gameUnreadable", "invalidEvent", "eventSequenceMismatch", "eventSequenceGap", "rollupMismatch", "scoreMirrorMismatch", "unrosteredStatLine", "fantasyPointsStale", "finalRecordMissing", "finalRecordMismatch", "participationSnapshotMismatch", "gameHeld"];
89
91
  export declare const AGGREGATE_TIER_DISCREPANCY_KIND_KEYS: readonly ["aggregateMismatch", "aggregateEntryStale", "aggregateEntryMissing", "hallOfFameLifetimeMismatch"];
90
- export declare const STATS_DISCREPANCY_KIND_KEYS: readonly ["invalidEvent", "eventSequenceMismatch", "rollupMismatch", "scoreMirrorMismatch", "unrosteredStatLine", "fantasyPointsStale", "finalRecordMissing", "finalRecordMismatch", "participationSnapshotMismatch", "gameHeld", "aggregateMismatch", "aggregateEntryStale", "aggregateEntryMissing", "hallOfFameLifetimeMismatch"];
92
+ export declare const STATS_DISCREPANCY_KIND_KEYS: readonly ["gameUnreadable", "invalidEvent", "eventSequenceMismatch", "eventSequenceGap", "rollupMismatch", "scoreMirrorMismatch", "unrosteredStatLine", "fantasyPointsStale", "finalRecordMissing", "finalRecordMismatch", "participationSnapshotMismatch", "gameHeld", "aggregateMismatch", "aggregateEntryStale", "aggregateEntryMissing", "hallOfFameLifetimeMismatch"];
91
93
  export type StatsDiscrepancyKind = (typeof STATS_DISCREPANCY_KIND_KEYS)[number];
92
94
  //# source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BAA8B,CAAC;AAChE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAItE,eAAO,MAAM,+BAA+B,yQAelC,CAAC;AACX,eAAO,MAAM,oCAAoC,8GAKvC,CAAC;AACX,eAAO,MAAM,2BAA2B,4WAG9B,CAAC;AACX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -110,6 +110,8 @@ export const HARDWARE_LOAN_CONTRACT_STATUS_KEYS = ['pending', 'loaned', 'returne
110
110
  // Why an award grant passed over an account its teams or leagues named: it has no profile, or it is
111
111
  // a ghost, which holds no account.
112
112
  export const AWARD_GRANT_SKIP_REASON_KEYS = ['noProfile', 'ghost'];
113
+ // The two badges an account shows beside its name.
114
+ export const FEATURED_AWARD_SLOT_KEYS = ['primary', 'secondary'];
113
115
  export const PENDING_HARDWARE_LOAN_CONTRACT_STATUS = 'pending';
114
116
  export const LOANED_HARDWARE_LOAN_CONTRACT_STATUS = 'loaned';
115
117
  export const RETURNED_HARDWARE_LOAN_CONTRACT_STATUS = 'returned';
@@ -273,8 +275,12 @@ export const PICTURE_VARIANT_KEYS = ['sm', 'md', 'lg'];
273
275
  // What a stats check found, game tier first — a game's own numbers are the cause of the aggregate
274
276
  // findings, so Fix stats repairs games before it rebuilds what they feed.
275
277
  export const GAME_TIER_DISCREPANCY_KIND_KEYS = [
278
+ // A game whose document the check could not read: nothing else about it could be checked.
279
+ 'gameUnreadable',
276
280
  'invalidEvent',
277
281
  'eventSequenceMismatch',
282
+ // A game whose events do not hold exactly the sequences 1..n: a gap or a duplicate.
283
+ 'eventSequenceGap',
278
284
  'rollupMismatch',
279
285
  'scoreMirrorMismatch',
280
286
  'unrosteredStatLine',