@ttt-productions/q-core 0.1.0 → 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 (178) 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/constants/sports.js.map +1 -1
  10. package/dist/constants/storage-keys.js.map +1 -1
  11. package/dist/doc-schemas/admin-notifications.d.ts +1 -0
  12. package/dist/doc-schemas/admin-notifications.d.ts.map +1 -1
  13. package/dist/doc-schemas/admin-notifications.js +4 -0
  14. package/dist/doc-schemas/admin-notifications.js.map +1 -1
  15. package/dist/doc-schemas/atoms.d.ts +2 -0
  16. package/dist/doc-schemas/atoms.d.ts.map +1 -1
  17. package/dist/doc-schemas/audit-event.d.ts +2 -0
  18. package/dist/doc-schemas/audit-event.d.ts.map +1 -1
  19. package/dist/doc-schemas/catalogs.js.map +1 -1
  20. package/dist/doc-schemas/gallery.d.ts +1 -0
  21. package/dist/doc-schemas/gallery.d.ts.map +1 -1
  22. package/dist/doc-schemas/gallery.js +3 -0
  23. package/dist/doc-schemas/gallery.js.map +1 -1
  24. package/dist/doc-schemas/game-location.js.map +1 -1
  25. package/dist/doc-schemas/game-stats.js.map +1 -1
  26. package/dist/doc-schemas/league-team.js.map +1 -1
  27. package/dist/doc-schemas/migration-console.d.ts +2 -0
  28. package/dist/doc-schemas/migration-console.d.ts.map +1 -1
  29. package/dist/doc-schemas/migration-console.js +5 -0
  30. package/dist/doc-schemas/migration-console.js.map +1 -1
  31. package/dist/doc-schemas/pending-media.d.ts +1 -0
  32. package/dist/doc-schemas/pending-media.d.ts.map +1 -1
  33. package/dist/doc-schemas/pending-media.js +8 -0
  34. package/dist/doc-schemas/pending-media.js.map +1 -1
  35. package/dist/doc-schemas/registry.d.ts +12 -0
  36. package/dist/doc-schemas/registry.d.ts.map +1 -1
  37. package/dist/doc-schemas/registry.js.map +1 -1
  38. package/dist/doc-schemas/sport-game.js.map +1 -1
  39. package/dist/doc-schemas/stats-operation.d.ts.map +1 -1
  40. package/dist/doc-schemas/stats-operation.js +6 -11
  41. package/dist/doc-schemas/stats-operation.js.map +1 -1
  42. package/dist/doc-schemas/system.d.ts +7 -0
  43. package/dist/doc-schemas/system.d.ts.map +1 -1
  44. package/dist/doc-schemas/system.js +4 -1
  45. package/dist/doc-schemas/system.js.map +1 -1
  46. package/dist/doc-schemas/user-profile.d.ts +1 -0
  47. package/dist/doc-schemas/user-profile.d.ts.map +1 -1
  48. package/dist/doc-schemas/user-profile.js +5 -0
  49. package/dist/doc-schemas/user-profile.js.map +1 -1
  50. package/dist/doc-schemas/waiver-template.d.ts +1 -0
  51. package/dist/doc-schemas/waiver-template.d.ts.map +1 -1
  52. package/dist/doc-schemas/waiver-template.js +10 -1
  53. package/dist/doc-schemas/waiver-template.js.map +1 -1
  54. package/dist/doc-schemas/waivers-and-hardware.d.ts +1 -0
  55. package/dist/doc-schemas/waivers-and-hardware.d.ts.map +1 -1
  56. package/dist/doc-schemas/waivers-and-hardware.js +17 -9
  57. package/dist/doc-schemas/waivers-and-hardware.js.map +1 -1
  58. package/dist/ids/index.js.map +1 -1
  59. package/dist/ids/minted-ids.d.ts +1 -0
  60. package/dist/ids/minted-ids.d.ts.map +1 -1
  61. package/dist/ids/minted-ids.js +6 -0
  62. package/dist/ids/minted-ids.js.map +1 -1
  63. package/dist/ids/stats-operation-ids.js.map +1 -1
  64. package/dist/index.js.map +1 -1
  65. package/dist/input-formats/index.d.ts +2 -2
  66. package/dist/input-formats/index.d.ts.map +1 -1
  67. package/dist/input-formats/index.js +2 -2
  68. package/dist/input-formats/index.js.map +1 -1
  69. package/dist/media/file-origins.js.map +1 -1
  70. package/dist/notifications/archive-all.d.ts +2 -0
  71. package/dist/notifications/archive-all.d.ts.map +1 -0
  72. package/dist/notifications/archive-all.js +6 -0
  73. package/dist/notifications/archive-all.js.map +1 -0
  74. package/dist/notifications/index.d.ts +1 -0
  75. package/dist/notifications/index.d.ts.map +1 -1
  76. package/dist/notifications/index.js +1 -0
  77. package/dist/notifications/index.js.map +1 -1
  78. package/dist/paths/collection-refs.js.map +1 -1
  79. package/dist/paths/collections.js.map +1 -1
  80. package/dist/paths/path-builders.js.map +1 -1
  81. package/dist/paths/utils.js.map +1 -1
  82. package/dist/schemas/account-settings.js.map +1 -1
  83. package/dist/schemas/admin-notifications.d.ts +1 -0
  84. package/dist/schemas/admin-notifications.d.ts.map +1 -1
  85. package/dist/schemas/admin-notifications.js +4 -2
  86. package/dist/schemas/admin-notifications.js.map +1 -1
  87. package/dist/schemas/app-config.d.ts +2 -2
  88. package/dist/schemas/app-config.d.ts.map +1 -1
  89. package/dist/schemas/app-config.js +9 -5
  90. package/dist/schemas/app-config.js.map +1 -1
  91. package/dist/schemas/atoms.js.map +1 -1
  92. package/dist/schemas/awards.d.ts +16 -4
  93. package/dist/schemas/awards.d.ts.map +1 -1
  94. package/dist/schemas/awards.js +10 -6
  95. package/dist/schemas/awards.js.map +1 -1
  96. package/dist/schemas/game-locations.d.ts +4 -4
  97. package/dist/schemas/game-locations.d.ts.map +1 -1
  98. package/dist/schemas/game-locations.js +11 -3
  99. package/dist/schemas/game-locations.js.map +1 -1
  100. package/dist/schemas/hardware-loan-contracts.js.map +1 -1
  101. package/dist/schemas/migration-console.d.ts +1 -0
  102. package/dist/schemas/migration-console.d.ts.map +1 -1
  103. package/dist/schemas/pictures.d.ts +3 -0
  104. package/dist/schemas/pictures.d.ts.map +1 -1
  105. package/dist/schemas/schedules.js.map +1 -1
  106. package/dist/schemas/scoring.js.map +1 -1
  107. package/dist/schemas/stats.d.ts +2 -0
  108. package/dist/schemas/stats.d.ts.map +1 -1
  109. package/dist/schemas/stats.js.map +1 -1
  110. package/dist/schemas/team-joining.js.map +1 -1
  111. package/dist/schemas/teams.d.ts +3 -2
  112. package/dist/schemas/teams.d.ts.map +1 -1
  113. package/dist/schemas/teams.js +19 -9
  114. package/dist/schemas/teams.js.map +1 -1
  115. package/dist/schemas/uploads.js.map +1 -1
  116. package/dist/schemas/users.d.ts +7 -3
  117. package/dist/schemas/users.d.ts.map +1 -1
  118. package/dist/schemas/users.js +10 -3
  119. package/dist/schemas/users.js.map +1 -1
  120. package/dist/schemas/waiver-templates.d.ts +1 -0
  121. package/dist/schemas/waiver-templates.d.ts.map +1 -1
  122. package/dist/schemas/waiver-templates.js +4 -1
  123. package/dist/schemas/waiver-templates.js.map +1 -1
  124. package/dist/sports/basketball-scoring.js.map +1 -1
  125. package/dist/sports/basketball.js.map +1 -1
  126. package/dist/sports/bulk-entry.js.map +1 -1
  127. package/dist/sports/contribution.js.map +1 -1
  128. package/dist/sports/curling-scoring.js.map +1 -1
  129. package/dist/sports/finalized-record.js.map +1 -1
  130. package/dist/sports/football-scoring.js.map +1 -1
  131. package/dist/sports/index.d.ts +1 -0
  132. package/dist/sports/index.d.ts.map +1 -1
  133. package/dist/sports/index.js +1 -0
  134. package/dist/sports/index.js.map +1 -1
  135. package/dist/sports/ledger-continuity.d.ts +13 -0
  136. package/dist/sports/ledger-continuity.d.ts.map +1 -0
  137. package/dist/sports/ledger-continuity.js +19 -0
  138. package/dist/sports/ledger-continuity.js.map +1 -0
  139. package/dist/sports/rankings.js.map +1 -1
  140. package/dist/sports/rollup-check.js.map +1 -1
  141. package/dist/sports/scoring.js.map +1 -1
  142. package/dist/sports/store-driver.js.map +1 -1
  143. package/dist/types/audit.d.ts +1 -1
  144. package/dist/types/audit.d.ts.map +1 -1
  145. package/dist/types/audit.js +5 -2
  146. package/dist/types/audit.js.map +1 -1
  147. package/dist/types/documents.js.map +1 -1
  148. package/dist/types/notifications.js.map +1 -1
  149. package/dist/types/picture-owners.js.map +1 -1
  150. package/dist/types/sports.js.map +1 -1
  151. package/dist/types/stats.js.map +1 -1
  152. package/dist/types/unions.d.ts +4 -2
  153. package/dist/types/unions.d.ts.map +1 -1
  154. package/dist/types/unions.js +6 -0
  155. package/dist/types/unions.js.map +1 -1
  156. package/dist/upload-variables/index.d.ts +3 -0
  157. package/dist/upload-variables/index.d.ts.map +1 -0
  158. package/dist/upload-variables/index.js +3 -0
  159. package/dist/upload-variables/index.js.map +1 -0
  160. package/dist/upload-variables/on-progress.d.ts +4 -0
  161. package/dist/upload-variables/on-progress.d.ts.map +1 -0
  162. package/dist/upload-variables/on-progress.js +10 -0
  163. package/dist/upload-variables/on-progress.js.map +1 -0
  164. package/dist/upload-variables/picture-upload-variables.d.ts +32 -0
  165. package/dist/upload-variables/picture-upload-variables.d.ts.map +1 -0
  166. package/dist/upload-variables/picture-upload-variables.js +21 -0
  167. package/dist/upload-variables/picture-upload-variables.js.map +1 -0
  168. package/dist/utils/account-status.js.map +1 -1
  169. package/dist/utils/app-config.d.ts +17 -3
  170. package/dist/utils/app-config.d.ts.map +1 -1
  171. package/dist/utils/app-config.js +21 -14
  172. package/dist/utils/app-config.js.map +1 -1
  173. package/dist/utils/app-routes.js.map +1 -1
  174. package/dist/utils/index.js.map +1 -1
  175. package/dist/utils/league-calendar.js.map +1 -1
  176. package/dist/utils/league-mode.js.map +1 -1
  177. package/dist/utils/team-member-actions.js.map +1 -1
  178. package/package.json +94 -90
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive-all.js","sourceRoot":"","sources":["../../src/notifications/archive-all.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,iDAAiD;AACjD,MAAM,UAAU,+BAA+B,CAAC,QAAgB,EAAE,WAAmB;IACnF,OAAO,YAAY,QAAQ,KAAK,WAAW,6BAA6B,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,qBAAqB,CAAC;AAChI,CAAC","sourcesContent":["// How a finished Archive all reads when some cards could not be archived: each failed on its own and\n// stays in the list for a one-at-a-time archive.\nexport function archiveAllPartialOutcomeMessage(archived: number, notArchived: number): string {\n return `Archived ${archived}. ${notArchived} couldn't be archived and ${notArchived === 1 ? 'is' : 'are'} still in the list.`;\n}\n"]}
@@ -1,3 +1,4 @@
1
1
  export * from './admin-notification-config.js';
2
+ export * from './archive-all.js';
2
3
  export * from './occurrences.js';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export * from './admin-notification-config.js';
2
+ export * from './archive-all.js';
2
3
  export * from './occurrences.js';
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './admin-notification-config.js';\nexport * from './occurrences.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './admin-notification-config.js';\nexport * from './archive-all.js';\nexport * from './occurrences.js';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"collection-refs.js","sourceRoot":"","sources":["../../src/paths/collection-refs.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,EAAE;AACF,8DAA8D;AAC9D,kEAAkE;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,k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,qBAAqB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,uBAAuB,CAAC;IAC5E,gBAAgB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,iBAAiB,CAAC;IACjE,sBAAsB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,wBAAwB,CAAC;IAC9E,eAAe,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC;IAC/D,mBAAmB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,qBAAqB,CAAC;IACxE,eAAe,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC;IAC/D,YAAY,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC;IACzD,kBAAkB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,mBAAmB,CAAC;IACrE,WAAW,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC;IACvD,wBAAwB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,0BAA0B,CAAC;IAClF,wBAAwB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,0BAA0B,CAAC;IAClF,sBAAsB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,uBAAuB,CAAC;IAC7E,0BAA0B,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,6BAA6B,CAAC;CAC/E,CAAC","sourcesContent":["// Collection reference builders — for collection-level operations.\r\n//\r\n// Frontend: collection(db, ...COLLECTION_REFS.userProfiles())\r\n// Backend: db.collection(toPath(COLLECTION_REFS.userProfiles()))\r\n\r\nimport { COLLECTIONS } from './collections.js';\r\n\r\nexport const COLLECTION_REFS = {\r\n userProfiles: (): [string] => [COLLECTIONS.USER_PROFILES],\r\n publicUsers: (): [string] => [COLLECTIONS.PUBLIC_USERS],\r\n statusReconcileQueue: (): [string] => [COLLECTIONS.STATUS_RECONCILE_QUEUE],\r\n registrationStarts: (): [string] => [COLLECTIONS.REGISTRATION_STARTS],\r\n reservedDisplayNames: (): [string] => [COLLECTIONS.RESERVED_DISPLAY_NAMES],\r\n sportLeagues: (): [string] => [COLLECTIONS.SPORT_LEAGUES],\r\n leagueTeams: (): [string] => [COLLECTIONS.LEAGUE_TEAMS],\r\n leagueTeamContacts: (): [string] => [COLLECTIONS.LEAGUE_TEAM_CONTACTS],\r\n teamMemberships: (): [string] => [COLLECTIONS.TEAM_MEMBERSHIPS],\r\n teamInvitations: (): [string] => [COLLECTIONS.TEAM_INVITATIONS],\r\n teamJoinRequests: (): [string] => [COLLECTIONS.TEAM_JOIN_REQUESTS],\r\n leagueFreeAgents: (): [string] => [COLLECTIONS.LEAGUE_FREE_AGENTS],\r\n membershipRosterSyncs: (): [string] => [COLLECTIONS.MEMBERSHIP_ROSTER_SYNCS],\r\n sportGames: (): [string] => [COLLECTIONS.SPORT_GAMES],\r\n gameLocations: (): [string] => [COLLECTIONS.GAME_LOCATIONS],\r\n waiverTemplates: (): [string] => [COLLECTIONS.WAIVER_TEMPLATES],\r\n signedWaivers: (): [string] => [COLLECTIONS.SIGNED_WAIVERS],\r\n hardwareLoanContracts: (): [string] => [COLLECTIONS.HARDWARE_LOAN_CONTRACTS],\r\n awardDefinitions: (): [string] => [COLLECTIONS.AWARD_DEFINITIONS],\r\n statsValidationReports: (): [string] => [COLLECTIONS.STATS_VALIDATION_REPORTS],\r\n statsOperations: (): [string] => [COLLECTIONS.STATS_OPERATIONS],\r\n migrationActionRuns: (): [string] => [COLLECTIONS.MIGRATION_ACTION_RUNS],\r\n galleryPictures: (): [string] => [COLLECTIONS.GALLERY_PICTURES],\r\n pendingMedia: (): [string] => [COLLECTIONS.PENDING_MEDIA],\r\n pictureRetirements: (): [string] => [COLLECTIONS.PICTURE_RETIREMENTS],\r\n auditEvents: (): [string] => [COLLECTIONS.AUDIT_EVENTS],\r\n activeAdminNotifications: (): [string] => [COLLECTIONS.ACTIVE_ADMIN_NOTIFICATIONS],\r\n adminNotificationHistory: (): [string] => [COLLECTIONS.ADMIN_NOTIFICATION_HISTORY],\r\n notificationDeliveries: (): [string] => [COLLECTIONS.NOTIFICATION_DELIVERIES],\r\n notificationArchiveAllJobs: (): [string] => [COLLECTIONS.NOTIFICATION_ARCHIVE_ALL_JOBS],\r\n} as const;\r\n"]}
1
+ {"version":3,"file":"collection-refs.js","sourceRoot":"","sources":["../../src/paths/collection-refs.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,EAAE;AACF,8DAA8D;AAC9D,kEAAkE;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,YAAY,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC;IACzD,WAAW,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC;IACvD,oBAAoB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,sBAAsB,CAAC;IAC1E,kBAAkB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,mBAAmB,CAAC;IACrE,oBAAoB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,sBAAsB,CAAC;IAC1E,YAAY,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC;IACzD,WAAW,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC;IACvD,kBAAkB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAC;IACtE,eAAe,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC;IAC/D,eAAe,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC;IAC/D,gBAAgB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,kBAAkB,CAAC;IAClE,gBAAgB,E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B,CAAC;IAC7E,0BAA0B,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,6BAA6B,CAAC;CAC/E,CAAC","sourcesContent":["// Collection reference builders — for collection-level operations.\n//\n// Frontend: collection(db, ...COLLECTION_REFS.userProfiles())\n// Backend: db.collection(toPath(COLLECTION_REFS.userProfiles()))\n\nimport { COLLECTIONS } from './collections.js';\n\nexport const COLLECTION_REFS = {\n userProfiles: (): [string] => [COLLECTIONS.USER_PROFILES],\n publicUsers: (): [string] => [COLLECTIONS.PUBLIC_USERS],\n statusReconcileQueue: (): [string] => [COLLECTIONS.STATUS_RECONCILE_QUEUE],\n registrationStarts: (): [string] => [COLLECTIONS.REGISTRATION_STARTS],\n reservedDisplayNames: (): [string] => [COLLECTIONS.RESERVED_DISPLAY_NAMES],\n sportLeagues: (): [string] => [COLLECTIONS.SPORT_LEAGUES],\n leagueTeams: (): [string] => [COLLECTIONS.LEAGUE_TEAMS],\n leagueTeamContacts: (): [string] => [COLLECTIONS.LEAGUE_TEAM_CONTACTS],\n teamMemberships: (): [string] => [COLLECTIONS.TEAM_MEMBERSHIPS],\n teamInvitations: (): [string] => [COLLECTIONS.TEAM_INVITATIONS],\n teamJoinRequests: (): [string] => [COLLECTIONS.TEAM_JOIN_REQUESTS],\n leagueFreeAgents: (): [string] => [COLLECTIONS.LEAGUE_FREE_AGENTS],\n membershipRosterSyncs: (): [string] => [COLLECTIONS.MEMBERSHIP_ROSTER_SYNCS],\n sportGames: (): [string] => [COLLECTIONS.SPORT_GAMES],\n gameLocations: (): [string] => [COLLECTIONS.GAME_LOCATIONS],\n waiverTemplates: (): [string] => [COLLECTIONS.WAIVER_TEMPLATES],\n signedWaivers: (): [string] => [COLLECTIONS.SIGNED_WAIVERS],\n hardwareLoanContracts: (): [string] => [COLLECTIONS.HARDWARE_LOAN_CONTRACTS],\n awardDefinitions: (): [string] => [COLLECTIONS.AWARD_DEFINITIONS],\n statsValidationReports: (): [string] => [COLLECTIONS.STATS_VALIDATION_REPORTS],\n statsOperations: (): [string] => [COLLECTIONS.STATS_OPERATIONS],\n migrationActionRuns: (): [string] => [COLLECTIONS.MIGRATION_ACTION_RUNS],\n galleryPictures: (): [string] => [COLLECTIONS.GALLERY_PICTURES],\n pendingMedia: (): [string] => [COLLECTIONS.PENDING_MEDIA],\n pictureRetirements: (): [string] => [COLLECTIONS.PICTURE_RETIREMENTS],\n auditEvents: (): [string] => [COLLECTIONS.AUDIT_EVENTS],\n activeAdminNotifications: (): [string] => [COLLECTIONS.ACTIVE_ADMIN_NOTIFICATIONS],\n adminNotificationHistory: (): [string] => [COLLECTIONS.ADMIN_NOTIFICATION_HISTORY],\n notificationDeliveries: (): [string] => [COLLECTIONS.NOTIFICATION_DELIVERIES],\n notificationArchiveAllJobs: (): [string] => [COLLECTIONS.NOTIFICATION_ARCHIVE_ALL_JOBS],\n} as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"collections.js","sourceRoot":"","sources":["../../src/paths/collections.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,EAAE;AACF,gGAAgG;AAChG,mGAAmG;AACnG,mGAAmG;AACnG,6FAA6F;AAC7F,6BAA6B;AAC7B,gCAAgC;AAChC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,SAAS;IACT,aAAa,EAAE,cAAc;IAC7B,YAAY,EAAE,aAAa;IAC3B,2FAA2F;IAC3F,sBAAsB,EAAE,sBAAsB;IAC9C,2FAA2F;IAC3F,qEAAqE;IACrE,sBAAsB,EAAE,sBAAsB;IAC9C,iGAAiG;IACjG,2BAA2B;IAC3B,mBAAmB,EAAE,oBAAoB;IACzC,kGAAkG;IAClG,gBAAgB;IAChB,WAAW,EAAE,YAAY;IAEzB,6BAA6B;IAC7B,aAAa,EAAE,cAAc;IAC7B,YAAY,EAAE,aAAa;IAC3B,gGAAgG;IAChG,mGAAmG;IACnG,+BAA+B;IAC/B,oBAAoB,EAAE,oBAAoB;IAC1C,gBAAgB,EAAE,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,yBAAyB,GAAG;IACvC,6FAA6F;IAC7F,mBAAmB,EAAE,mBAAmB;IACxC,wEAAwE;IACxE,gBAAgB,EAAE,gBAAgB;IAClC,8EAA8E;IAC9E,iBAAiB,EAAE,iBAAiB;CAC5B,CAAC;AAEX,8DAA8D;AAC9D,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,4FAA4F;IAC5F,wBAAwB,EAAE,wBAAwB;CAC1C,CAAC;AAEX,kDAAkD;AAClD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,2BAA2B;IAC3B,gGAAgG;IAChG,UAAU,EAAE,KAAK;IACjB,YAAY,EAAE,aAAa;IAC3B,mEAAmE;IACnE,YAAY,EAAE,aAAa;IAE3B,+BAA+B;IAC/B,6FAA6F;IAC7F,UAAU,EAAE,WAAW;IAEvB,iCAAiC;IACjC,gGAAgG;IAChG,QAAQ;IACR,iBAAiB,EAAE,kBAAkB;CAC7B,CAAC","sourcesContent":["// Firestore collection, subcollection, and fixed-document name constants for Q-Sports.\r\n//\r\n// Every collection value is compound camelCase — it says what the documents are, never a single\r\n// bare word (guarded by __tests__/collections.test.ts). The three underscore buckets hold fixed-ID\r\n// system documents and are placed by who reads them; every one of them is callable-only for writes\r\n// (BACKEND-108). An admin-only document is server-only, read by an admin through a callable:\r\n// _appConfig public read\r\n// _systemData signed-in read\r\n// _serverData no client access\r\n\r\nexport const COLLECTIONS = {\r\n // People\r\n USER_PROFILES: 'userProfiles',\r\n PUBLIC_USERS: 'publicUsers',\r\n // One document per taken display name, keyed by its normalized form — the uniqueness lock.\r\n RESERVED_DISPLAY_NAMES: 'reservedDisplayNames',\r\n // One entry per account owed a post-commit Firebase Auth effect, id = the userId: a status\r\n // change's sign-in half, or a failed role-claim write. Backend-only.\r\n STATUS_RECONCILE_QUEUE: 'statusReconcileQueue',\r\n // One document per login whose registration started, id = the userId: the orphan-login cleanup's\r\n // work list. Backend-only.\r\n REGISTRATION_STARTS: 'registrationStarts',\r\n // One document per scheduled pass that keeps a rolling cursor, id = its `SWEEP_STATE_NAMES` name.\r\n // Backend-only.\r\n SWEEP_STATE: 'sweepState',\r\n\r\n // Leagues, teams, membership\r\n SPORT_LEAGUES: 'sportLeagues',\r\n LEAGUE_TEAMS: 'leagueTeams',\r\n // One admin-only document per team, id = the team id: how the league reaches the team. The team\r\n // itself is publicly readable, so no contact detail lives on it (BACKEND-105); a league's contacts\r\n // are one query on `leagueId`.\r\n LEAGUE_TEAM_CONTACTS: 'leagueTeamContacts',\r\n TEAM_MEMBERSHIPS: 'teamMemberships',\r\n TEAM_INVITATIONS: 'teamInvitations',\r\n TEAM_JOIN_REQUESTS: 'teamJoinRequests',\r\n LEAGUE_FREE_AGENTS: 'leagueFreeAgents',\r\n // One document per team membership, id = the membership's id: the durable obligation to bring\r\n // that membership's open game rosters in line with it. Backend-only.\r\n MEMBERSHIP_ROSTER_SYNCS: 'membershipRosterSyncs',\r\n\r\n // Games\r\n SPORT_GAMES: 'sportGames',\r\n GAME_LOCATIONS: 'gameLocations',\r\n\r\n // Waivers and hardware\r\n WAIVER_TEMPLATES: 'waiverTemplates',\r\n SIGNED_WAIVERS: 'signedWaivers',\r\n HARDWARE_LOAN_CONTRACTS: 'hardwareLoanContracts',\r\n\r\n // Awards and derived stats\r\n AWARD_DEFINITIONS: 'awardDefinitions',\r\n SPORT_HALL_OF_FAME: 'sportHallOfFame',\r\n STATS_VALIDATION_REPORTS: 'statsValidationReports',\r\n // One logical run of a stats action: its status, its resume position, and the hold it places on\r\n // a game. Admin read; written only by the stats cores.\r\n STATS_OPERATIONS: 'statsOperations',\r\n\r\n // One document per cutover action, id = the action id: where its latest real run stands, its\r\n // last preview, and what it reported. Admin read; written only by the migration console.\r\n MIGRATION_ACTION_RUNS: 'migrationActionRuns',\r\n\r\n // One document per picture in a league, team, or landing page gallery. Public read; written only\r\n // by the picture core.\r\n GALLERY_PICTURES: 'galleryPictures',\r\n // One accepted picture upload, id = its staging id = the picture id. Read by its uploader and\r\n // admins; written only by the accept core (the upload callable and the picture carry), the\r\n // processing trigger, and the maintenance sweep's stale-upload pass; never deleted.\r\n PENDING_MEDIA: 'pendingMedia',\r\n // The durable obligation to delete a picture's files, or a deleted owner's whole gallery. No\r\n // client access; carried out by the media maintenance sweep.\r\n PICTURE_RETIREMENTS: 'pictureRetirements',\r\n\r\n // Append-only record of sensitive actions. No client access; written only by Cloud Functions.\r\n AUDIT_EVENTS: 'auditEvents',\r\n\r\n // Admin notifications, all written only by Cloud Functions. The shared cards every admin reads and\r\n // their archived history are admin read; the delivery ledger the owning callables write each\r\n // occurrence into, and each admin's archive-all job, have no client access.\r\n ACTIVE_ADMIN_NOTIFICATIONS: 'activeAdminNotifications',\r\n ADMIN_NOTIFICATION_HISTORY: 'adminNotificationHistory',\r\n NOTIFICATION_DELIVERIES: 'notificationDeliveries',\r\n NOTIFICATION_ARCHIVE_ALL_JOBS: 'notificationArchiveAllJobs',\r\n\r\n // Fixed-ID system document buckets\r\n APP_CONFIG: '_appConfig',\r\n SYSTEM_DATA: '_systemData',\r\n SERVER_DATA: '_serverData',\r\n} as const;\r\n\r\nexport type CollectionName = (typeof COLLECTIONS)[keyof typeof COLLECTIONS];\r\n\r\n/** Subcollections of `userProfiles/{userId}`. */\r\nexport const USER_PROFILE_SUBCOLLECTIONS = {\r\n // One document per sport key: pre-Q-Sports career totals folded into lifetime recalculation.\r\n HISTORICAL_STATS: 'historicalStats',\r\n // One owner-only document, id = the userId: email and contact details. The profile itself is\r\n // publicly readable, so nothing personal lives on it (BACKEND-105).\r\n PRIVATE_DATA: 'privateData',\r\n} as const;\r\n\r\n/** Subcollections of `sportGames/{gameId}`. */\r\nexport const SPORT_GAME_SUBCOLLECTIONS = {\r\n // Who participated in the game: one entry per team per person, id `buildGameRosterPlayerId`.\r\n GAME_ROSTER_PLAYERS: 'gameRosterPlayers',\r\n // One stat event per document, keyed by the event id minted at the tap.\r\n GAME_STAT_EVENTS: 'gameStatEvents',\r\n // A completed game's finalized record, in pages, id `buildStatHistoryPageId`.\r\n GAME_STAT_HISTORY: 'gameStatHistory',\r\n} as const;\r\n\r\n/** Subcollections of `waiverTemplates/{waiverTemplateId}`. */\r\nexport const WAIVER_TEMPLATE_SUBCOLLECTIONS = {\r\n // One immutable document per published wording, id `buildWaiverTemplateVersionId(version)`.\r\n WAIVER_TEMPLATE_VERSIONS: 'waiverTemplateVersions',\r\n} as const;\r\n\r\n/** Static document IDs for fixed-ID documents. */\r\nexport const SPECIAL_DOCS = {\r\n // _appConfig — public read\r\n // The app-wide operational levers: version gate, maintenance mode, registration switch, banner.\r\n APP_CONFIG: 'app',\r\n LANDING_PAGE: 'landingPage',\r\n // Public because signed-out spectators follow it for live updates.\r\n STATS_BEACON: 'statsBeacon',\r\n\r\n // _systemData — signed-in read\r\n // The admin and referee rosters — source of truth for the `admin` / `referee` custom claims.\r\n ADMIN_LIST: 'adminList',\r\n\r\n // _serverData — no client access\r\n // The migration console: the cutover marker and the lock that keeps two actions from running at\r\n // once.\r\n MIGRATION_CONSOLE: 'migrationConsole',\r\n} as const;\r\n"]}
1
+ {"version":3,"file":"collections.js","sourceRoot":"","sources":["../../src/paths/collections.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,EAAE;AACF,gGAAgG;AAChG,mGAAmG;AACnG,mGAAmG;AACnG,6FAA6F;AAC7F,6BAA6B;AAC7B,gCAAgC;AAChC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,SAAS;IACT,aAAa,EAAE,cAAc;IAC7B,YAAY,EAAE,aAAa;IAC3B,2FAA2F;IAC3F,sBAAsB,EAAE,sBAAsB;IAC9C,2FAA2F;IAC3F,qEAAqE;IACrE,sBAAsB,EAAE,sBAAsB;IAC9C,iGAAiG;IACjG,2BAA2B;IAC3B,mBAAmB,EAAE,oBAAoB;IACzC,kGAAkG;IAClG,gBAAgB;IAChB,WAAW,EAAE,YAAY;IAEzB,6BAA6B;IAC7B,aAAa,EAAE,cAAc;IAC7B,YAAY,EAAE,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nC,6FAA6F;IAC7F,oEAAoE;IACpE,YAAY,EAAE,aAAa;CACnB,CAAC;AAEX,+CAA+C;AAC/C,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,6FAA6F;IAC7F,mBAAmB,EAAE,mBAAmB;IACxC,wEAAwE;IACxE,gBAAgB,EAAE,gBAAgB;IAClC,8EAA8E;IAC9E,iBAAiB,EAAE,iBAAiB;CAC5B,CAAC;AAEX,8DAA8D;AAC9D,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,4FAA4F;IAC5F,wBAAwB,EAAE,wBAAwB;CAC1C,CAAC;AAEX,kDAAkD;AAClD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,2BAA2B;IAC3B,gGAAgG;IAChG,UAAU,EAAE,KAAK;IACjB,YAAY,EAAE,aAAa;IAC3B,mEAAmE;IACnE,YAAY,EAAE,aAAa;IAE3B,+BAA+B;IAC/B,6FAA6F;IAC7F,UAAU,EAAE,WAAW;IAEvB,iCAAiC;IACjC,gGAAgG;IAChG,QAAQ;IACR,iBAAiB,EAAE,kBAAkB;CAC7B,CAAC","sourcesContent":["// Firestore collection, subcollection, and fixed-document name constants for Q-Sports.\n//\n// Every collection value is compound camelCase — it says what the documents are, never a single\n// bare word (guarded by __tests__/collections.test.ts). The three underscore buckets hold fixed-ID\n// system documents and are placed by who reads them; every one of them is callable-only for writes\n// (BACKEND-108). An admin-only document is server-only, read by an admin through a callable:\n// _appConfig public read\n// _systemData signed-in read\n// _serverData no client access\n\nexport const COLLECTIONS = {\n // People\n USER_PROFILES: 'userProfiles',\n PUBLIC_USERS: 'publicUsers',\n // One document per taken display name, keyed by its normalized form — the uniqueness lock.\n RESERVED_DISPLAY_NAMES: 'reservedDisplayNames',\n // One entry per account owed a post-commit Firebase Auth effect, id = the userId: a status\n // change's sign-in half, or a failed role-claim write. Backend-only.\n STATUS_RECONCILE_QUEUE: 'statusReconcileQueue',\n // One document per login whose registration started, id = the userId: the orphan-login cleanup's\n // work list. Backend-only.\n REGISTRATION_STARTS: 'registrationStarts',\n // One document per scheduled pass that keeps a rolling cursor, id = its `SWEEP_STATE_NAMES` name.\n // Backend-only.\n SWEEP_STATE: 'sweepState',\n\n // Leagues, teams, membership\n SPORT_LEAGUES: 'sportLeagues',\n LEAGUE_TEAMS: 'leagueTeams',\n // One admin-only document per team, id = the team id: how the league reaches the team. The team\n // itself is publicly readable, so no contact detail lives on it (BACKEND-105); a league's contacts\n // are one query on `leagueId`.\n LEAGUE_TEAM_CONTACTS: 'leagueTeamContacts',\n TEAM_MEMBERSHIPS: 'teamMemberships',\n TEAM_INVITATIONS: 'teamInvitations',\n TEAM_JOIN_REQUESTS: 'teamJoinRequests',\n LEAGUE_FREE_AGENTS: 'leagueFreeAgents',\n // One document per team membership, id = the membership's id: the durable obligation to bring\n // that membership's open game rosters in line with it. Backend-only.\n MEMBERSHIP_ROSTER_SYNCS: 'membershipRosterSyncs',\n\n // Games\n SPORT_GAMES: 'sportGames',\n GAME_LOCATIONS: 'gameLocations',\n\n // Waivers and hardware\n WAIVER_TEMPLATES: 'waiverTemplates',\n SIGNED_WAIVERS: 'signedWaivers',\n HARDWARE_LOAN_CONTRACTS: 'hardwareLoanContracts',\n\n // Awards and derived stats\n AWARD_DEFINITIONS: 'awardDefinitions',\n SPORT_HALL_OF_FAME: 'sportHallOfFame',\n STATS_VALIDATION_REPORTS: 'statsValidationReports',\n // One logical run of a stats action: its status, its resume position, and the hold it places on\n // a game. Admin read; written only by the stats cores.\n STATS_OPERATIONS: 'statsOperations',\n\n // One document per cutover action, id = the action id: where its latest real run stands, its\n // last preview, and what it reported. Admin read; written only by the migration console.\n MIGRATION_ACTION_RUNS: 'migrationActionRuns',\n\n // One document per picture in a league, team, or landing page gallery. Public read; written only\n // by the picture core.\n GALLERY_PICTURES: 'galleryPictures',\n // One accepted picture upload, id = its staging id = the picture id. Read by its uploader and\n // admins; written only by the accept core (the upload callable and the picture carry), the\n // processing trigger, and the maintenance sweep's stale-upload pass; never deleted.\n PENDING_MEDIA: 'pendingMedia',\n // The durable obligation to delete a picture's files, or a deleted owner's whole gallery. No\n // client access; carried out by the media maintenance sweep.\n PICTURE_RETIREMENTS: 'pictureRetirements',\n\n // Append-only record of sensitive actions. No client access; written only by Cloud Functions.\n AUDIT_EVENTS: 'auditEvents',\n\n // Admin notifications, all written only by Cloud Functions. The shared cards every admin reads and\n // their archived history are admin read; the delivery ledger the owning callables write each\n // occurrence into, and each admin's archive-all job, have no client access.\n ACTIVE_ADMIN_NOTIFICATIONS: 'activeAdminNotifications',\n ADMIN_NOTIFICATION_HISTORY: 'adminNotificationHistory',\n NOTIFICATION_DELIVERIES: 'notificationDeliveries',\n NOTIFICATION_ARCHIVE_ALL_JOBS: 'notificationArchiveAllJobs',\n\n // Fixed-ID system document buckets\n APP_CONFIG: '_appConfig',\n SYSTEM_DATA: '_systemData',\n SERVER_DATA: '_serverData',\n} as const;\n\nexport type CollectionName = (typeof COLLECTIONS)[keyof typeof COLLECTIONS];\n\n/** Subcollections of `userProfiles/{userId}`. */\nexport const USER_PROFILE_SUBCOLLECTIONS = {\n // One document per sport key: pre-Q-Sports career totals folded into lifetime recalculation.\n HISTORICAL_STATS: 'historicalStats',\n // One owner-only document, id = the userId: email and contact details. The profile itself is\n // publicly readable, so nothing personal lives on it (BACKEND-105).\n PRIVATE_DATA: 'privateData',\n} as const;\n\n/** Subcollections of `sportGames/{gameId}`. */\nexport const SPORT_GAME_SUBCOLLECTIONS = {\n // Who participated in the game: one entry per team per person, id `buildGameRosterPlayerId`.\n GAME_ROSTER_PLAYERS: 'gameRosterPlayers',\n // One stat event per document, keyed by the event id minted at the tap.\n GAME_STAT_EVENTS: 'gameStatEvents',\n // A completed game's finalized record, in pages, id `buildStatHistoryPageId`.\n GAME_STAT_HISTORY: 'gameStatHistory',\n} as const;\n\n/** Subcollections of `waiverTemplates/{waiverTemplateId}`. */\nexport const WAIVER_TEMPLATE_SUBCOLLECTIONS = {\n // One immutable document per published wording, id `buildWaiverTemplateVersionId(version)`.\n WAIVER_TEMPLATE_VERSIONS: 'waiverTemplateVersions',\n} as const;\n\n/** Static document IDs for fixed-ID documents. */\nexport const SPECIAL_DOCS = {\n // _appConfig — public read\n // The app-wide operational levers: version gate, maintenance mode, registration switch, banner.\n APP_CONFIG: 'app',\n LANDING_PAGE: 'landingPage',\n // Public because signed-out spectators follow it for live updates.\n STATS_BEACON: 'statsBeacon',\n\n // _systemData — signed-in read\n // The admin and referee rosters — source of truth for the `admin` / `referee` custom claims.\n ADMIN_LIST: 'adminList',\n\n // _serverData — no client access\n // The migration console: the cutover marker and the lock that keeps two actions from running at\n // once.\n MIGRATION_CONSOLE: 'migrationConsole',\n} as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"path-builders.js","sourceRoot":"","sources":["../../src/paths/path-builders.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,0DAA0D;AAC1D,8DAA8D;AAC9D,EAAE;AACF,iGAAiG;AACjG,mGAAmG;AACnG,8EAA8E;AAE9E,OAAO,EACL,WAAW,EACX,yBAAyB,EACzB,YAAY,EACZ,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,SAAS;IACT,WAAW,EAAE,CAAC,MAAc,EAAoB,EAAE,CAAC,CAAC,WAAW,CAAC,aAAa,EAAE,MAAM,CAAC;IACtF,eAAe,EAAE,CAAC,MAAc,EAAoC,EAAE,CAAC;QACrE,WAAW,CAAC,aAAa;QACzB,MAAM;QACN,2BAA2B,CAAC,YAAY;QACxC,MAAM;KACP;IACD,cAAc,EAAE,CA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WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC;IACxF,SAAS,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,YAAY,CAAC,UAAU,CAAC;IACrF,gBAAgB,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,YAAY,CAAC,iBAAiB,CAAC;CAC3F,CAAC","sourcesContent":["// Document path builders — segment tuples, the one path family.\r\n//\r\n// Frontend: doc(db, ...PATH_BUILDERS.userProfile(userId))\r\n// Backend: db.doc(toPath(PATH_BUILDERS.userProfile(userId)))\r\n//\r\n// A singular name builds a document path; its plural builds the parent collection path where the\r\n// parent is a subcollection (top-level collections are in COLLECTION_REFS). A compound document ID\r\n// is assembled here through its one builder in ../ids — never at a call site.\r\n\r\nimport {\r\n COLLECTIONS,\r\n SPORT_GAME_SUBCOLLECTIONS,\r\n SPECIAL_DOCS,\r\n USER_PROFILE_SUBCOLLECTIONS,\r\n WAIVER_TEMPLATE_SUBCOLLECTIONS,\r\n} from './collections.js';\r\nimport type { SweepStateName } from '../constants/scheduled-jobs.js';\r\nimport {\r\n buildGameRosterPlayerId,\r\n buildLeagueFreeAgentId,\r\n buildTeamMembershipId,\r\n buildSignedWaiverId,\r\n} from '../ids/compound-ids.js';\r\nimport { buildWaiverTemplateVersionId } from '../ids/waiver-template-ids.js';\r\nimport type { SportKey } from '../types/sports.js';\r\nimport { toReservedDisplayNameKey } from '../utils/display-name.js';\r\n\r\nexport const PATH_BUILDERS = {\r\n // People\r\n userProfile: (userId: string): [string, string] => [COLLECTIONS.USER_PROFILES, userId],\r\n userPrivateData: (userId: string): [string, string, string, string] => [\r\n COLLECTIONS.USER_PROFILES,\r\n userId,\r\n USER_PROFILE_SUBCOLLECTIONS.PRIVATE_DATA,\r\n userId,\r\n ],\r\n historicalStat: (userId: string, sportKey: SportKey): [string, string, string, string] => [\r\n COLLECTIONS.USER_PROFILES,\r\n userId,\r\n USER_PROFILE_SUBCOLLECTIONS.HISTORICAL_STATS,\r\n sportKey,\r\n ],\r\n historicalStats: (userId: string): [string, string, string] => [\r\n COLLECTIONS.USER_PROFILES,\r\n userId,\r\n USER_PROFILE_SUBCOLLECTIONS.HISTORICAL_STATS,\r\n ],\r\n publicUser: (userId: string): [string, string] => [COLLECTIONS.PUBLIC_USERS, userId],\r\n statusReconcileQueueEntry: (userId: string): [string, string] => [COLLECTIONS.STATUS_RECONCILE_QUEUE, userId],\r\n registrationStart: (userId: string): [string, string] => [COLLECTIONS.REGISTRATION_STARTS, userId],\r\n sweepState: (name: SweepStateName): [string, string] => [COLLECTIONS.SWEEP_STATE, name],\r\n reservedDisplayName: (displayName: string): [string, string] => [\r\n COLLECTIONS.RESERVED_DISPLAY_NAMES,\r\n toReservedDisplayNameKey(displayName),\r\n ],\r\n\r\n // Leagues, teams, membership\r\n sportLeague: (leagueId: string): [string, string] => [COLLECTIONS.SPORT_LEAGUES, leagueId],\r\n leagueTeam: (teamId: string): [string, string] => [COLLECTIONS.LEAGUE_TEAMS, teamId],\r\n leagueTeamContact: (teamId: string): [string, string] => [COLLECTIONS.LEAGUE_TEAM_CONTACTS, teamId],\r\n teamMembership: (leagueId: string, teamId: string, userId: string): [string, string] => [\r\n COLLECTIONS.TEAM_MEMBERSHIPS,\r\n buildTeamMembershipId(leagueId, teamId, userId),\r\n ],\r\n membershipRosterSync: (leagueId: string, teamId: string, userId: string): [string, string] => [\r\n COLLECTIONS.MEMBERSHIP_ROSTER_SYNCS,\r\n buildTeamMembershipId(leagueId, teamId, userId),\r\n ],\r\n teamInvitation: (inviteId: string): [string, string] => [COLLECTIONS.TEAM_INVITATIONS, inviteId],\r\n teamJoinRequest: (requestId: string): [string, string] => [COLLECTIONS.TEAM_JOIN_REQUESTS, requestId],\r\n leagueFreeAgent: (leagueId: string, userId: string): [string, string] => [\r\n COLLECTIONS.LEAGUE_FREE_AGENTS,\r\n buildLeagueFreeAgentId(leagueId, userId),\r\n ],\r\n\r\n // Games\r\n sportGame: (gameId: string): [string, string] => [COLLECTIONS.SPORT_GAMES, gameId],\r\n gameRosterPlayer: (gameId: string, teamId: string, userId: string): [string, string, string, string] => [\r\n COLLECTIONS.SPORT_GAMES,\r\n gameId,\r\n SPORT_GAME_SUBCOLLECTIONS.GAME_ROSTER_PLAYERS,\r\n buildGameRosterPlayerId(teamId, userId),\r\n ],\r\n gameRosterPlayers: (gameId: string): [string, string, string] => [\r\n COLLECTIONS.SPORT_GAMES,\r\n gameId,\r\n SPORT_GAME_SUBCOLLECTIONS.GAME_ROSTER_PLAYERS,\r\n ],\r\n gameStatEvent: (gameId: string, eventId: string): [string, string, string, string] => [\r\n COLLECTIONS.SPORT_GAMES,\r\n gameId,\r\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_EVENTS,\r\n eventId,\r\n ],\r\n gameStatEvents: (gameId: string): [string, string, string] => [\r\n COLLECTIONS.SPORT_GAMES,\r\n gameId,\r\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_EVENTS,\r\n ],\r\n gameStatHistoryPage: (gameId: string, pageId: string): [string, string, string, string] => [\r\n COLLECTIONS.SPORT_GAMES,\r\n gameId,\r\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_HISTORY,\r\n pageId,\r\n ],\r\n gameStatHistory: (gameId: string): [string, string, string] => [\r\n COLLECTIONS.SPORT_GAMES,\r\n gameId,\r\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_HISTORY,\r\n ],\r\n gameLocation: (gameLocationId: string): [string, string] => [COLLECTIONS.GAME_LOCATIONS, gameLocationId],\r\n\r\n // Waivers and hardware\r\n waiverTemplate: (waiverTemplateId: string): [string, string] => [\r\n COLLECTIONS.WAIVER_TEMPLATES,\r\n waiverTemplateId,\r\n ],\r\n waiverTemplateVersion: (waiverTemplateId: string, version: number): [string, string, string, string] => [\r\n COLLECTIONS.WAIVER_TEMPLATES,\r\n waiverTemplateId,\r\n WAIVER_TEMPLATE_SUBCOLLECTIONS.WAIVER_TEMPLATE_VERSIONS,\r\n buildWaiverTemplateVersionId(version),\r\n ],\r\n waiverTemplateVersions: (waiverTemplateId: string): [string, string, string] => [\r\n COLLECTIONS.WAIVER_TEMPLATES,\r\n waiverTemplateId,\r\n WAIVER_TEMPLATE_SUBCOLLECTIONS.WAIVER_TEMPLATE_VERSIONS,\r\n ],\r\n signedWaiver: (leagueId: string, userId: string): [string, string] => [\r\n COLLECTIONS.SIGNED_WAIVERS,\r\n buildSignedWaiverId(leagueId, userId),\r\n ],\r\n hardwareLoanContract: (contractId: string): [string, string] => [\r\n COLLECTIONS.HARDWARE_LOAN_CONTRACTS,\r\n contractId,\r\n ],\r\n\r\n // Awards and derived stats\r\n awardDefinition: (awardId: string): [string, string] => [COLLECTIONS.AWARD_DEFINITIONS, awardId],\r\n sportHallOfFame: (sportKey: SportKey): [string, string] => [COLLECTIONS.SPORT_HALL_OF_FAME, sportKey],\r\n statsValidationReport: (reportId: string): [string, string] => [\r\n COLLECTIONS.STATS_VALIDATION_REPORTS,\r\n reportId,\r\n ],\r\n statsOperation: (operationId: string): [string, string] => [COLLECTIONS.STATS_OPERATIONS, operationId],\r\n migrationActionRun: (actionId: string): [string, string] => [COLLECTIONS.MIGRATION_ACTION_RUNS, actionId],\r\n\r\n galleryPicture: (pictureId: string): [string, string] => [COLLECTIONS.GALLERY_PICTURES, pictureId],\r\n pendingMedia: (pendingMediaId: string): [string, string] => [COLLECTIONS.PENDING_MEDIA, pendingMediaId],\r\n // A picture's retirement is keyed by the picture id; a whole gallery's by `buildGalleryRetirementId`.\r\n pictureRetirement: (retirementId: string): [string, string] => [\r\n COLLECTIONS.PICTURE_RETIREMENTS,\r\n retirementId,\r\n ],\r\n\r\n auditEvent: (auditEventId: string): [string, string] => [COLLECTIONS.AUDIT_EVENTS, auditEventId],\r\n\r\n // Admin notifications. A card's id is notification-core's; the others come from ../ids.\r\n activeAdminNotification: (notificationId: string): [string, string] => [\r\n COLLECTIONS.ACTIVE_ADMIN_NOTIFICATIONS,\r\n notificationId,\r\n ],\r\n adminNotificationHistoryEntry: (historyId: string): [string, string] => [\r\n COLLECTIONS.ADMIN_NOTIFICATION_HISTORY,\r\n historyId,\r\n ],\r\n notificationDelivery: (deliveryId: string): [string, string] => [COLLECTIONS.NOTIFICATION_DELIVERIES, deliveryId],\r\n notificationArchiveAllJob: (jobId: string): [string, string] => [COLLECTIONS.NOTIFICATION_ARCHIVE_ALL_JOBS, jobId],\r\n\r\n // Fixed-ID system documents\r\n landingPageConfig: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.LANDING_PAGE],\r\n appConfig: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.APP_CONFIG],\r\n statsBeacon: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.STATS_BEACON],\r\n adminList: (): [string, string] => [COLLECTIONS.SYSTEM_DATA, SPECIAL_DOCS.ADMIN_LIST],\r\n migrationConsole: (): [string, string] => [COLLECTIONS.SERVER_DATA, SPECIAL_DOCS.MIGRATION_CONSOLE],\r\n} as const;\r\n"]}
1
+ {"version":3,"file":"path-builders.js","sourceRoot":"","sources":["../../src/paths/path-builders.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,0DAA0D;AAC1D,8DAA8D;AAC9D,EAAE;AACF,iGAAiG;AACjG,mGAAmG;AACnG,8EAA8E;AAE9E,OAAO,EACL,WAAW,EACX,yBAAyB,EACzB,YAAY,EACZ,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,SAAS;IACT,WAAW,E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,iBAAiB,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC;IAC9F,SAAS,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,UAAU,CAAC;IACpF,WAAW,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC;IACxF,SAAS,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,YAAY,CAAC,UAAU,CAAC;IACrF,gBAAgB,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,YAAY,CAAC,iBAAiB,CAAC;CAC3F,CAAC","sourcesContent":["// Document path builders — segment tuples, the one path family.\n//\n// Frontend: doc(db, ...PATH_BUILDERS.userProfile(userId))\n// Backend: db.doc(toPath(PATH_BUILDERS.userProfile(userId)))\n//\n// A singular name builds a document path; its plural builds the parent collection path where the\n// parent is a subcollection (top-level collections are in COLLECTION_REFS). A compound document ID\n// is assembled here through its one builder in ../ids — never at a call site.\n\nimport {\n COLLECTIONS,\n SPORT_GAME_SUBCOLLECTIONS,\n SPECIAL_DOCS,\n USER_PROFILE_SUBCOLLECTIONS,\n WAIVER_TEMPLATE_SUBCOLLECTIONS,\n} from './collections.js';\nimport type { SweepStateName } from '../constants/scheduled-jobs.js';\nimport {\n buildGameRosterPlayerId,\n buildLeagueFreeAgentId,\n buildTeamMembershipId,\n buildSignedWaiverId,\n} from '../ids/compound-ids.js';\nimport { buildWaiverTemplateVersionId } from '../ids/waiver-template-ids.js';\nimport type { SportKey } from '../types/sports.js';\nimport { toReservedDisplayNameKey } from '../utils/display-name.js';\n\nexport const PATH_BUILDERS = {\n // People\n userProfile: (userId: string): [string, string] => [COLLECTIONS.USER_PROFILES, userId],\n userPrivateData: (userId: string): [string, string, string, string] => [\n COLLECTIONS.USER_PROFILES,\n userId,\n USER_PROFILE_SUBCOLLECTIONS.PRIVATE_DATA,\n userId,\n ],\n historicalStat: (userId: string, sportKey: SportKey): [string, string, string, string] => [\n COLLECTIONS.USER_PROFILES,\n userId,\n USER_PROFILE_SUBCOLLECTIONS.HISTORICAL_STATS,\n sportKey,\n ],\n historicalStats: (userId: string): [string, string, string] => [\n COLLECTIONS.USER_PROFILES,\n userId,\n USER_PROFILE_SUBCOLLECTIONS.HISTORICAL_STATS,\n ],\n publicUser: (userId: string): [string, string] => [COLLECTIONS.PUBLIC_USERS, userId],\n statusReconcileQueueEntry: (userId: string): [string, string] => [COLLECTIONS.STATUS_RECONCILE_QUEUE, userId],\n registrationStart: (userId: string): [string, string] => [COLLECTIONS.REGISTRATION_STARTS, userId],\n sweepState: (name: SweepStateName): [string, string] => [COLLECTIONS.SWEEP_STATE, name],\n reservedDisplayName: (displayName: string): [string, string] => [\n COLLECTIONS.RESERVED_DISPLAY_NAMES,\n toReservedDisplayNameKey(displayName),\n ],\n\n // Leagues, teams, membership\n sportLeague: (leagueId: string): [string, string] => [COLLECTIONS.SPORT_LEAGUES, leagueId],\n leagueTeam: (teamId: string): [string, string] => [COLLECTIONS.LEAGUE_TEAMS, teamId],\n leagueTeamContact: (teamId: string): [string, string] => [COLLECTIONS.LEAGUE_TEAM_CONTACTS, teamId],\n teamMembership: (leagueId: string, teamId: string, userId: string): [string, string] => [\n COLLECTIONS.TEAM_MEMBERSHIPS,\n buildTeamMembershipId(leagueId, teamId, userId),\n ],\n membershipRosterSync: (leagueId: string, teamId: string, userId: string): [string, string] => [\n COLLECTIONS.MEMBERSHIP_ROSTER_SYNCS,\n buildTeamMembershipId(leagueId, teamId, userId),\n ],\n teamInvitation: (inviteId: string): [string, string] => [COLLECTIONS.TEAM_INVITATIONS, inviteId],\n teamJoinRequest: (requestId: string): [string, string] => [COLLECTIONS.TEAM_JOIN_REQUESTS, requestId],\n leagueFreeAgent: (leagueId: string, userId: string): [string, string] => [\n COLLECTIONS.LEAGUE_FREE_AGENTS,\n buildLeagueFreeAgentId(leagueId, userId),\n ],\n\n // Games\n sportGame: (gameId: string): [string, string] => [COLLECTIONS.SPORT_GAMES, gameId],\n gameRosterPlayer: (gameId: string, teamId: string, userId: string): [string, string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_ROSTER_PLAYERS,\n buildGameRosterPlayerId(teamId, userId),\n ],\n gameRosterPlayers: (gameId: string): [string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_ROSTER_PLAYERS,\n ],\n gameStatEvent: (gameId: string, eventId: string): [string, string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_EVENTS,\n eventId,\n ],\n gameStatEvents: (gameId: string): [string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_EVENTS,\n ],\n gameStatHistoryPage: (gameId: string, pageId: string): [string, string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_HISTORY,\n pageId,\n ],\n gameStatHistory: (gameId: string): [string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_HISTORY,\n ],\n gameLocation: (gameLocationId: string): [string, string] => [COLLECTIONS.GAME_LOCATIONS, gameLocationId],\n\n // Waivers and hardware\n waiverTemplate: (waiverTemplateId: string): [string, string] => [\n COLLECTIONS.WAIVER_TEMPLATES,\n waiverTemplateId,\n ],\n waiverTemplateVersion: (waiverTemplateId: string, version: number): [string, string, string, string] => [\n COLLECTIONS.WAIVER_TEMPLATES,\n waiverTemplateId,\n WAIVER_TEMPLATE_SUBCOLLECTIONS.WAIVER_TEMPLATE_VERSIONS,\n buildWaiverTemplateVersionId(version),\n ],\n waiverTemplateVersions: (waiverTemplateId: string): [string, string, string] => [\n COLLECTIONS.WAIVER_TEMPLATES,\n waiverTemplateId,\n WAIVER_TEMPLATE_SUBCOLLECTIONS.WAIVER_TEMPLATE_VERSIONS,\n ],\n signedWaiver: (leagueId: string, userId: string): [string, string] => [\n COLLECTIONS.SIGNED_WAIVERS,\n buildSignedWaiverId(leagueId, userId),\n ],\n hardwareLoanContract: (contractId: string): [string, string] => [\n COLLECTIONS.HARDWARE_LOAN_CONTRACTS,\n contractId,\n ],\n\n // Awards and derived stats\n awardDefinition: (awardId: string): [string, string] => [COLLECTIONS.AWARD_DEFINITIONS, awardId],\n sportHallOfFame: (sportKey: SportKey): [string, string] => [COLLECTIONS.SPORT_HALL_OF_FAME, sportKey],\n statsValidationReport: (reportId: string): [string, string] => [\n COLLECTIONS.STATS_VALIDATION_REPORTS,\n reportId,\n ],\n statsOperation: (operationId: string): [string, string] => [COLLECTIONS.STATS_OPERATIONS, operationId],\n migrationActionRun: (actionId: string): [string, string] => [COLLECTIONS.MIGRATION_ACTION_RUNS, actionId],\n\n galleryPicture: (pictureId: string): [string, string] => [COLLECTIONS.GALLERY_PICTURES, pictureId],\n pendingMedia: (pendingMediaId: string): [string, string] => [COLLECTIONS.PENDING_MEDIA, pendingMediaId],\n // A picture's retirement is keyed by the picture id; a whole gallery's by `buildGalleryRetirementId`.\n pictureRetirement: (retirementId: string): [string, string] => [\n COLLECTIONS.PICTURE_RETIREMENTS,\n retirementId,\n ],\n\n auditEvent: (auditEventId: string): [string, string] => [COLLECTIONS.AUDIT_EVENTS, auditEventId],\n\n // Admin notifications. A card's id is notification-core's; the others come from ../ids.\n activeAdminNotification: (notificationId: string): [string, string] => [\n COLLECTIONS.ACTIVE_ADMIN_NOTIFICATIONS,\n notificationId,\n ],\n adminNotificationHistoryEntry: (historyId: string): [string, string] => [\n COLLECTIONS.ADMIN_NOTIFICATION_HISTORY,\n historyId,\n ],\n notificationDelivery: (deliveryId: string): [string, string] => [COLLECTIONS.NOTIFICATION_DELIVERIES, deliveryId],\n notificationArchiveAllJob: (jobId: string): [string, string] => [COLLECTIONS.NOTIFICATION_ARCHIVE_ALL_JOBS, jobId],\n\n // Fixed-ID system documents\n landingPageConfig: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.LANDING_PAGE],\n appConfig: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.APP_CONFIG],\n statsBeacon: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.STATS_BEACON],\n adminList: (): [string, string] => [COLLECTIONS.SYSTEM_DATA, SPECIAL_DOCS.ADMIN_LIST],\n migrationConsole: (): [string, string] => [COLLECTIONS.SERVER_DATA, SPECIAL_DOCS.MIGRATION_CONSOLE],\n} as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/paths/utils.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,2DAA2D;AAE3D,MAAM,UAAU,MAAM,CAAC,QAA2B;IAChD,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED,sDAAsD;AACtD,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAE1C,MAAM,4BAA4B,GAAG,UAAU,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAU;IAC5C,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACtD,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,4BAA4B,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,KAAK,CAAC;IACxD,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,IAAI,qBAAqB,CAAC;AACtE,CAAC","sourcesContent":["// Utility to convert path tuples to slash-delimited strings for Admin SDK.\r\n//\r\n// Usage: db.doc(toPath(PATH_BUILDERS.userProfile(userId)))\r\n\r\nexport function toPath(segments: readonly string[]): string {\r\n return segments.join('/');\r\n}\r\n\r\n// Firestore's limit on a document id, in UTF-8 bytes.\r\nexport const MAX_DOCUMENT_ID_BYTES = 1500;\r\n\r\nconst RESERVED_DOCUMENT_ID_PATTERN = /^__.*__$/;\r\n\r\n/**\r\n * Whether `id` names exactly one document under its collection: non-empty, no `/`, at most\r\n * `MAX_DOCUMENT_ID_BYTES` UTF-8 bytes, not `.` or `..`, and not an id Firestore reserves (`__…__`).\r\n * A `/` would address another document or a subcollection, and an empty id the collection itself,\r\n * so every id atom a path is built from checks this before any path exists (ARCH-106).\r\n */\r\nexport function isDocumentIdSegment(id: string): boolean {\r\n if (id.length === 0 || id.includes('/')) return false;\r\n if (id === '.' || id === '..') return false;\r\n if (RESERVED_DOCUMENT_ID_PATTERN.test(id)) return false;\r\n return new TextEncoder().encode(id).length <= MAX_DOCUMENT_ID_BYTES;\r\n}\r\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/paths/utils.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,2DAA2D;AAE3D,MAAM,UAAU,MAAM,CAAC,QAA2B;IAChD,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED,sDAAsD;AACtD,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAE1C,MAAM,4BAA4B,GAAG,UAAU,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAU;IAC5C,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACtD,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,4BAA4B,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,KAAK,CAAC;IACxD,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,IAAI,qBAAqB,CAAC;AACtE,CAAC","sourcesContent":["// Utility to convert path tuples to slash-delimited strings for Admin SDK.\n//\n// Usage: db.doc(toPath(PATH_BUILDERS.userProfile(userId)))\n\nexport function toPath(segments: readonly string[]): string {\n return segments.join('/');\n}\n\n// Firestore's limit on a document id, in UTF-8 bytes.\nexport const MAX_DOCUMENT_ID_BYTES = 1500;\n\nconst RESERVED_DOCUMENT_ID_PATTERN = /^__.*__$/;\n\n/**\n * Whether `id` names exactly one document under its collection: non-empty, no `/`, at most\n * `MAX_DOCUMENT_ID_BYTES` UTF-8 bytes, not `.` or `..`, and not an id Firestore reserves (`__…__`).\n * A `/` would address another document or a subcollection, and an empty id the collection itself,\n * so every id atom a path is built from checks this before any path exists (ARCH-106).\n */\nexport function isDocumentIdSegment(id: string): boolean {\n if (id.length === 0 || id.includes('/')) return false;\n if (id === '.' || id === '..') return false;\n if (RESERVED_DOCUMENT_ID_PATTERN.test(id)) return false;\n return new TextEncoder().encode(id).length <= MAX_DOCUMENT_ID_BYTES;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"account-settings.js","sourceRoot":"","sources":["../../src/schemas/account-settings.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,kGAAkG;AAClG,gGAAgG;AAChG,kFAAkF;AAElF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,KAAK,EAAE,eAAe,CAAC,QAAQ,EAAE;IACjC,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACrC,mCAAmC;IACnC,mBAAmB,EAAE,kBAAkB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC9D,CAAC;KACD,MAAM,EAAE;KACR,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,EAAE;IAC5E,OAAO,EAAE,8BAA8B;CACxC,CAAC,CAAC;AAGL,kGAAkG;AAClG,sCAAsC;AACtC,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,KAAK,EAAE,eAAe,CAAC,QAAQ,EAAE;IACjC,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACrC,mBAAmB,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IAClD,SAAS,EAAE,aAAa;CACzB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contract for the signed-in user's own settings on their owner-only\r\n// `userProfiles/{userId}/privateData/{userId}` document: the account's copy of the viewer's theme\r\n// and motion — the save theme-core's settings sync calls — and the account-only default contact\r\n// phone. The caller is always the account being changed; no user id is ever sent.\r\n\r\nimport { z } from 'zod';\r\nimport { epochMsSchema } from '../doc-schemas/atoms.js';\r\nimport { themeNameSchema } from '../doc-schemas/user-profile.js';\r\nimport { contactPhoneSchema } from './atoms.js';\r\n\r\nexport const UpdateAccountSettingsInputSchema = z\r\n .object({\r\n theme: themeNameSchema.optional(),\r\n reducedMotion: z.boolean().optional(),\r\n // `null` removes the saved number.\r\n defaultContactPhone: contactPhoneSchema.nullable().optional(),\r\n })\r\n .strict()\r\n .refine((input) => Object.values(input).some((value) => value !== undefined), {\r\n message: 'Change at least one setting.',\r\n });\r\nexport type UpdateAccountSettingsInput = z.infer<typeof UpdateAccountSettingsInputSchema>;\r\n\r\n// Every setting as committed, `null` where the account has nothing saved — the shape the settings\r\n// sync reads the account's values in.\r\nexport const UpdateAccountSettingsResultSchema = z\r\n .object({\r\n theme: themeNameSchema.nullable(),\r\n reducedMotion: z.boolean().nullable(),\r\n defaultContactPhone: contactPhoneSchema.nullable(),\r\n updatedAt: epochMsSchema,\r\n })\r\n .strict();\r\nexport type UpdateAccountSettingsResult = z.infer<typeof UpdateAccountSettingsResultSchema>;\r\n"]}
1
+ {"version":3,"file":"account-settings.js","sourceRoot":"","sources":["../../src/schemas/account-settings.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,kGAAkG;AAClG,gGAAgG;AAChG,kFAAkF;AAElF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,KAAK,EAAE,eAAe,CAAC,QAAQ,EAAE;IACjC,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACrC,mCAAmC;IACnC,mBAAmB,EAAE,kBAAkB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC9D,CAAC;KACD,MAAM,EAAE;KACR,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,EAAE;IAC5E,OAAO,EAAE,8BAA8B;CACxC,CAAC,CAAC;AAGL,kGAAkG;AAClG,sCAAsC;AACtC,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,KAAK,EAAE,eAAe,CAAC,QAAQ,EAAE;IACjC,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACrC,mBAAmB,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IAClD,SAAS,EAAE,aAAa;CACzB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contract for the signed-in user's own settings on their owner-only\n// `userProfiles/{userId}/privateData/{userId}` document: the account's copy of the viewer's theme\n// and motion — the save theme-core's settings sync calls — and the account-only default contact\n// phone. The caller is always the account being changed; no user id is ever sent.\n\nimport { z } from 'zod';\nimport { epochMsSchema } from '../doc-schemas/atoms.js';\nimport { themeNameSchema } from '../doc-schemas/user-profile.js';\nimport { contactPhoneSchema } from './atoms.js';\n\nexport const UpdateAccountSettingsInputSchema = z\n .object({\n theme: themeNameSchema.optional(),\n reducedMotion: z.boolean().optional(),\n // `null` removes the saved number.\n defaultContactPhone: contactPhoneSchema.nullable().optional(),\n })\n .strict()\n .refine((input) => Object.values(input).some((value) => value !== undefined), {\n message: 'Change at least one setting.',\n });\nexport type UpdateAccountSettingsInput = z.infer<typeof UpdateAccountSettingsInputSchema>;\n\n// Every setting as committed, `null` where the account has nothing saved — the shape the settings\n// sync reads the account's values in.\nexport const UpdateAccountSettingsResultSchema = z\n .object({\n theme: themeNameSchema.nullable(),\n reducedMotion: z.boolean().nullable(),\n defaultContactPhone: contactPhoneSchema.nullable(),\n updatedAt: epochMsSchema,\n })\n .strict();\nexport type UpdateAccountSettingsResult = z.infer<typeof UpdateAccountSettingsResultSchema>;\n"]}
@@ -34,6 +34,7 @@ export declare const AdminGetNotificationArchiveAllStatusResultSchema: z.ZodObje
34
34
  }>;
35
35
  category: z.ZodLiteral<"admin">;
36
36
  archived: z.ZodNumber;
37
+ notArchived: z.ZodOptional<z.ZodNumber>;
37
38
  error: z.ZodOptional<z.ZodString>;
38
39
  }, z.core.$strict>;
39
40
  export type AdminGetNotificationArchiveAllStatusResult = z.infer<typeof AdminGetNotificationArchiveAllStatusResultSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"admin-notifications.d.ts","sourceRoot":"","sources":["../../src/schemas/admin-notifications.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,yBAAyB,aAAqE,CAAC;AAK5G,eAAO,MAAM,wBAAwB,aAA6B,CAAC;AAInE,eAAO,MAAM,2BAA2B,WAAW,CAAC;AAEpD,eAAO,MAAM,iCAAiC,aAEgD,CAAC;AAE/F,eAAO,MAAM,mCAAmC;;;;kBAMrC,CAAC;AACZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAGhG,eAAO,MAAM,oCAAoC;;kBAA+C,CAAC;AACjG,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG,eAAO,MAAM,uCAAuC;;kBAAgE,CAAC;AACrH,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAC;AACxG,eAAO,MAAM,wCAAwC;;kBAE1C,CAAC;AACZ,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC;AAE1G,eAAO,MAAM,+CAA+C;;kBAEjD,CAAC;AACZ,MAAM,MAAM,yCAAyC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+CAA+C,CAAC,CAAC;AAGxH,eAAO,MAAM,gDAAgD;;;;;;;;;;kBAOlD,CAAC;AACZ,MAAM,MAAM,0CAA0C,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gDAAgD,CAAC,CAAC"}
1
+ {"version":3,"file":"admin-notifications.d.ts","sourceRoot":"","sources":["../../src/schemas/admin-notifications.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,yBAAyB,aAAqE,CAAC;AAK5G,eAAO,MAAM,wBAAwB,aAA6B,CAAC;AAInE,eAAO,MAAM,2BAA2B,WAAW,CAAC;AAEpD,eAAO,MAAM,iCAAiC,aAEgD,CAAC;AAE/F,eAAO,MAAM,mCAAmC;;;;kBAMrC,CAAC;AACZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAGhG,eAAO,MAAM,oCAAoC;;kBAA+C,CAAC;AACjG,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG,eAAO,MAAM,uCAAuC;;kBAAgE,CAAC;AACrH,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAC;AACxG,eAAO,MAAM,wCAAwC;;kBAE1C,CAAC;AACZ,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC;AAE1G,eAAO,MAAM,+CAA+C;;kBAEjD,CAAC;AACZ,MAAM,MAAM,yCAAyC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+CAA+C,CAAC,CAAC;AAIxH,eAAO,MAAM,gDAAgD;;;;;;;;;;;kBAQlD,CAAC;AACZ,MAAM,MAAM,0CAA0C,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gDAAgD,CAAC,CAAC"}
@@ -37,13 +37,15 @@ export const AdminArchiveAllNotificationsResultSchema = z
37
37
  export const AdminGetNotificationArchiveAllStatusInputSchema = z
38
38
  .object({ jobId: notificationArchiveAllJobIdSchema })
39
39
  .strict();
40
- // notification-core's archive-all snapshot: the job's state, the category it drains, and how many
41
- // cards it has archived. A job that ran out of attempts with cards left reads as `incomplete`.
40
+ // notification-core's archive-all snapshot: the job's state, the category it drains, how many
41
+ // cards it has archived, and — on a completed job that left cards behind — how many it could not.
42
+ // A job that ran out of attempts with cards left reads as `incomplete`.
42
43
  export const AdminGetNotificationArchiveAllStatusResultSchema = z
43
44
  .object({
44
45
  state: z.enum(NOTIFICATION_ARCHIVE_ALL_JOB_STATE_KEYS),
45
46
  category: z.literal(ADMIN_NOTIFICATION_CATEGORY),
46
47
  archived: countSchema,
48
+ notArchived: countSchema.optional(),
47
49
  error: z.string().optional(),
48
50
  })
49
51
  .strict();
@@ -1 +1 @@
1
- {"version":3,"file":"admin-notifications.js","sourceRoot":"","sources":["../../src/schemas/admin-notifications.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,qGAAqG;AACrG,oGAAoG;AACpG,0FAA0F;AAC1F,iBAAiB;AAEjB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,uCAAuC,EAAE,MAAM,2BAA2B,CAAC;AACjH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,iGAAiG;AACjG,gGAAgG;AAChG,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,sBAAsB,EAAE,wBAAwB,CAAC,CAAC;AAE5G,kGAAkG;AAClG,iGAAiG;AACjG,mBAAmB;AACnB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEnE,oGAAoG;AACpG,iEAAiE;AACjE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAEpD,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,EAAE;KACR,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,gCAAgC,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,4BAA4B,CAAC,CAAC;AAE/F,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC;KACjD,MAAM,CAAC;IACN,SAAS,EAAE,2BAA2B;IACtC,cAAc,EAAE,yBAAyB;IACzC,0BAA0B,EAAE,wBAAwB;CACrD,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,+FAA+F;AAC/F,mFAAmF;AACnF,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAGjG,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,2BAA2B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAErH,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC;KACtD,MAAM,CAAC,EAAE,KAAK,EAAE,iCAAiC,EAAE,CAAC;KACpD,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,+CAA+C,GAAG,CAAC;KAC7D,MAAM,CAAC,EAAE,KAAK,EAAE,iCAAiC,EAAE,CAAC;KACpD,MAAM,EAAE,CAAC;AAEZ,kGAAkG;AAClG,+FAA+F;AAC/F,MAAM,CAAC,MAAM,gDAAgD,GAAG,CAAC;KAC9D,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,uCAAuC,CAAC;IACtD,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,2BAA2B,CAAC;IAChD,QAAQ,EAAE,WAAW;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the shared admin notifications: archiving one, archiving all of them,\n// and reading how an archive-all is going. The occurrences the delivery worker gave up on are listed\n// and replayed through the operator's dead letters (./dead-letters.ts). Admin only; a card is never\n// created by a client — the callable that owns each notified action writes its occurrence\n// (BACKEND-306).\n\nimport { z } from 'zod';\nimport { parseNotificationArchiveAllJobId } from '../ids/notification-ids.js';\nimport { ADMIN_NOTIFICATION_CATEGORY, NOTIFICATION_ARCHIVE_ALL_JOB_STATE_KEYS } from '../types/notifications.js';\nimport { countSchema } from './atoms.js';\n\n// A card's document id as notification-core derives it: a hex digest. Bounding it to letters and\n// digits keeps a client-sent id from addressing anything but a document of the card collection.\nexport const adminNotificationIdSchema = z.string().regex(/^[A-Za-z0-9]{1,128}$/, 'Not a notification id.');\n\n// The opaque generation token a card carried when the admin saw it. An action on the card applies\n// only while the card still carries it, so activity that arrived after the admin looked is never\n// archived unseen.\nexport const activityGenerationSchema = z.string().min(1).max(128);\n\n// A fresh UUID per click. An archive's history entry and an archive-all's job are keyed by it, so a\n// retry of the same click lands on what the first attempt wrote.\nexport const notificationRequestIdSchema = z.uuid();\n\nexport const notificationArchiveAllJobIdSchema = z\n .string()\n .refine((id) => parseNotificationArchiveAllJobId(id) !== null, 'Not an archive-all job id.');\n\nexport const AdminArchiveNotificationInputSchema = z\n .object({\n requestId: notificationRequestIdSchema,\n notificationId: adminNotificationIdSchema,\n observedActivityGeneration: activityGenerationSchema,\n })\n .strict();\nexport type AdminArchiveNotificationInput = z.infer<typeof AdminArchiveNotificationInputSchema>;\n// `archived` is false when there was nothing to archive at the generation named: another admin\n// archived the card first, or new activity lit it again, and it stays on the list.\nexport const AdminArchiveNotificationResultSchema = z.object({ archived: z.boolean() }).strict();\nexport type AdminArchiveNotificationResult = z.infer<typeof AdminArchiveNotificationResultSchema>;\n\nexport const AdminArchiveAllNotificationsInputSchema = z.object({ requestId: notificationRequestIdSchema }).strict();\nexport type AdminArchiveAllNotificationsInput = z.infer<typeof AdminArchiveAllNotificationsInputSchema>;\nexport const AdminArchiveAllNotificationsResultSchema = z\n .object({ jobId: notificationArchiveAllJobIdSchema })\n .strict();\nexport type AdminArchiveAllNotificationsResult = z.infer<typeof AdminArchiveAllNotificationsResultSchema>;\n\nexport const AdminGetNotificationArchiveAllStatusInputSchema = z\n .object({ jobId: notificationArchiveAllJobIdSchema })\n .strict();\nexport type AdminGetNotificationArchiveAllStatusInput = z.infer<typeof AdminGetNotificationArchiveAllStatusInputSchema>;\n// notification-core's archive-all snapshot: the job's state, the category it drains, and how many\n// cards it has archived. A job that ran out of attempts with cards left reads as `incomplete`.\nexport const AdminGetNotificationArchiveAllStatusResultSchema = z\n .object({\n state: z.enum(NOTIFICATION_ARCHIVE_ALL_JOB_STATE_KEYS),\n category: z.literal(ADMIN_NOTIFICATION_CATEGORY),\n archived: countSchema,\n error: z.string().optional(),\n })\n .strict();\nexport type AdminGetNotificationArchiveAllStatusResult = z.infer<typeof AdminGetNotificationArchiveAllStatusResultSchema>;\n"]}
1
+ {"version":3,"file":"admin-notifications.js","sourceRoot":"","sources":["../../src/schemas/admin-notifications.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,qGAAqG;AACrG,oGAAoG;AACpG,0FAA0F;AAC1F,iBAAiB;AAEjB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,uCAAuC,EAAE,MAAM,2BAA2B,CAAC;AACjH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,iGAAiG;AACjG,gGAAgG;AAChG,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,sBAAsB,EAAE,wBAAwB,CAAC,CAAC;AAE5G,kGAAkG;AAClG,iGAAiG;AACjG,mBAAmB;AACnB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEnE,oGAAoG;AACpG,iEAAiE;AACjE,MAA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,WAAW,CAAC,QAAQ,EAAE;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the shared admin notifications: archiving one, archiving all of them,\n// and reading how an archive-all is going. The occurrences the delivery worker gave up on are listed\n// and replayed through the operator's dead letters (./dead-letters.ts). Admin only; a card is never\n// created by a client — the callable that owns each notified action writes its occurrence\n// (BACKEND-306).\n\nimport { z } from 'zod';\nimport { parseNotificationArchiveAllJobId } from '../ids/notification-ids.js';\nimport { ADMIN_NOTIFICATION_CATEGORY, NOTIFICATION_ARCHIVE_ALL_JOB_STATE_KEYS } from '../types/notifications.js';\nimport { countSchema } from './atoms.js';\n\n// A card's document id as notification-core derives it: a hex digest. Bounding it to letters and\n// digits keeps a client-sent id from addressing anything but a document of the card collection.\nexport const adminNotificationIdSchema = z.string().regex(/^[A-Za-z0-9]{1,128}$/, 'Not a notification id.');\n\n// The opaque generation token a card carried when the admin saw it. An action on the card applies\n// only while the card still carries it, so activity that arrived after the admin looked is never\n// archived unseen.\nexport const activityGenerationSchema = z.string().min(1).max(128);\n\n// A fresh UUID per click. An archive's history entry and an archive-all's job are keyed by it, so a\n// retry of the same click lands on what the first attempt wrote.\nexport const notificationRequestIdSchema = z.uuid();\n\nexport const notificationArchiveAllJobIdSchema = z\n .string()\n .refine((id) => parseNotificationArchiveAllJobId(id) !== null, 'Not an archive-all job id.');\n\nexport const AdminArchiveNotificationInputSchema = z\n .object({\n requestId: notificationRequestIdSchema,\n notificationId: adminNotificationIdSchema,\n observedActivityGeneration: activityGenerationSchema,\n })\n .strict();\nexport type AdminArchiveNotificationInput = z.infer<typeof AdminArchiveNotificationInputSchema>;\n// `archived` is false when there was nothing to archive at the generation named: another admin\n// archived the card first, or new activity lit it again, and it stays on the list.\nexport const AdminArchiveNotificationResultSchema = z.object({ archived: z.boolean() }).strict();\nexport type AdminArchiveNotificationResult = z.infer<typeof AdminArchiveNotificationResultSchema>;\n\nexport const AdminArchiveAllNotificationsInputSchema = z.object({ requestId: notificationRequestIdSchema }).strict();\nexport type AdminArchiveAllNotificationsInput = z.infer<typeof AdminArchiveAllNotificationsInputSchema>;\nexport const AdminArchiveAllNotificationsResultSchema = z\n .object({ jobId: notificationArchiveAllJobIdSchema })\n .strict();\nexport type AdminArchiveAllNotificationsResult = z.infer<typeof AdminArchiveAllNotificationsResultSchema>;\n\nexport const AdminGetNotificationArchiveAllStatusInputSchema = z\n .object({ jobId: notificationArchiveAllJobIdSchema })\n .strict();\nexport type AdminGetNotificationArchiveAllStatusInput = z.infer<typeof AdminGetNotificationArchiveAllStatusInputSchema>;\n// notification-core's archive-all snapshot: the job's state, the category it drains, how many\n// cards it has archived, and — on a completed job that left cards behind — how many it could not.\n// A job that ran out of attempts with cards left reads as `incomplete`.\nexport const AdminGetNotificationArchiveAllStatusResultSchema = z\n .object({\n state: z.enum(NOTIFICATION_ARCHIVE_ALL_JOB_STATE_KEYS),\n category: z.literal(ADMIN_NOTIFICATION_CATEGORY),\n archived: countSchema,\n notArchived: countSchema.optional(),\n error: z.string().optional(),\n })\n .strict();\nexport type AdminGetNotificationArchiveAllStatusResult = z.infer<typeof AdminGetNotificationArchiveAllStatusResultSchema>;\n"]}
@@ -18,8 +18,8 @@ export declare const UpdateAppConfigResultSchema: z.ZodObject<{
18
18
  }, z.core.$strict>;
19
19
  export type UpdateAppConfigResult = z.infer<typeof UpdateAppConfigResultSchema>;
20
20
  export declare const AdminUpdateLandingPageInputSchema: z.ZodObject<{
21
- heroTitle: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
22
- aboutCompany: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
21
+ heroTitle: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
22
+ aboutCompany: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
23
23
  }, z.core.$strict>;
24
24
  export type AdminUpdateLandingPageInput = z.infer<typeof AdminUpdateLandingPageInputSchema>;
25
25
  export declare const AdminUpdateLandingPageResultSchema: z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"app-config.d.ts","sourceRoot":"","sources":["../../src/schemas/app-config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,0BAA0B;;;;;;kBAanC,CAAC;AACL,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,2BAA2B;;;;;;;;kBAE7B,CAAC;AACZ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAIhF,eAAO,MAAM,iCAAiC;;;kBAKnC,CAAC;AACZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAG5F,eAAO,MAAM,kCAAkC;;;;kBAMpC,CAAC;AACZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC"}
1
+ {"version":3,"file":"app-config.d.ts","sourceRoot":"","sources":["../../src/schemas/app-config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,0BAA0B;;;;;;kBAanC,CAAC;AACL,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,2BAA2B;;;;;;;;kBAE7B,CAAC;AACZ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAKhF,eAAO,MAAM,iCAAiC;;;kBAQ1C,CAAC;AACL,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAG5F,eAAO,MAAM,kCAAkC;;;;kBAMpC,CAAC;AACZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC"}
@@ -23,14 +23,18 @@ export const UpdateAppConfigInputSchema = z
23
23
  export const UpdateAppConfigResultSchema = z
24
24
  .object({ updatedFields: z.array(AppConfigSchema.keyof()) })
25
25
  .strict();
26
- // An admin edits the landing page copy on `_appConfig/landingPage`. Both fields are sent together,
27
- // as the editor saves them. The landing gallery is not part of this: only the picture core writes it.
26
+ // An admin edits the landing page copy on `_appConfig/landingPage`. The editor sends only the
27
+ // fields the admin changed, so saving one never rewrites the other with what this editor last read.
28
+ // The landing gallery is not part of this: only the picture core writes it.
28
29
  export const AdminUpdateLandingPageInputSchema = z
29
30
  .object({
30
- heroTitle: textFieldSchema(LANDING_HERO_TITLE_INPUT_FORMAT),
31
- aboutCompany: textFieldSchema(LANDING_ABOUT_TEXT_INPUT_FORMAT),
31
+ heroTitle: textFieldSchema(LANDING_HERO_TITLE_INPUT_FORMAT).optional(),
32
+ aboutCompany: textFieldSchema(LANDING_ABOUT_TEXT_INPUT_FORMAT).optional(),
32
33
  })
33
- .strict();
34
+ .strict()
35
+ .refine((input) => Object.values(input).some((value) => value !== undefined), {
36
+ message: 'Change at least one field.',
37
+ });
34
38
  // The copy as committed, so the caller can apply it to its cached landing document.
35
39
  export const AdminUpdateLandingPageResultSchema = z
36
40
  .object({
@@ -1 +1 @@
1
- {"version":3,"file":"app-config.js","sourceRoot":"","sources":["../../src/schemas/app-config.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,iGAAiG;AACjG,qBAAqB;AAErB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EACL,iCAAiC,EACjC,wBAAwB,EACxB,+BAA+B,EAC/B,+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AAC;IACN,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,SAAS,EAAE,aAAa;CACzB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the `_appConfig` documents an admin edits: the app-wide operational levers\n// and the landing page copy. Each input is a named field set (BACKEND-209) — never a document id\n// and a `data` blob.\n\nimport { z } from 'zod';\nimport { epochMsSchema, textFieldSchema } from '../doc-schemas/atoms.js';\nimport {\n ANNOUNCEMENT_MESSAGE_INPUT_FORMAT,\n APP_VERSION_INPUT_FORMAT,\n LANDING_ABOUT_TEXT_INPUT_FORMAT,\n LANDING_HERO_TITLE_INPUT_FORMAT,\n MAINTENANCE_MESSAGE_INPUT_FORMAT,\n} from '../input-formats/index.js';\nimport { AppConfigSchema } from '../doc-schemas/system.js';\n\n// An admin changes one or more levers on `_appConfig/app`. A lever left out keeps its value.\nexport const UpdateAppConfigInputSchema = z\n .object({\n // A published version is never blank: `''` is only the dormant default of a fresh environment.\n appVersion: textFieldSchema(APP_VERSION_INPUT_FORMAT).optional(),\n maintenanceMode: z.boolean().optional(),\n maintenanceMessage: textFieldSchema(MAINTENANCE_MESSAGE_INPUT_FORMAT).optional(),\n registrationEnabled: z.boolean().optional(),\n // `''` clears the banner.\n announcementMessage: textFieldSchema(ANNOUNCEMENT_MESSAGE_INPUT_FORMAT).optional(),\n })\n .strict()\n .refine((input) => Object.values(input).some((value) => value !== undefined), {\n message: 'Change at least one setting.',\n });\nexport type UpdateAppConfigInput = z.infer<typeof UpdateAppConfigInputSchema>;\n\nexport const UpdateAppConfigResultSchema = z\n .object({ updatedFields: z.array(AppConfigSchema.keyof()) })\n .strict();\nexport type UpdateAppConfigResult = z.infer<typeof UpdateAppConfigResultSchema>;\n\n// An admin edits the landing page copy on `_appConfig/landingPage`. Both fields are sent together,\n// as the editor saves them. The landing gallery is not part of this: only the picture core writes it.\nexport const AdminUpdateLandingPageInputSchema = z\n .object({\n heroTitle: textFieldSchema(LANDING_HERO_TITLE_INPUT_FORMAT),\n aboutCompany: textFieldSchema(LANDING_ABOUT_TEXT_INPUT_FORMAT),\n })\n .strict();\nexport type AdminUpdateLandingPageInput = z.infer<typeof AdminUpdateLandingPageInputSchema>;\n\n// The copy as committed, so the caller can apply it to its cached landing document.\nexport const AdminUpdateLandingPageResultSchema = z\n .object({\n heroTitle: z.string(),\n aboutCompany: z.string(),\n updatedAt: epochMsSchema,\n })\n .strict();\nexport type AdminUpdateLandingPageResult = z.infer<typeof AdminUpdateLandingPageResultSchema>;\n"]}
1
+ {"version":3,"file":"app-config.js","sourceRoot":"","sources":["../../src/schemas/app-config.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,iGAAiG;AACjG,qBAAqB;AAErB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EACL,iCAAiC,EACjC,wBAAwB,EACxB,+BAA+B,EAC/B,+BAA+B,EAC/B,gCAAgC,GACjC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,6FAA6F;AAC7F,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC;KACxC,MAAM,CAAC;IACN,+FAA+F;IAC/F,UAAU,EAAE,eAAe,CAAC,wBAAwB,CAAC,CAAC,QAAQ,EAAE;IAChE,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvC,kBAAkB,EAAE,eAAe,CAAC,gCAAgC,CAAC,CAAC,QAAQ,EAAE;IAChF,mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC3C,0BAA0B;IAC1B,mBAAmB,EAAE,eAAe,CAAC,iCAAiC,CAAC,CAAC,QAAQ,EAAE;CACnF,CAAC;KACD,MAAM,EAAE;KACR,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,EAAE;IAC5E,OAAO,EAAE,8BAA8B;CACxC,CAAC,CAAC;AAGL,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC;KACzC,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC;KAC3D,MAAM,EAAE,CAAC;AAGZ,8FAA8F;AAC9F,oGAAoG;AACpG,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,SAAS,EAAE,eAAe,CAAC,+BAA+B,CAAC,CAAC,QAAQ,EAAE;IACtE,YAAY,EAAE,eAAe,CAAC,+BAA+B,CAAC,CAAC,QAAQ,EAAE;CAC1E,CAAC;KACD,MAAM,EAAE;KACR,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,EAAE;IAC5E,OAAO,EAAE,4BAA4B;CACtC,CAAC,CAAC;AAGL,oFAAoF;AACpF,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC;KAChD,MAAM,CAAC;IACN,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,SAAS,EAAE,aAAa;CACzB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the `_appConfig` documents an admin edits: the app-wide operational levers\n// and the landing page copy. Each input is a named field set (BACKEND-209) — never a document id\n// and a `data` blob.\n\nimport { z } from 'zod';\nimport { epochMsSchema, textFieldSchema } from '../doc-schemas/atoms.js';\nimport {\n ANNOUNCEMENT_MESSAGE_INPUT_FORMAT,\n APP_VERSION_INPUT_FORMAT,\n LANDING_ABOUT_TEXT_INPUT_FORMAT,\n LANDING_HERO_TITLE_INPUT_FORMAT,\n MAINTENANCE_MESSAGE_INPUT_FORMAT,\n} from '../input-formats/index.js';\nimport { AppConfigSchema } from '../doc-schemas/system.js';\n\n// An admin changes one or more levers on `_appConfig/app`. A lever left out keeps its value.\nexport const UpdateAppConfigInputSchema = z\n .object({\n // A published version is never blank: `''` is only the dormant default of a fresh environment.\n appVersion: textFieldSchema(APP_VERSION_INPUT_FORMAT).optional(),\n maintenanceMode: z.boolean().optional(),\n maintenanceMessage: textFieldSchema(MAINTENANCE_MESSAGE_INPUT_FORMAT).optional(),\n registrationEnabled: z.boolean().optional(),\n // `''` clears the banner.\n announcementMessage: textFieldSchema(ANNOUNCEMENT_MESSAGE_INPUT_FORMAT).optional(),\n })\n .strict()\n .refine((input) => Object.values(input).some((value) => value !== undefined), {\n message: 'Change at least one setting.',\n });\nexport type UpdateAppConfigInput = z.infer<typeof UpdateAppConfigInputSchema>;\n\nexport const UpdateAppConfigResultSchema = z\n .object({ updatedFields: z.array(AppConfigSchema.keyof()) })\n .strict();\nexport type UpdateAppConfigResult = z.infer<typeof UpdateAppConfigResultSchema>;\n\n// An admin edits the landing page copy on `_appConfig/landingPage`. The editor sends only the\n// fields the admin changed, so saving one never rewrites the other with what this editor last read.\n// The landing gallery is not part of this: only the picture core writes it.\nexport const AdminUpdateLandingPageInputSchema = z\n .object({\n heroTitle: textFieldSchema(LANDING_HERO_TITLE_INPUT_FORMAT).optional(),\n aboutCompany: textFieldSchema(LANDING_ABOUT_TEXT_INPUT_FORMAT).optional(),\n })\n .strict()\n .refine((input) => Object.values(input).some((value) => value !== undefined), {\n message: 'Change at least one field.',\n });\nexport type AdminUpdateLandingPageInput = z.infer<typeof AdminUpdateLandingPageInputSchema>;\n\n// The copy as committed, so the caller can apply it to its cached landing document.\nexport const AdminUpdateLandingPageResultSchema = z\n .object({\n heroTitle: z.string(),\n aboutCompany: z.string(),\n updatedAt: epochMsSchema,\n })\n .strict();\nexport type AdminUpdateLandingPageResult = z.infer<typeof AdminUpdateLandingPageResultSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"atoms.js","sourceRoot":"","sources":["../../src/schemas/atoms.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,sGAAsG;AACtG,aAAa;AAEb,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,oCAAoC,EACpC,sCAAsC,EACtC,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEnF,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,cAAc,EACd,YAAY,GACb,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,uBAAuB,CAAC;AAE/D,mGAAmG;AACnG,2BAA2B;AAC3B,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,yBAAyB,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAC,sBAAsB,CAAC,CAAC;AACtE,kGAAkG;AAClG,+BAA+B;AAC/B,MAAM,CAAC,MAAM,4BAA4B,GAAG,eAAe,CAAC,sCAAsC,CAAC,CAAC;AACpG,+FAA+F;AAC/F,MAAM,CAAC,MAAM,2BAA2B,GAAG,eAAe,CAAC,oCAAoC,CAAC,CAAC;AACjG,kEAAkE;AAClE,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC,0BAA0B,CAAC,CAAC","sourcesContent":["// Atoms for callable wire contracts. Enums, id atoms, the count, and the repair reason are the\r\n// document atoms — one declaration, re-exported here so a callable schema file imports its atoms from\r\n// one place.\r\n\r\nimport {\r\n CONTACT_PHONE_INPUT_FORMAT,\r\n DISPLAY_NAME_INPUT_FORMAT,\r\n TEAM_INVITATION_MESSAGE_INPUT_FORMAT,\r\n TEAM_JOIN_REQUEST_MESSAGE_INPUT_FORMAT,\r\n TEAM_NAME_INPUT_FORMAT,\r\n} from '../input-formats/index.js';\r\n\r\nimport { documentIdSegmentSchema, textFieldSchema } from '../doc-schemas/atoms.js';\r\n\r\nexport {\r\n countSchema,\r\n epochMsSchema,\r\n gameIdSchema,\r\n gameRosterPlayerIdSchema,\r\n statEventIdSchema,\r\n leagueIdSchema,\r\n leagueModeSchema,\r\n repairReasonSchema,\r\n sportKeySchema,\r\n textFieldSchema,\r\n systemRoleSchema,\r\n teamIdSchema,\r\n teamIconSchema,\r\n teamRoleSchema,\r\n teamTypeSchema,\r\n userIdSchema,\r\n} from '../doc-schemas/atoms.js';\r\n\r\nexport const teamInvitationIdSchema = documentIdSegmentSchema;\r\nexport const teamJoinRequestIdSchema = documentIdSegmentSchema;\r\n\r\n// A display name and a team name, each built from its field's one declaration, so the form and the\r\n// wire run the same check.\r\nexport const displayNameSchema = textFieldSchema(DISPLAY_NAME_INPUT_FORMAT);\r\nexport const teamNameSchema = textFieldSchema(TEAM_NAME_INPUT_FORMAT);\r\n// A player's message with a join request, built from the field's one declaration, so the form and\r\n// the wire run the same check.\r\nexport const teamJoinRequestMessageSchema = textFieldSchema(TEAM_JOIN_REQUEST_MESSAGE_INPUT_FORMAT);\r\n// A captain's note on an invitation is optional — an empty note is stored as the empty string.\r\nexport const teamInvitationMessageSchema = textFieldSchema(TEAM_INVITATION_MESSAGE_INPUT_FORMAT);\r\n// A team's contact phone, built from its field's one declaration.\r\nexport const contactPhoneSchema = textFieldSchema(CONTACT_PHONE_INPUT_FORMAT);\r\n"]}
1
+ {"version":3,"file":"atoms.js","sourceRoot":"","sources":["../../src/schemas/atoms.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,sGAAsG;AACtG,aAAa;AAEb,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,oCAAoC,EACpC,sCAAsC,EACtC,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEnF,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,cAAc,EACd,YAAY,GACb,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,uBAAuB,CAAC;AAE/D,mGAAmG;AACnG,2BAA2B;AAC3B,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,yBAAyB,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAC,sBAAsB,CAAC,CAAC;AACtE,kGAAkG;AAClG,+BAA+B;AAC/B,MAAM,CAAC,MAAM,4BAA4B,GAAG,eAAe,CAAC,sCAAsC,CAAC,CAAC;AACpG,+FAA+F;AAC/F,MAAM,CAAC,MAAM,2BAA2B,GAAG,eAAe,CAAC,oCAAoC,CAAC,CAAC;AACjG,kEAAkE;AAClE,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC,0BAA0B,CAAC,CAAC","sourcesContent":["// Atoms for callable wire contracts. Enums, id atoms, the count, and the repair reason are the\n// document atoms — one declaration, re-exported here so a callable schema file imports its atoms from\n// one place.\n\nimport {\n CONTACT_PHONE_INPUT_FORMAT,\n DISPLAY_NAME_INPUT_FORMAT,\n TEAM_INVITATION_MESSAGE_INPUT_FORMAT,\n TEAM_JOIN_REQUEST_MESSAGE_INPUT_FORMAT,\n TEAM_NAME_INPUT_FORMAT,\n} from '../input-formats/index.js';\n\nimport { documentIdSegmentSchema, textFieldSchema } from '../doc-schemas/atoms.js';\n\nexport {\n countSchema,\n epochMsSchema,\n gameIdSchema,\n gameRosterPlayerIdSchema,\n statEventIdSchema,\n leagueIdSchema,\n leagueModeSchema,\n repairReasonSchema,\n sportKeySchema,\n textFieldSchema,\n systemRoleSchema,\n teamIdSchema,\n teamIconSchema,\n teamRoleSchema,\n teamTypeSchema,\n userIdSchema,\n} from '../doc-schemas/atoms.js';\n\nexport const teamInvitationIdSchema = documentIdSegmentSchema;\nexport const teamJoinRequestIdSchema = documentIdSegmentSchema;\n\n// A display name and a team name, each built from its field's one declaration, so the form and the\n// wire run the same check.\nexport const displayNameSchema = textFieldSchema(DISPLAY_NAME_INPUT_FORMAT);\nexport const teamNameSchema = textFieldSchema(TEAM_NAME_INPUT_FORMAT);\n// A player's message with a join request, built from the field's one declaration, so the form and\n// the wire run the same check.\nexport const teamJoinRequestMessageSchema = textFieldSchema(TEAM_JOIN_REQUEST_MESSAGE_INPUT_FORMAT);\n// A captain's note on an invitation is optional — an empty note is stored as the empty string.\nexport const teamInvitationMessageSchema = textFieldSchema(TEAM_INVITATION_MESSAGE_INPUT_FORMAT);\n// A team's contact phone, built from its field's one declaration.\nexport const contactPhoneSchema = textFieldSchema(CONTACT_PHONE_INPUT_FORMAT);\n"]}
@@ -39,10 +39,22 @@ export declare const AdminDeleteAwardDefinitionResultSchema: z.ZodObject<{
39
39
  deleted: z.ZodBoolean;
40
40
  }, z.core.$strict>;
41
41
  export type AdminDeleteAwardDefinitionResult = z.infer<typeof AdminDeleteAwardDefinitionResultSchema>;
42
- export declare const UpdateFeaturedAwardsInputSchema: z.ZodObject<{
43
- primaryAwardId: z.ZodNullable<z.ZodString>;
44
- secondaryAwardId: z.ZodNullable<z.ZodString>;
45
- }, z.core.$strict>;
42
+ export declare const UpdateFeaturedAwardsInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
43
+ action: z.ZodLiteral<"set">;
44
+ slot: z.ZodEnum<{
45
+ primary: "primary";
46
+ secondary: "secondary";
47
+ }>;
48
+ awardId: z.ZodString;
49
+ }, z.core.$strict>, z.ZodObject<{
50
+ action: z.ZodLiteral<"clear">;
51
+ slot: z.ZodEnum<{
52
+ primary: "primary";
53
+ secondary: "secondary";
54
+ }>;
55
+ }, z.core.$strict>, z.ZodObject<{
56
+ action: z.ZodLiteral<"swap">;
57
+ }, z.core.$strict>], "action">;
46
58
  export type UpdateFeaturedAwardsInput = z.infer<typeof UpdateFeaturedAwardsInputSchema>;
47
59
  export declare const UpdateFeaturedAwardsResultSchema: z.ZodObject<{
48
60
  userId: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"awards.d.ts","sourceRoot":"","sources":["../../src/schemas/awards.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,iCAAiC;;;;;;kBAmB3C,CAAC;AACJ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F,eAAO,MAAM,oBAAoB;;;;;;kBAEtB,CAAC;AACZ,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAKlE,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;kBASpC,CAAC;AACZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAG9F,eAAO,MAAM,qCAAqC;;kBAAgD,CAAC;AACnG,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAGpG,eAAO,MAAM,sCAAsC;;;kBAExC,CAAC;AACZ,MAAM,MAAM,gCAAgC,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F,eAAO,MAAM,gCAAgC;;;;;kBAOlC,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
@@ -6,7 +6,7 @@
6
6
  import { z } from 'zod';
7
7
  import { MAX_AWARD_GRANT_TARGETS } from '../constants/business.js';
8
8
  import { awardIdSchema } from '../doc-schemas/catalogs.js';
9
- import { AWARD_GRANT_SKIP_REASON_KEYS } from '../types/unions.js';
9
+ import { AWARD_GRANT_SKIP_REASON_KEYS, FEATURED_AWARD_SLOT_KEYS } from '../types/unions.js';
10
10
  import { leagueIdSchema, teamIdSchema, userIdSchema } from './atoms.js';
11
11
  const targetList = (atom) => z.array(atom).max(MAX_AWARD_GRANT_TARGETS).optional();
12
12
  // An admin grants an award to accounts — named directly, or as every active real member of a team
@@ -46,11 +46,15 @@ export const AdminDeleteAwardDefinitionResultSchema = z
46
46
  .object({ awardId: awardIdSchema, deleted: z.boolean() })
47
47
  .strict();
48
48
  // The signed-in account chooses which of its own awards to show beside its name: a primary and a
49
- // secondary badge, each an award it holds, or `null` for none. No user id is ever sent.
50
- export const UpdateFeaturedAwardsInputSchema = z
51
- .object({ primaryAwardId: awardIdSchema.nullable(), secondaryAwardId: awardIdSchema.nullable() })
52
- .strict()
53
- .refine((input) => input.primaryAwardId === null || input.primaryAwardId !== input.secondaryAwardId, { message: 'Choose two different awards.', path: ['secondaryAwardId'] });
49
+ // secondary badge, each an award it holds, or none. The input is the one change the person made —
50
+ // set a slot, clear a slot, or swap the two — and the core applies it to the pair as stored, so a
51
+ // change to one slot never writes back a stale value of the other. No user id is ever sent.
52
+ const featuredAwardSlotSchema = z.enum(FEATURED_AWARD_SLOT_KEYS);
53
+ export const UpdateFeaturedAwardsInputSchema = z.discriminatedUnion('action', [
54
+ z.object({ action: z.literal('set'), slot: featuredAwardSlotSchema, awardId: awardIdSchema }).strict(),
55
+ z.object({ action: z.literal('clear'), slot: featuredAwardSlotSchema }).strict(),
56
+ z.object({ action: z.literal('swap') }).strict(),
57
+ ]);
54
58
  export const UpdateFeaturedAwardsResultSchema = z
55
59
  .object({
56
60
  userId: userIdSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"awards.js","sourceRoot":"","sources":["../../src/schemas/awards.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,EAAE;AACF,oGAAoG;AACpG,gGAAgG;AAChG,+DAA+D;AAE/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAExE,MAAM,UAAU,GAAG,CAAyB,IAAO,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE,CAAC;AAE9G,kGAAkG;AAClG,sGAAsG;AACtG,qFAAqF;AACrF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,OAAO,EAAE,aAAa;IACtB,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC;IACtC,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC;IACtC,cAAc,EAAE,UAAU,CAAC,cAAc,CAAC;IAC1C,aAAa,EAAE,UAAU,CAAC,YAAY,CAAC;CACxC,CAAC;KACD,MAAM,EAAE;KACR,MAAM,CACL,CAAC,KAAK,EAAE,EAAE,CACR,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,CACtF,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,IA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,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;KACxD,MAAM,EAAE,CAAC;AAGZ,iGAAiG;AACjG,wFAAwF;AACxF,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC;KAC7C,MAAM,CAAC,EAAE,cAAc,EAAE,aAAa,CAAC,QAAQ,EAAE,EAAE,gBAAgB,EAAE,aAAa,CAAC,QAAQ,EAAE,EAAE,CAAC;KAChG,MAAM,EAAE;KACR,MAAM,CACL,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,KAAK,IAAI,IAAI,KAAK,CAAC,cAAc,KAAK,KAAK,CAAC,gBAAgB,EAC3F,EAAE,OAAO,EAAE,8BAA8B,EAAE,IAAI,EAAE,CAAC,kBAAkB,CAAC,EAAE,CACxE,CAAC;AAGJ,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,MAAM,EAAE,YAAY;IACpB,cAAc,EAAE,aAAa,CAAC,QAAQ,EAAE;IACxC,gBAAgB,EAAE,aAAa,CAAC,QAAQ,EAAE;IAC1C,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the award catalog, award grants, and the badges an account features.\r\n//\r\n// An award is created by its first badge's publication (the `award-badge` upload, ./uploads.ts), so\r\n// no callable here creates one. Grants and revokes share one input — four named lists, never an\r\n// action discriminator (BACKEND-002) — like the role roster's.\r\n\r\nimport { z } from 'zod';\r\nimport { MAX_AWARD_GRANT_TARGETS } from '../constants/business.js';\r\nimport { awardIdSchema } from '../doc-schemas/catalogs.js';\r\nimport { AWARD_GRANT_SKIP_REASON_KEYS } from '../types/unions.js';\r\nimport { leagueIdSchema, teamIdSchema, userIdSchema } from './atoms.js';\r\n\r\nconst targetList = <T extends z.ZodTypeAny>(atom: T) => z.array(atom).max(MAX_AWARD_GRANT_TARGETS).optional();\r\n\r\n// An admin grants an award to accounts — named directly, or as every active real member of a team\r\n// or of a league — and revokes it from accounts. Recipients are resolved on the server, deduplicated,\r\n// and bounded by MAX_AWARD_GRANT_RECIPIENTS; ghosts hold no account and are skipped.\r\nexport const AdminUpdateAwardGrantsInputSchema = z\r\n .object({\r\n awardId: awardIdSchema,\r\n grantUserIds: targetList(userIdSchema),\r\n grantTeamIds: targetList(teamIdSchema),\r\n grantLeagueIds: targetList(leagueIdSchema),\r\n revokeUserIds: targetList(userIdSchema),\r\n })\r\n .strict()\r\n .refine(\r\n (input) =>\r\n [input.grantUserIds, input.grantTeamIds, input.grantLeagueIds, input.revokeUserIds].some(\r\n (list) => list !== undefined && list.length > 0,\r\n ),\r\n { message: 'Name someone to grant the award to or revoke it from.' },\r\n )\r\n .refine(\r\n (input) => !(input.grantUserIds ?? []).some((userId) => (input.revokeUserIds ?? []).includes(userId)),\r\n { message: 'An account cannot be granted and revoked the award in one change.', path: ['revokeUserIds'] },\r\n );\r\nexport type AdminUpdateAwardGrantsInput = z.infer<typeof AdminUpdateAwardGrantsInputSchema>;\r\n\r\nexport const AwardGrantSkipSchema = z\r\n .object({ userId: userIdSchema, reason: z.enum(AWARD_GRANT_SKIP_REASON_KEYS) })\r\n .strict();\r\nexport type AwardGrantSkip = z.infer<typeof AwardGrantSkipSchema>;\r\n\r\n// What the change did for each account it reached: granted now, already held, revoked now, not held\r\n// to begin with, or skipped with its reason. A retried call reports the accounts its first call\r\n// changed as already held or not held, and writes nothing again.\r\nexport const AdminUpdateAwardGrantsResultSchema = z\r\n .object({\r\n awardId: awardIdSchema,\r\n granted: z.array(userIdSchema),\r\n alreadyHeld: z.array(userIdSchema),\r\n revoked: z.array(userIdSchema),\r\n notHeld: z.array(userIdSchema),\r\n skipped: z.array(AwardGrantSkipSchema),\r\n })\r\n .strict();\r\nexport type AdminUpdateAwardGrantsResult = z.infer<typeof AdminUpdateAwardGrantsResultSchema>;\r\n\r\n// An admin deletes an award nobody holds. Its badge's files are retired with it.\r\nexport const AdminDeleteAwardDefinitionInputSchema = z.object({ awardId: awardIdSchema }).strict();\r\nexport type AdminDeleteAwardDefinitionInput = z.infer<typeof AdminDeleteAwardDefinitionInputSchema>;\r\n\r\n// `deleted` is false when the award was already gone: nothing was written.\r\nexport const AdminDeleteAwardDefinitionResultSchema = z\r\n .object({ awardId: awardIdSchema, deleted: z.boolean() })\r\n .strict();\r\nexport type AdminDeleteAwardDefinitionResult = z.infer<typeof AdminDeleteAwardDefinitionResultSchema>;\r\n\r\n// The signed-in account chooses which of its own awards to show beside its name: a primary and a\r\n// secondary badge, each an award it holds, or `null` for none. No user id is ever sent.\r\nexport const UpdateFeaturedAwardsInputSchema = z\r\n .object({ primaryAwardId: awardIdSchema.nullable(), secondaryAwardId: awardIdSchema.nullable() })\r\n .strict()\r\n .refine(\r\n (input) => input.primaryAwardId === null || input.primaryAwardId !== input.secondaryAwardId,\r\n { message: 'Choose two different awards.', path: ['secondaryAwardId'] },\r\n );\r\nexport type UpdateFeaturedAwardsInput = z.infer<typeof UpdateFeaturedAwardsInputSchema>;\r\n\r\nexport const UpdateFeaturedAwardsResultSchema = z\r\n .object({\r\n userId: userIdSchema,\r\n primaryAwardId: awardIdSchema.nullable(),\r\n secondaryAwardId: awardIdSchema.nullable(),\r\n changed: z.boolean(),\r\n })\r\n .strict();\r\nexport type UpdateFeaturedAwardsResult = z.infer<typeof UpdateFeaturedAwardsResultSchema>;\r\n"]}
1
+ {"version":3,"file":"awards.js","sourceRoot":"","sources":["../../src/schemas/awards.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,EAAE;AACF,oGAAoG;AACpG,gGAAgG;AAChG,+DAA+D;AAE/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,wBAA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O,EAAE,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACtG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE;IAChF,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;CACjD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,MAAM,EAAE,YAAY;IACpB,cAAc,EAAE,aAAa,CAAC,QAAQ,EAAE;IACxC,gBAAgB,EAAE,aAAa,CAAC,QAAQ,EAAE;IAC1C,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the award catalog, award grants, and the badges an account features.\n//\n// An award is created by its first badge's publication (the `award-badge` upload, ./uploads.ts), so\n// no callable here creates one. Grants and revokes share one input — four named lists, never an\n// action discriminator (BACKEND-002) — like the role roster's.\n\nimport { z } from 'zod';\nimport { MAX_AWARD_GRANT_TARGETS } from '../constants/business.js';\nimport { awardIdSchema } from '../doc-schemas/catalogs.js';\nimport { AWARD_GRANT_SKIP_REASON_KEYS, FEATURED_AWARD_SLOT_KEYS } from '../types/unions.js';\nimport { leagueIdSchema, teamIdSchema, userIdSchema } from './atoms.js';\n\nconst targetList = <T extends z.ZodTypeAny>(atom: T) => z.array(atom).max(MAX_AWARD_GRANT_TARGETS).optional();\n\n// An admin grants an award to accounts — named directly, or as every active real member of a team\n// or of a league — and revokes it from accounts. Recipients are resolved on the server, deduplicated,\n// and bounded by MAX_AWARD_GRANT_RECIPIENTS; ghosts hold no account and are skipped.\nexport const AdminUpdateAwardGrantsInputSchema = z\n .object({\n awardId: awardIdSchema,\n grantUserIds: targetList(userIdSchema),\n grantTeamIds: targetList(teamIdSchema),\n grantLeagueIds: targetList(leagueIdSchema),\n revokeUserIds: targetList(userIdSchema),\n })\n .strict()\n .refine(\n (input) =>\n [input.grantUserIds, input.grantTeamIds, input.grantLeagueIds, input.revokeUserIds].some(\n (list) => list !== undefined && list.length > 0,\n ),\n { message: 'Name someone to grant the award to or revoke it from.' },\n )\n .refine(\n (input) => !(input.grantUserIds ?? []).some((userId) => (input.revokeUserIds ?? []).includes(userId)),\n { message: 'An account cannot be granted and revoked the award in one change.', path: ['revokeUserIds'] },\n );\nexport type AdminUpdateAwardGrantsInput = z.infer<typeof AdminUpdateAwardGrantsInputSchema>;\n\nexport const AwardGrantSkipSchema = z\n .object({ userId: userIdSchema, reason: z.enum(AWARD_GRANT_SKIP_REASON_KEYS) })\n .strict();\nexport type AwardGrantSkip = z.infer<typeof AwardGrantSkipSchema>;\n\n// What the change did for each account it reached: granted now, already held, revoked now, not held\n// to begin with, or skipped with its reason. A retried call reports the accounts its first call\n// changed as already held or not held, and writes nothing again.\nexport const AdminUpdateAwardGrantsResultSchema = z\n .object({\n awardId: awardIdSchema,\n granted: z.array(userIdSchema),\n alreadyHeld: z.array(userIdSchema),\n revoked: z.array(userIdSchema),\n notHeld: z.array(userIdSchema),\n skipped: z.array(AwardGrantSkipSchema),\n })\n .strict();\nexport type AdminUpdateAwardGrantsResult = z.infer<typeof AdminUpdateAwardGrantsResultSchema>;\n\n// An admin deletes an award nobody holds. Its badge's files are retired with it.\nexport const AdminDeleteAwardDefinitionInputSchema = z.object({ awardId: awardIdSchema }).strict();\nexport type AdminDeleteAwardDefinitionInput = z.infer<typeof AdminDeleteAwardDefinitionInputSchema>;\n\n// `deleted` is false when the award was already gone: nothing was written.\nexport const AdminDeleteAwardDefinitionResultSchema = z\n .object({ awardId: awardIdSchema, deleted: z.boolean() })\n .strict();\nexport type AdminDeleteAwardDefinitionResult = z.infer<typeof AdminDeleteAwardDefinitionResultSchema>;\n\n// The signed-in account chooses which of its own awards to show beside its name: a primary and a\n// secondary badge, each an award it holds, or none. The input is the one change the person made —\n// set a slot, clear a slot, or swap the two — and the core applies it to the pair as stored, so a\n// change to one slot never writes back a stale value of the other. No user id is ever sent.\nconst featuredAwardSlotSchema = z.enum(FEATURED_AWARD_SLOT_KEYS);\nexport const UpdateFeaturedAwardsInputSchema = z.discriminatedUnion('action', [\n z.object({ action: z.literal('set'), slot: featuredAwardSlotSchema, awardId: awardIdSchema }).strict(),\n z.object({ action: z.literal('clear'), slot: featuredAwardSlotSchema }).strict(),\n z.object({ action: z.literal('swap') }).strict(),\n]);\nexport type UpdateFeaturedAwardsInput = z.infer<typeof UpdateFeaturedAwardsInputSchema>;\n\nexport const UpdateFeaturedAwardsResultSchema = z\n .object({\n userId: userIdSchema,\n primaryAwardId: awardIdSchema.nullable(),\n secondaryAwardId: awardIdSchema.nullable(),\n changed: z.boolean(),\n })\n .strict();\nexport type UpdateFeaturedAwardsResult = z.infer<typeof UpdateFeaturedAwardsResultSchema>;\n"]}
@@ -16,11 +16,11 @@ export declare const AdminCreateGameLocationResultSchema: z.ZodObject<{
16
16
  }, z.core.$strict>;
17
17
  export type AdminCreateGameLocationResult = z.infer<typeof AdminCreateGameLocationResultSchema>;
18
18
  export declare const AdminUpdateGameLocationInputSchema: z.ZodObject<{
19
- name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
20
- streetAddress: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
21
- subLocations: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
22
- memo: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
23
19
  gameLocationId: z.ZodString;
20
+ name: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
21
+ streetAddress: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
22
+ subLocations: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
23
+ memo: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
24
24
  }, z.core.$strict>;
25
25
  export type AdminUpdateGameLocationInput = z.infer<typeof AdminUpdateGameLocationInputSchema>;
26
26
  export declare const AdminUpdateGameLocationResultSchema: z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"game-locations.d.ts","sourceRoot":"","sources":["../../src/schemas/game-locations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,sBAAsB,wDAAmD,CAAC;AACvF,eAAO,MAAM,+BAA+B,wDAA6D,CAAC;AAE1G,eAAO,MAAM,6BAA6B,wDAA2D,CAAC;AACtG,eAAO,MAAM,8BAA8B,oEAKvC,CAAC;AAEL,eAAO,MAAM,sBAAsB,wDAAmD,CAAC;AAUvF,eAAO,MAAM,kCAAkC;;;;;kBAA6C,CAAC;AAC7F,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,eAAO,MAAM,mCAAmC;;kBAErC,CAAC;AACZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG,eAAO,MAAM,kCAAkC;;;;;;kBAEpC,CAAC;AACZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,eAAO,MAAM,mCAAmC;;kBAErC,CAAC;AACZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG,eAAO,MAAM,kCAAkC;;kBAEpC,CAAC;AACZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,eAAO,MAAM,mCAAmC;;kBAErC,CAAC;AACZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC"}
1
+ {"version":3,"file":"game-locations.d.ts","sourceRoot":"","sources":["../../src/schemas/game-locations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,sBAAsB,wDAAmD,CAAC;AACvF,eAAO,MAAM,+BAA+B,wDAA6D,CAAC;AAE1G,eAAO,MAAM,6BAA6B,wDAA2D,CAAC;AACtG,eAAO,MAAM,8BAA8B,oEAKvC,CAAC;AAEL,eAAO,MAAM,sBAAsB,wDAAmD,CAAC;AAWvF,eAAO,MAAM,kCAAkC;;;;;kBAA6C,CAAC;AAC7F,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,eAAO,MAAM,mCAAmC;;kBAErC,CAAC;AACZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG,eAAO,MAAM,kCAAkC;;;;;;kBAY5C,CAAC;AACJ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,eAAO,MAAM,mCAAmC;;kBAErC,CAAC;AACZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG,eAAO,MAAM,kCAAkC;;kBAEpC,CAAC;AACZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,eAAO,MAAM,mCAAmC;;kBAErC,CAAC;AACZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC"}
@@ -17,7 +17,8 @@ export const gameLocationSubLocationsSchema = z
17
17
  });
18
18
  // An empty memo means the venue has none.
19
19
  export const gameLocationMemoSchema = textFieldSchema(GAME_LOCATION_MEMO_INPUT_FORMAT);
20
- // The venue's own fields, whole: an edit sends every one of them as the admin wants it to read.
20
+ // The venue's own fields. A create sends all of them; an edit sends only the ones the admin
21
+ // changed, so saving one never rewrites another with what this editor last read.
21
22
  const gameLocationFieldsShape = {
22
23
  name: gameLocationNameSchema,
23
24
  streetAddress: gameLocationStreetAddressSchema,
@@ -29,8 +30,15 @@ export const AdminCreateGameLocationResultSchema = z
29
30
  .object({ gameLocationId: gameLocationIdSchema })
30
31
  .strict();
31
32
  export const AdminUpdateGameLocationInputSchema = z
32
- .object({ gameLocationId: gameLocationIdSchema, ...gameLocationFieldsShape })
33
- .strict();
33
+ .object({
34
+ gameLocationId: gameLocationIdSchema,
35
+ name: gameLocationNameSchema.optional(),
36
+ streetAddress: gameLocationStreetAddressSchema.optional(),
37
+ subLocations: gameLocationSubLocationsSchema.optional(),
38
+ memo: gameLocationMemoSchema.optional(),
39
+ })
40
+ .strict()
41
+ .refine(({ gameLocationId: _gameLocationId, ...fields }) => Object.values(fields).some((value) => value !== undefined), { message: 'Change at least one field.' });
34
42
  export const AdminUpdateGameLocationResultSchema = z
35
43
  .object({ gameLocationId: gameLocationIdSchema })
36
44
  .strict();
@@ -1 +1 @@
1
- {"version":3,"file":"game-locations.js","sourceRoot":"","sources":["../../src/schemas/game-locations.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,yEAAyE;AAEzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EAC/B,yCAAyC,EACzC,uCAAuC,GACxC,MAAM,2BAA2B,CAAC;AAEnC,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe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AC,MAAM,kCAAkC,GAAG,CAAC;KAChD,MAAM,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAC;KAChD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC;KACjD,MAAM,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAC;KAChD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for game locations: create, edit, and delete one venue. Admin only. The\n// venue's picture goes through the upload pipeline, never through these.\n\nimport { z } from 'zod';\nimport { MAX_GAME_LOCATION_SUB_LOCATIONS } from '../constants/business.js';\nimport { textFieldSchema } from '../doc-schemas/atoms.js';\nimport { gameLocationIdSchema } from '../doc-schemas/game-location.js';\nimport {\n GAME_LOCATION_MEMO_INPUT_FORMAT,\n GAME_LOCATION_NAME_INPUT_FORMAT,\n GAME_LOCATION_STREET_ADDRESS_INPUT_FORMAT,\n GAME_LOCATION_SUB_LOCATION_INPUT_FORMAT,\n} from '../input-formats/index.js';\n\nexport const gameLocationNameSchema = textFieldSchema(GAME_LOCATION_NAME_INPUT_FORMAT);\nexport const gameLocationStreetAddressSchema = textFieldSchema(GAME_LOCATION_STREET_ADDRESS_INPUT_FORMAT);\n// One court, sheet, or room within a venue — as the venue lists it, and as a game names it.\nexport const gameLocationSubLocationSchema = textFieldSchema(GAME_LOCATION_SUB_LOCATION_INPUT_FORMAT);\nexport const gameLocationSubLocationsSchema = z\n .array(gameLocationSubLocationSchema)\n .max(MAX_GAME_LOCATION_SUB_LOCATIONS)\n .refine((subLocations) => new Set(subLocations).size === subLocations.length, {\n message: 'Each sub-location may appear only once.',\n });\n// An empty memo means the venue has none.\nexport const gameLocationMemoSchema = textFieldSchema(GAME_LOCATION_MEMO_INPUT_FORMAT);\n\n// The venue's own fields, whole: an edit sends every one of them as the admin wants it to read.\nconst gameLocationFieldsShape = {\n name: gameLocationNameSchema,\n streetAddress: gameLocationStreetAddressSchema,\n subLocations: gameLocationSubLocationsSchema,\n memo: gameLocationMemoSchema,\n};\n\nexport const AdminCreateGameLocationInputSchema = z.object(gameLocationFieldsShape).strict();\nexport type AdminCreateGameLocationInput = z.infer<typeof AdminCreateGameLocationInputSchema>;\nexport const AdminCreateGameLocationResultSchema = z\n .object({ gameLocationId: gameLocationIdSchema })\n .strict();\nexport type AdminCreateGameLocationResult = z.infer<typeof AdminCreateGameLocationResultSchema>;\n\nexport const AdminUpdateGameLocationInputSchema = z\n .object({ gameLocationId: gameLocationIdSchema, ...gameLocationFieldsShape })\n .strict();\nexport type AdminUpdateGameLocationInput = z.infer<typeof AdminUpdateGameLocationInputSchema>;\nexport const AdminUpdateGameLocationResultSchema = z\n .object({ gameLocationId: gameLocationIdSchema })\n .strict();\nexport type AdminUpdateGameLocationResult = z.infer<typeof AdminUpdateGameLocationResultSchema>;\n\nexport const AdminDeleteGameLocationInputSchema = z\n .object({ gameLocationId: gameLocationIdSchema })\n .strict();\nexport type AdminDeleteGameLocationInput = z.infer<typeof AdminDeleteGameLocationInputSchema>;\nexport const AdminDeleteGameLocationResultSchema = z\n .object({ gameLocationId: gameLocationIdSchema })\n .strict();\nexport type AdminDeleteGameLocationResult = z.infer<typeof AdminDeleteGameLocationResultSchema>;\n"]}
1
+ {"version":3,"file":"game-locations.js","sourceRoot":"","sources":["../../src/schemas/game-locations.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,yEAAyE;AAEzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EAC/B,yCAAyC,EACzC,uCAAuC,GACxC,MAAM,2BAA2B,CAAC;AAEnC,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAC,+BAA+B,CAA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,EAAE;KACR,MAAM,CACL,CAAC,EAAE,cAAc,EAAE,eAAe,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,EAC9G,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAC1C,CAAC;AAEJ,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC;KACjD,MAAM,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAC;KAChD,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC;KAChD,MAAM,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAC;KAChD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC;KACjD,MAAM,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAC;KAChD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for game locations: create, edit, and delete one venue. Admin only. The\n// venue's picture goes through the upload pipeline, never through these.\n\nimport { z } from 'zod';\nimport { MAX_GAME_LOCATION_SUB_LOCATIONS } from '../constants/business.js';\nimport { textFieldSchema } from '../doc-schemas/atoms.js';\nimport { gameLocationIdSchema } from '../doc-schemas/game-location.js';\nimport {\n GAME_LOCATION_MEMO_INPUT_FORMAT,\n GAME_LOCATION_NAME_INPUT_FORMAT,\n GAME_LOCATION_STREET_ADDRESS_INPUT_FORMAT,\n GAME_LOCATION_SUB_LOCATION_INPUT_FORMAT,\n} from '../input-formats/index.js';\n\nexport const gameLocationNameSchema = textFieldSchema(GAME_LOCATION_NAME_INPUT_FORMAT);\nexport const gameLocationStreetAddressSchema = textFieldSchema(GAME_LOCATION_STREET_ADDRESS_INPUT_FORMAT);\n// One court, sheet, or room within a venue — as the venue lists it, and as a game names it.\nexport const gameLocationSubLocationSchema = textFieldSchema(GAME_LOCATION_SUB_LOCATION_INPUT_FORMAT);\nexport const gameLocationSubLocationsSchema = z\n .array(gameLocationSubLocationSchema)\n .max(MAX_GAME_LOCATION_SUB_LOCATIONS)\n .refine((subLocations) => new Set(subLocations).size === subLocations.length, {\n message: 'Each sub-location may appear only once.',\n });\n// An empty memo means the venue has none.\nexport const gameLocationMemoSchema = textFieldSchema(GAME_LOCATION_MEMO_INPUT_FORMAT);\n\n// The venue's own fields. A create sends all of them; an edit sends only the ones the admin\n// changed, so saving one never rewrites another with what this editor last read.\nconst gameLocationFieldsShape = {\n name: gameLocationNameSchema,\n streetAddress: gameLocationStreetAddressSchema,\n subLocations: gameLocationSubLocationsSchema,\n memo: gameLocationMemoSchema,\n};\n\nexport const AdminCreateGameLocationInputSchema = z.object(gameLocationFieldsShape).strict();\nexport type AdminCreateGameLocationInput = z.infer<typeof AdminCreateGameLocationInputSchema>;\nexport const AdminCreateGameLocationResultSchema = z\n .object({ gameLocationId: gameLocationIdSchema })\n .strict();\nexport type AdminCreateGameLocationResult = z.infer<typeof AdminCreateGameLocationResultSchema>;\n\nexport const AdminUpdateGameLocationInputSchema = z\n .object({\n gameLocationId: gameLocationIdSchema,\n name: gameLocationNameSchema.optional(),\n streetAddress: gameLocationStreetAddressSchema.optional(),\n subLocations: gameLocationSubLocationsSchema.optional(),\n memo: gameLocationMemoSchema.optional(),\n })\n .strict()\n .refine(\n ({ gameLocationId: _gameLocationId, ...fields }) => Object.values(fields).some((value) => value !== undefined),\n { message: 'Change at least one field.' },\n );\nexport type AdminUpdateGameLocationInput = z.infer<typeof AdminUpdateGameLocationInputSchema>;\nexport const AdminUpdateGameLocationResultSchema = z\n .object({ gameLocationId: gameLocationIdSchema })\n .strict();\nexport type AdminUpdateGameLocationResult = z.infer<typeof AdminUpdateGameLocationResultSchema>;\n\nexport const AdminDeleteGameLocationInputSchema = z\n .object({ gameLocationId: gameLocationIdSchema })\n .strict();\nexport type AdminDeleteGameLocationInput = z.infer<typeof AdminDeleteGameLocationInputSchema>;\nexport const AdminDeleteGameLocationResultSchema = z\n .object({ gameLocationId: gameLocationIdSchema })\n .strict();\nexport type AdminDeleteGameLocationResult = z.infer<typeof AdminDeleteGameLocationResultSchema>;\n"]}