@ttt-productions/q-core 0.1.1 → 0.1.2

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 (132) 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/notifications/archive-all.d.ts +2 -0
  59. package/dist/notifications/archive-all.d.ts.map +1 -0
  60. package/dist/notifications/archive-all.js +6 -0
  61. package/dist/notifications/archive-all.js.map +1 -0
  62. package/dist/notifications/index.d.ts +1 -0
  63. package/dist/notifications/index.d.ts.map +1 -1
  64. package/dist/notifications/index.js +1 -0
  65. package/dist/notifications/index.js.map +1 -1
  66. package/dist/schemas/admin-notifications.d.ts +1 -0
  67. package/dist/schemas/admin-notifications.d.ts.map +1 -1
  68. package/dist/schemas/admin-notifications.js +4 -2
  69. package/dist/schemas/admin-notifications.js.map +1 -1
  70. package/dist/schemas/app-config.d.ts +2 -2
  71. package/dist/schemas/app-config.d.ts.map +1 -1
  72. package/dist/schemas/app-config.js +9 -5
  73. package/dist/schemas/app-config.js.map +1 -1
  74. package/dist/schemas/awards.d.ts +16 -4
  75. package/dist/schemas/awards.d.ts.map +1 -1
  76. package/dist/schemas/awards.js +10 -6
  77. package/dist/schemas/awards.js.map +1 -1
  78. package/dist/schemas/game-locations.d.ts +4 -4
  79. package/dist/schemas/game-locations.d.ts.map +1 -1
  80. package/dist/schemas/game-locations.js +11 -3
  81. package/dist/schemas/game-locations.js.map +1 -1
  82. package/dist/schemas/migration-console.d.ts +1 -0
  83. package/dist/schemas/migration-console.d.ts.map +1 -1
  84. package/dist/schemas/pictures.d.ts +3 -0
  85. package/dist/schemas/pictures.d.ts.map +1 -1
  86. package/dist/schemas/stats.d.ts +2 -0
  87. package/dist/schemas/stats.d.ts.map +1 -1
  88. package/dist/schemas/teams.d.ts +3 -2
  89. package/dist/schemas/teams.d.ts.map +1 -1
  90. package/dist/schemas/teams.js +19 -9
  91. package/dist/schemas/teams.js.map +1 -1
  92. package/dist/schemas/users.d.ts +7 -3
  93. package/dist/schemas/users.d.ts.map +1 -1
  94. package/dist/schemas/users.js +10 -3
  95. package/dist/schemas/users.js.map +1 -1
  96. package/dist/schemas/waiver-templates.d.ts +1 -0
  97. package/dist/schemas/waiver-templates.d.ts.map +1 -1
  98. package/dist/schemas/waiver-templates.js +4 -1
  99. package/dist/schemas/waiver-templates.js.map +1 -1
  100. package/dist/sports/index.d.ts +1 -0
  101. package/dist/sports/index.d.ts.map +1 -1
  102. package/dist/sports/index.js +1 -0
  103. package/dist/sports/index.js.map +1 -1
  104. package/dist/sports/ledger-continuity.d.ts +13 -0
  105. package/dist/sports/ledger-continuity.d.ts.map +1 -0
  106. package/dist/sports/ledger-continuity.js +19 -0
  107. package/dist/sports/ledger-continuity.js.map +1 -0
  108. package/dist/types/audit.d.ts +1 -1
  109. package/dist/types/audit.d.ts.map +1 -1
  110. package/dist/types/audit.js +5 -2
  111. package/dist/types/audit.js.map +1 -1
  112. package/dist/types/unions.d.ts +4 -2
  113. package/dist/types/unions.d.ts.map +1 -1
  114. package/dist/types/unions.js +6 -0
  115. package/dist/types/unions.js.map +1 -1
  116. package/dist/upload-variables/index.d.ts +3 -0
  117. package/dist/upload-variables/index.d.ts.map +1 -0
  118. package/dist/upload-variables/index.js +3 -0
  119. package/dist/upload-variables/index.js.map +1 -0
  120. package/dist/upload-variables/on-progress.d.ts +4 -0
  121. package/dist/upload-variables/on-progress.d.ts.map +1 -0
  122. package/dist/upload-variables/on-progress.js +10 -0
  123. package/dist/upload-variables/on-progress.js.map +1 -0
  124. package/dist/upload-variables/picture-upload-variables.d.ts +32 -0
  125. package/dist/upload-variables/picture-upload-variables.d.ts.map +1 -0
  126. package/dist/upload-variables/picture-upload-variables.js +21 -0
  127. package/dist/upload-variables/picture-upload-variables.js.map +1 -0
  128. package/dist/utils/app-config.d.ts +17 -3
  129. package/dist/utils/app-config.d.ts.map +1 -1
  130. package/dist/utils/app-config.js +21 -14
  131. package/dist/utils/app-config.js.map +1 -1
  132. package/package.json +6 -2
@@ -256,15 +256,18 @@ export declare const CreateLeagueTeamResultSchema: z.ZodObject<{
256
256
  captainUserId: z.ZodString;
257
257
  }, z.core.$strict>;
258
258
  export type CreateLeagueTeamResult = z.infer<typeof CreateLeagueTeamResultSchema>;
259
+ export declare const ghostCreateRequestIdSchema: z.ZodString;
259
260
  export declare const CreateTeamGhostPlayerInputSchema: z.ZodObject<{
260
261
  teamId: z.ZodString;
261
262
  displayName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
263
+ requestId: z.ZodString;
262
264
  }, z.core.$strict>;
263
265
  export type CreateTeamGhostPlayerInput = z.infer<typeof CreateTeamGhostPlayerInputSchema>;
264
266
  export declare const CreateGameGhostPlayerInputSchema: z.ZodObject<{
265
267
  gameId: z.ZodString;
266
268
  teamId: z.ZodString;
267
269
  displayName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
270
+ requestId: z.ZodString;
268
271
  }, z.core.$strict>;
269
272
  export type CreateGameGhostPlayerInput = z.infer<typeof CreateGameGhostPlayerInputSchema>;
270
273
  export declare const CreateGhostPlayerResultSchema: z.ZodObject<{
@@ -322,7 +325,6 @@ export declare const LinkGhostPlayerInputSchema: z.ZodObject<{
322
325
  teamId: z.ZodString;
323
326
  ghostUserId: z.ZodString;
324
327
  userId: z.ZodString;
325
- reason: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
326
328
  }, z.core.$strict>;
327
329
  export type LinkGhostPlayerInput = z.infer<typeof LinkGhostPlayerInputSchema>;
328
330
  export declare const LinkGhostPlayerResultSchema: z.ZodObject<{
@@ -345,7 +347,6 @@ export declare const AdminLinkClosedLeagueGhostPlayerInputSchema: z.ZodObject<{
345
347
  teamId: z.ZodString;
346
348
  ghostUserId: z.ZodString;
347
349
  userId: z.ZodString;
348
- reason: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
349
350
  }, z.core.$strict>;
350
351
  export type AdminLinkClosedLeagueGhostPlayerInput = LinkGhostPlayerInput;
351
352
  export declare const AdminLinkClosedLeagueGhostPlayerResultSchema: z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"teams.d.ts","sourceRoot":"","sources":["../../src/schemas/teams.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsCxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAwC,CAAC;AACjF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,eAAO,MAAM,uCAAuC;;;kBAEzC,CAAC;AACZ,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAC;AAExG,eAAO,MAAM,wCAAwC;;;;kBAAoC,CAAC;AAC1F,MAAM,MAAM,kCAAkC,GAAG,2BAA2B,CAAC;AAK7E,eAAO,MAAM,gCAAgC;;kBAA8C,CAAC;AAC5F,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAK1F,eAAO,MAAM,iCAAiC;;;;kBAMnC,CAAC;AACZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC"}
@@ -3,11 +3,12 @@
3
3
  // (BACKEND-004); an admin entry's schema adds only what its authority needs.
4
4
  import { z } from 'zod';
5
5
  import { leagueJoinWarningActedOnSchema, leagueJoinWarningFindingSchema, } from '../utils/league-join-warning.js';
6
- import { membershipRosterSyncStatusSchema } from '../doc-schemas/atoms.js';
7
- import { isGhostUserId } from '../ids/minted-ids.js';
6
+ import { documentIdSegmentSchema, membershipRosterSyncStatusSchema } from '../doc-schemas/atoms.js';
7
+ import { buildGhostUserIdForRequest, isGhostUserId } from '../ids/minted-ids.js';
8
+ import { isDocumentIdSegment } from '../paths/utils.js';
8
9
  import { GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS } from '../types/stats.js';
9
10
  import { MEMBER_ASSIGNABLE_TEAM_ROLES } from '../types/unions.js';
10
- import { contactPhoneSchema, countSchema, displayNameSchema, gameIdSchema, leagueIdSchema, repairReasonSchema, teamIconSchema, teamIdSchema, teamNameSchema, teamRoleSchema, teamTypeSchema, userIdSchema, } from './atoms.js';
11
+ import { contactPhoneSchema, countSchema, displayNameSchema, gameIdSchema, leagueIdSchema, teamIconSchema, teamIdSchema, teamNameSchema, teamRoleSchema, teamTypeSchema, userIdSchema, } from './atoms.js';
11
12
  // ---------------------------------------------------------------------------------------------
12
13
  // Team creation — `createLeagueTeam` (the creator becomes captain) and `adminCreateLeagueTeam`
13
14
  // (an admin creates the team with a newly minted ghost captain). Both write the team's contact
@@ -31,13 +32,22 @@ export const CreateLeagueTeamResultSchema = z
31
32
  // Ghost add — one core behind two doors. The team page door (`createTeamGhostPlayer` /
32
33
  // `adminCreateTeamGhostPlayer`) needs authority over the team; the game page door
33
34
  // (`createGameGhostPlayer` / `adminCreateGameGhostPlayer`) needs scoring authority over the game
34
- // and adds to one of its two teams. The ghost id is always minted by the server.
35
+ // and adds to one of its two teams. The ghost id is derived by the server from the add's
36
+ // `requestId`, which the client mints once when the add starts and re-sends on every retry, so a
37
+ // retry after an unknown outcome is recognised as the same add (`buildGhostUserIdForRequest`).
35
38
  // ---------------------------------------------------------------------------------------------
39
+ // One document-id segment (ARCH-106), short enough that the ghost id derived from it is one too.
40
+ export const ghostCreateRequestIdSchema = documentIdSegmentSchema.refine((requestId) => isDocumentIdSegment(buildGhostUserIdForRequest(requestId)), 'Not a ghost add request id.');
36
41
  export const CreateTeamGhostPlayerInputSchema = z
37
- .object({ teamId: teamIdSchema, displayName: displayNameSchema })
42
+ .object({ teamId: teamIdSchema, displayName: displayNameSchema, requestId: ghostCreateRequestIdSchema })
38
43
  .strict();
39
44
  export const CreateGameGhostPlayerInputSchema = z
40
- .object({ gameId: gameIdSchema, teamId: teamIdSchema, displayName: displayNameSchema })
45
+ .object({
46
+ gameId: gameIdSchema,
47
+ teamId: teamIdSchema,
48
+ displayName: displayNameSchema,
49
+ requestId: ghostCreateRequestIdSchema,
50
+ })
41
51
  .strict();
42
52
  // `rosterSyncStatus` is where the new membership's roster work stood when the call returned: the
43
53
  // membership is committed either way, and `pending` finishes in the background.
@@ -88,8 +98,9 @@ export const AdminRetryLeagueTeamRosterSyncResultSchema = z
88
98
  .strict();
89
99
  // ---------------------------------------------------------------------------------------------
90
100
  // Linking a ghost to a real account — `linkGhostPlayerToUser` in a league that is not closed, and
91
- // `adminLinkClosedLeagueGhostPlayer` in a closed one. Both are admin-only, act on one team, and take
92
- // a reason, because a link rewrites completed records (BACKEND-212). The ghost and the account are
101
+ // `adminLinkClosedLeagueGhostPlayer` in a closed one. Both are admin-only and act on one team. A link
102
+ // takes no reason: the admin chooses the account and confirms, and the link's audit event records
103
+ // who linked which ghost to whom and what moved (BACKEND-212). The ghost and the account are
93
104
  // ids the core checks itself, so a ghost id named as the account, or a real id named as the ghost,
94
105
  // is refused with a failure record rather than at the parse. Every name the link records is read
95
106
  // server-side, never sent.
@@ -99,7 +110,6 @@ export const LinkGhostPlayerInputSchema = z
99
110
  teamId: teamIdSchema,
100
111
  ghostUserId: userIdSchema,
101
112
  userId: userIdSchema,
102
- reason: repairReasonSchema,
103
113
  })
104
114
  .strict();
105
115
  // `complete` is false when the call ran out of time part-way: the link stays under way, and the same
@@ -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,oBAAoB,CAAC;AAClE,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,cAAc,EACd,cAAc,EACd,cAAc,EACd,YAAY,GACb,MAAM,YAAY,CAAC;AAEpB,gGAAgG;AAChG,+FAA+F;AAC/F,+FAA+F;AAC/F,0FAA0F;AAC1F,gG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;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,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AACpG,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mB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CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;KAC1D,MAAM,EAAE,CAAC;AAGZ,sFAAsF;AACtF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;KAChF,MAAM,EAAE,CAAC;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 { 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. `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"]}
@@ -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,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAGlG,eAAO,MAAM,gCAAgC,oBAAqB,CAAC;AACnE,MAAM,MAAM,4BAA4B,GAAG,CAAC,OAAO,gCAAgC,CAAC,CAAC,MAAM,CAAC,CAAC;AAC7F,eAAO,MAAM,qCAAqC;;;;;kBAEvC,CAAC;AACZ,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG,gGAAgG;AAChG,eAAO,MA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B,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,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAE1G,iGAAiG;AACjG,gBAAgB;AAChB,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,OAAO,CAAU,CAAC;AAEnE,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC;KACnD,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,I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,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,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,IAA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;KACD,MAAM,EAAE,CAAC;AAGZ,mGAAmG;AACnG,mGAAmG;AACnG,yBAAyB;AACzB,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;KAC1F,MAAM,EAAE,CAAC;AAGZ,yCAAyC;AACzC,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,MAAM,EAAE,YAAY;IACpB,UAAU,EAAE,gBAAgB;IAC5B,cAAc,EAAE,gBAAgB;IAChC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,oGAAoG;AACpG,iDAAiD;AACjD,MAAM,CAAC,MAAM,iCAAiC,GAAG,qBAAqB,CAAC;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,kGAAkG;AAClG,4FAA4F;AAC5F,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,SAAS,EAAE,gBAAgB,EAAE,qBAAqB,CAAU,CAAC;AAEzG,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.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,MAA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O,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,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,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,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,iGAAiG;AACjG,iGAAiG;AACjG,8DAA8D;AAC9D,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC;IACN,gBAAgB,EAAE,sBAAsB;IACxC,eAAe,EAAE,iCAAiC;IAClD,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. `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,E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C,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',