@ttt-productions/q-core 0.1.28 → 0.1.30
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.
- package/dist/constants/admin-views.d.ts.map +1 -1
- package/dist/constants/admin-views.js +0 -3
- package/dist/constants/admin-views.js.map +1 -1
- package/dist/constants/business.d.ts.map +1 -1
- package/dist/constants/business.js +0 -52
- package/dist/constants/business.js.map +1 -1
- package/dist/constants/deployment.d.ts +0 -2
- package/dist/constants/deployment.d.ts.map +1 -1
- package/dist/constants/deployment.js +0 -2
- package/dist/constants/deployment.js.map +1 -1
- package/dist/constants/media.d.ts.map +1 -1
- package/dist/constants/media.js +4 -30
- package/dist/constants/media.js.map +1 -1
- package/dist/constants/scheduled-jobs.d.ts +0 -25
- package/dist/constants/scheduled-jobs.d.ts.map +1 -1
- package/dist/constants/scheduled-jobs.js +0 -26
- package/dist/constants/scheduled-jobs.js.map +1 -1
- package/dist/constants/sports.d.ts +1 -0
- package/dist/constants/sports.d.ts.map +1 -1
- package/dist/constants/sports.js +4 -25
- package/dist/constants/sports.js.map +1 -1
- package/dist/constants/storage-keys.d.ts +0 -38
- package/dist/constants/storage-keys.d.ts.map +1 -1
- package/dist/constants/storage-keys.js +0 -41
- package/dist/constants/storage-keys.js.map +1 -1
- package/dist/constants/telemetry.d.ts +0 -3
- package/dist/constants/telemetry.d.ts.map +1 -1
- package/dist/constants/telemetry.js +2 -11
- package/dist/constants/telemetry.js.map +1 -1
- package/dist/doc-schemas/admin-notifications.d.ts +1 -2
- package/dist/doc-schemas/admin-notifications.d.ts.map +1 -1
- package/dist/doc-schemas/admin-notifications.js +0 -41
- package/dist/doc-schemas/admin-notifications.js.map +1 -1
- package/dist/doc-schemas/aggregate-stats.d.ts.map +1 -1
- package/dist/doc-schemas/aggregate-stats.js +0 -35
- package/dist/doc-schemas/aggregate-stats.js.map +1 -1
- package/dist/doc-schemas/atoms.d.ts +0 -17
- package/dist/doc-schemas/atoms.d.ts.map +1 -1
- package/dist/doc-schemas/atoms.js +0 -36
- package/dist/doc-schemas/atoms.js.map +1 -1
- package/dist/doc-schemas/audit-event.d.ts +2 -0
- package/dist/doc-schemas/audit-event.d.ts.map +1 -1
- package/dist/doc-schemas/audit-event.js +0 -8
- package/dist/doc-schemas/audit-event.js.map +1 -1
- package/dist/doc-schemas/award-group-grant.d.ts +2 -8
- package/dist/doc-schemas/award-group-grant.d.ts.map +1 -1
- package/dist/doc-schemas/award-group-grant.js +0 -25
- package/dist/doc-schemas/award-group-grant.js.map +1 -1
- package/dist/doc-schemas/catalogs.d.ts.map +1 -1
- package/dist/doc-schemas/catalogs.js +0 -12
- package/dist/doc-schemas/catalogs.js.map +1 -1
- package/dist/doc-schemas/firestore-primitives.d.ts.map +1 -1
- package/dist/doc-schemas/firestore-primitives.js +0 -5
- package/dist/doc-schemas/firestore-primitives.js.map +1 -1
- package/dist/doc-schemas/gallery.d.ts.map +1 -1
- package/dist/doc-schemas/gallery.js +9 -18
- package/dist/doc-schemas/gallery.js.map +1 -1
- package/dist/doc-schemas/game-location.d.ts.map +1 -1
- package/dist/doc-schemas/game-location.js +2 -11
- package/dist/doc-schemas/game-location.js.map +1 -1
- package/dist/doc-schemas/game-stat-history.d.ts.map +1 -1
- package/dist/doc-schemas/game-stat-history.js +2 -11
- package/dist/doc-schemas/game-stat-history.js.map +1 -1
- package/dist/doc-schemas/game-stats.d.ts.map +1 -1
- package/dist/doc-schemas/game-stats.js +0 -56
- package/dist/doc-schemas/game-stats.js.map +1 -1
- package/dist/doc-schemas/league-team.d.ts.map +1 -1
- package/dist/doc-schemas/league-team.js +6 -29
- package/dist/doc-schemas/league-team.js.map +1 -1
- package/dist/doc-schemas/membership-roster-sync.d.ts.map +1 -1
- package/dist/doc-schemas/membership-roster-sync.js +0 -17
- package/dist/doc-schemas/membership-roster-sync.js.map +1 -1
- package/dist/doc-schemas/migration-console.d.ts +21 -15
- package/dist/doc-schemas/migration-console.d.ts.map +1 -1
- package/dist/doc-schemas/migration-console.js +0 -32
- package/dist/doc-schemas/migration-console.js.map +1 -1
- package/dist/doc-schemas/pending-media.d.ts.map +1 -1
- package/dist/doc-schemas/pending-media.js +8 -20
- package/dist/doc-schemas/pending-media.js.map +1 -1
- package/dist/doc-schemas/picture-retirement.d.ts.map +1 -1
- package/dist/doc-schemas/picture-retirement.js +8 -13
- package/dist/doc-schemas/picture-retirement.js.map +1 -1
- package/dist/doc-schemas/publicUser.d.ts.map +1 -1
- package/dist/doc-schemas/publicUser.js +0 -5
- package/dist/doc-schemas/publicUser.js.map +1 -1
- package/dist/doc-schemas/registration-start.d.ts.map +1 -1
- package/dist/doc-schemas/registration-start.js +2 -5
- package/dist/doc-schemas/registration-start.js.map +1 -1
- package/dist/doc-schemas/registry.d.ts +25 -14
- package/dist/doc-schemas/registry.d.ts.map +1 -1
- package/dist/doc-schemas/registry.js +0 -10
- package/dist/doc-schemas/registry.js.map +1 -1
- package/dist/doc-schemas/reserved-display-name.d.ts.map +1 -1
- package/dist/doc-schemas/reserved-display-name.js +0 -5
- package/dist/doc-schemas/reserved-display-name.js.map +1 -1
- package/dist/doc-schemas/sport-game.d.ts.map +1 -1
- package/dist/doc-schemas/sport-game.js +1 -29
- package/dist/doc-schemas/sport-game.js.map +1 -1
- package/dist/doc-schemas/sport-league.d.ts +0 -9
- package/dist/doc-schemas/sport-league.d.ts.map +1 -1
- package/dist/doc-schemas/sport-league.js +4 -26
- package/dist/doc-schemas/sport-league.js.map +1 -1
- package/dist/doc-schemas/stats-operation.d.ts +22 -18
- package/dist/doc-schemas/stats-operation.d.ts.map +1 -1
- package/dist/doc-schemas/stats-operation.js +7 -44
- package/dist/doc-schemas/stats-operation.js.map +1 -1
- package/dist/doc-schemas/status-reconcile-queue.d.ts +0 -6
- package/dist/doc-schemas/status-reconcile-queue.d.ts.map +1 -1
- package/dist/doc-schemas/status-reconcile-queue.js +0 -13
- package/dist/doc-schemas/status-reconcile-queue.js.map +1 -1
- package/dist/doc-schemas/sweep-state.d.ts.map +1 -1
- package/dist/doc-schemas/sweep-state.js +4 -20
- package/dist/doc-schemas/sweep-state.js.map +1 -1
- package/dist/doc-schemas/system.d.ts.map +1 -1
- package/dist/doc-schemas/system.js +1 -27
- package/dist/doc-schemas/system.js.map +1 -1
- package/dist/doc-schemas/team-membership.d.ts.map +1 -1
- package/dist/doc-schemas/team-membership.js +0 -10
- package/dist/doc-schemas/team-membership.js.map +1 -1
- package/dist/doc-schemas/user-profile.d.ts +0 -1
- package/dist/doc-schemas/user-profile.d.ts.map +1 -1
- package/dist/doc-schemas/user-profile.js +0 -28
- package/dist/doc-schemas/user-profile.js.map +1 -1
- package/dist/doc-schemas/waiver-template.d.ts.map +1 -1
- package/dist/doc-schemas/waiver-template.js +4 -25
- package/dist/doc-schemas/waiver-template.js.map +1 -1
- package/dist/doc-schemas/waivers-and-hardware.d.ts.map +1 -1
- package/dist/doc-schemas/waivers-and-hardware.js +0 -20
- package/dist/doc-schemas/waivers-and-hardware.js.map +1 -1
- package/dist/domain-events/domain-events.d.ts.map +1 -1
- package/dist/domain-events/domain-events.js +0 -67
- package/dist/domain-events/domain-events.js.map +1 -1
- package/dist/ids/award-grant-ids.d.ts.map +1 -1
- package/dist/ids/award-grant-ids.js +0 -7
- package/dist/ids/award-grant-ids.js.map +1 -1
- package/dist/ids/compound-ids.d.ts.map +1 -1
- package/dist/ids/compound-ids.js +0 -7
- package/dist/ids/compound-ids.js.map +1 -1
- package/dist/ids/minted-ids.d.ts.map +1 -1
- package/dist/ids/minted-ids.js +4 -14
- package/dist/ids/minted-ids.js.map +1 -1
- package/dist/ids/notification-ids.d.ts.map +1 -1
- package/dist/ids/notification-ids.js +0 -15
- package/dist/ids/notification-ids.js.map +1 -1
- package/dist/ids/picture-ids.d.ts +0 -5
- package/dist/ids/picture-ids.d.ts.map +1 -1
- package/dist/ids/picture-ids.js +0 -11
- package/dist/ids/picture-ids.js.map +1 -1
- package/dist/ids/stat-event-ids.d.ts +0 -6
- package/dist/ids/stat-event-ids.d.ts.map +1 -1
- package/dist/ids/stat-event-ids.js +0 -15
- package/dist/ids/stat-event-ids.js.map +1 -1
- package/dist/ids/stats-operation-ids.d.ts.map +1 -1
- package/dist/ids/stats-operation-ids.js +0 -7
- package/dist/ids/stats-operation-ids.js.map +1 -1
- package/dist/ids/waiver-template-ids.d.ts +0 -1
- package/dist/ids/waiver-template-ids.d.ts.map +1 -1
- package/dist/ids/waiver-template-ids.js +0 -2
- package/dist/ids/waiver-template-ids.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/input-formats/input-formats.d.ts +0 -80
- package/dist/input-formats/input-formats.d.ts.map +1 -1
- package/dist/input-formats/input-formats.js +0 -86
- package/dist/input-formats/input-formats.js.map +1 -1
- package/dist/media/file-origins.d.ts +0 -3
- package/dist/media/file-origins.d.ts.map +1 -1
- package/dist/media/file-origins.js +0 -26
- package/dist/media/file-origins.js.map +1 -1
- package/dist/media/picture-aspects.d.ts +0 -2
- package/dist/media/picture-aspects.d.ts.map +1 -1
- package/dist/media/picture-aspects.js +0 -5
- package/dist/media/picture-aspects.js.map +1 -1
- package/dist/media/picture-url.d.ts +0 -6
- package/dist/media/picture-url.d.ts.map +1 -1
- package/dist/media/picture-url.js +0 -9
- package/dist/media/picture-url.js.map +1 -1
- package/dist/media/upload-tray-display.d.ts +0 -3
- package/dist/media/upload-tray-display.d.ts.map +1 -1
- package/dist/media/upload-tray-display.js +0 -6
- package/dist/media/upload-tray-display.js.map +1 -1
- package/dist/migration-console/action-ids.d.ts +4 -1
- package/dist/migration-console/action-ids.d.ts.map +1 -1
- package/dist/migration-console/action-ids.js +8 -45
- package/dist/migration-console/action-ids.js.map +1 -1
- package/dist/migration-console/console-lock.d.ts +10 -0
- package/dist/migration-console/console-lock.d.ts.map +1 -0
- package/dist/migration-console/console-lock.js +14 -0
- package/dist/migration-console/console-lock.js.map +1 -0
- package/dist/migration-console/consumed-source.d.ts +4 -0
- package/dist/migration-console/consumed-source.d.ts.map +1 -0
- package/dist/migration-console/consumed-source.js +10 -0
- package/dist/migration-console/consumed-source.js.map +1 -0
- package/dist/migration-console/manifest.d.ts +2 -24
- package/dist/migration-console/manifest.d.ts.map +1 -1
- package/dist/migration-console/manifest.js +174 -61
- package/dist/migration-console/manifest.js.map +1 -1
- package/dist/migration-console/run-state.d.ts +2 -14
- package/dist/migration-console/run-state.d.ts.map +1 -1
- package/dist/migration-console/run-state.js +3 -16
- package/dist/migration-console/run-state.js.map +1 -1
- package/dist/notifications/admin-notification-config.d.ts +0 -11
- package/dist/notifications/admin-notification-config.d.ts.map +1 -1
- package/dist/notifications/admin-notification-config.js +2 -13
- package/dist/notifications/admin-notification-config.js.map +1 -1
- package/dist/notifications/archive-all.d.ts.map +1 -1
- package/dist/notifications/archive-all.js +0 -2
- package/dist/notifications/archive-all.js.map +1 -1
- package/dist/notifications/occurrences.d.ts +0 -3
- package/dist/notifications/occurrences.d.ts.map +1 -1
- package/dist/notifications/occurrences.js +0 -7
- package/dist/notifications/occurrences.js.map +1 -1
- package/dist/paths/app-routes.d.ts +0 -12
- package/dist/paths/app-routes.d.ts.map +1 -1
- package/dist/paths/app-routes.js +0 -18
- package/dist/paths/app-routes.js.map +1 -1
- package/dist/paths/collection-groups.d.ts.map +1 -1
- package/dist/paths/collection-groups.js +0 -5
- package/dist/paths/collection-groups.js.map +1 -1
- package/dist/paths/collection-refs.d.ts.map +1 -1
- package/dist/paths/collection-refs.js +0 -4
- package/dist/paths/collection-refs.js.map +1 -1
- package/dist/paths/collections.d.ts +0 -5
- package/dist/paths/collections.d.ts.map +1 -1
- package/dist/paths/collections.js +0 -68
- package/dist/paths/collections.js.map +1 -1
- package/dist/paths/path-builders.d.ts.map +1 -1
- package/dist/paths/path-builders.js +0 -16
- package/dist/paths/path-builders.js.map +1 -1
- package/dist/paths/picture-owner-paths.d.ts +0 -4
- package/dist/paths/picture-owner-paths.d.ts.map +1 -1
- package/dist/paths/picture-owner-paths.js +2 -11
- package/dist/paths/picture-owner-paths.js.map +1 -1
- package/dist/paths/storage-paths.d.ts +0 -18
- package/dist/paths/storage-paths.d.ts.map +1 -1
- package/dist/paths/storage-paths.js +0 -23
- package/dist/paths/storage-paths.js.map +1 -1
- package/dist/paths/utils.d.ts +0 -6
- package/dist/paths/utils.d.ts.map +1 -1
- package/dist/paths/utils.js +0 -9
- package/dist/paths/utils.js.map +1 -1
- package/dist/schemas/account-settings.d.ts.map +1 -1
- package/dist/schemas/account-settings.js +0 -7
- package/dist/schemas/account-settings.js.map +1 -1
- package/dist/schemas/admin-notifications.d.ts.map +1 -1
- package/dist/schemas/admin-notifications.js +0 -17
- package/dist/schemas/admin-notifications.js.map +1 -1
- package/dist/schemas/admin-stats.d.ts.map +1 -1
- package/dist/schemas/admin-stats.js +0 -9
- package/dist/schemas/admin-stats.js.map +1 -1
- package/dist/schemas/app-config.d.ts.map +1 -1
- package/dist/schemas/app-config.js +0 -10
- package/dist/schemas/app-config.js.map +1 -1
- package/dist/schemas/atoms.d.ts.map +1 -1
- package/dist/schemas/atoms.js +0 -10
- package/dist/schemas/atoms.js.map +1 -1
- package/dist/schemas/awards.d.ts +3 -3
- package/dist/schemas/awards.d.ts.map +1 -1
- package/dist/schemas/awards.js +0 -29
- package/dist/schemas/awards.js.map +1 -1
- package/dist/schemas/dead-letters.d.ts +0 -3
- package/dist/schemas/dead-letters.d.ts.map +1 -1
- package/dist/schemas/dead-letters.js +0 -15
- package/dist/schemas/dead-letters.js.map +1 -1
- package/dist/schemas/game-locations.d.ts.map +1 -1
- package/dist/schemas/game-locations.js +0 -6
- package/dist/schemas/game-locations.js.map +1 -1
- package/dist/schemas/hardware-loan-contracts.d.ts.map +1 -1
- package/dist/schemas/hardware-loan-contracts.js +0 -13
- package/dist/schemas/hardware-loan-contracts.js.map +1 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +0 -2
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/leagues.d.ts.map +1 -1
- package/dist/schemas/leagues.js +0 -24
- package/dist/schemas/leagues.js.map +1 -1
- package/dist/schemas/migration-console.d.ts +58 -15
- package/dist/schemas/migration-console.d.ts.map +1 -1
- package/dist/schemas/migration-console.js +4 -34
- package/dist/schemas/migration-console.js.map +1 -1
- package/dist/schemas/pictures.d.ts.map +1 -1
- package/dist/schemas/pictures.js +0 -10
- package/dist/schemas/pictures.js.map +1 -1
- package/dist/schemas/schedules.d.ts.map +1 -1
- package/dist/schemas/schedules.js +0 -26
- package/dist/schemas/schedules.js.map +1 -1
- package/dist/schemas/scoring.d.ts +20 -26
- package/dist/schemas/scoring.d.ts.map +1 -1
- package/dist/schemas/scoring.js +0 -33
- package/dist/schemas/scoring.js.map +1 -1
- package/dist/schemas/signed-waivers.d.ts.map +1 -1
- package/dist/schemas/signed-waivers.js +0 -22
- package/dist/schemas/signed-waivers.js.map +1 -1
- package/dist/schemas/stats.d.ts +12 -0
- package/dist/schemas/stats.d.ts.map +1 -1
- package/dist/schemas/stats.js +21 -61
- package/dist/schemas/stats.js.map +1 -1
- package/dist/schemas/team-joining.d.ts.map +1 -1
- package/dist/schemas/team-joining.js +0 -30
- package/dist/schemas/team-joining.js.map +1 -1
- package/dist/schemas/teams.d.ts +0 -1
- package/dist/schemas/teams.d.ts.map +1 -1
- package/dist/schemas/teams.js +0 -83
- package/dist/schemas/teams.js.map +1 -1
- package/dist/schemas/uploads.d.ts +0 -8
- package/dist/schemas/uploads.d.ts.map +1 -1
- package/dist/schemas/uploads.js +0 -29
- package/dist/schemas/uploads.js.map +1 -1
- package/dist/schemas/users.d.ts +0 -1
- package/dist/schemas/users.d.ts.map +1 -1
- package/dist/schemas/users.js +0 -41
- package/dist/schemas/users.js.map +1 -1
- package/dist/schemas/waiver-templates.d.ts.map +1 -1
- package/dist/schemas/waiver-templates.js +0 -7
- package/dist/schemas/waiver-templates.js.map +1 -1
- package/dist/sports/basketball-scoring.d.ts +0 -4
- package/dist/sports/basketball-scoring.d.ts.map +1 -1
- package/dist/sports/basketball-scoring.js +0 -34
- package/dist/sports/basketball-scoring.js.map +1 -1
- package/dist/sports/basketball.d.ts.map +1 -1
- package/dist/sports/basketball.js +0 -5
- package/dist/sports/basketball.js.map +1 -1
- package/dist/sports/bulk-entry.d.ts +0 -22
- package/dist/sports/bulk-entry.d.ts.map +1 -1
- package/dist/sports/bulk-entry.js +0 -10
- package/dist/sports/bulk-entry.js.map +1 -1
- package/dist/sports/column-catalog.d.ts +0 -17
- package/dist/sports/column-catalog.d.ts.map +1 -1
- package/dist/sports/column-catalog.js +0 -10
- package/dist/sports/column-catalog.js.map +1 -1
- package/dist/sports/contribution.d.ts +2 -59
- package/dist/sports/contribution.d.ts.map +1 -1
- package/dist/sports/contribution.js +2 -45
- package/dist/sports/contribution.js.map +1 -1
- package/dist/sports/curling-scoring.d.ts +0 -1
- package/dist/sports/curling-scoring.d.ts.map +1 -1
- package/dist/sports/curling-scoring.js +0 -27
- package/dist/sports/curling-scoring.js.map +1 -1
- package/dist/sports/curling.d.ts.map +1 -1
- package/dist/sports/curling.js +0 -4
- package/dist/sports/curling.js.map +1 -1
- package/dist/sports/finalized-record.d.ts +2 -19
- package/dist/sports/finalized-record.d.ts.map +1 -1
- package/dist/sports/finalized-record.js +21 -22
- package/dist/sports/finalized-record.js.map +1 -1
- package/dist/sports/football-scoring.d.ts.map +1 -1
- package/dist/sports/football-scoring.js +0 -21
- package/dist/sports/football-scoring.js.map +1 -1
- package/dist/sports/football.d.ts.map +1 -1
- package/dist/sports/football.js +0 -4
- package/dist/sports/football.js.map +1 -1
- package/dist/sports/index.d.ts.map +1 -1
- package/dist/sports/index.js +0 -2
- package/dist/sports/index.js.map +1 -1
- package/dist/sports/ledger-continuity.d.ts +0 -2
- package/dist/sports/ledger-continuity.d.ts.map +1 -1
- package/dist/sports/ledger-continuity.js +0 -5
- package/dist/sports/ledger-continuity.js.map +1 -1
- package/dist/sports/lifetime-summary.d.ts +0 -6
- package/dist/sports/lifetime-summary.d.ts.map +1 -1
- package/dist/sports/lifetime-summary.js +0 -7
- package/dist/sports/lifetime-summary.js.map +1 -1
- package/dist/sports/rankings.d.ts +0 -12
- package/dist/sports/rankings.d.ts.map +1 -1
- package/dist/sports/rankings.js +0 -15
- package/dist/sports/rankings.js.map +1 -1
- package/dist/sports/registry.d.ts +0 -10
- package/dist/sports/registry.d.ts.map +1 -1
- package/dist/sports/registry.js +0 -9
- package/dist/sports/registry.js.map +1 -1
- package/dist/sports/replay.d.ts +0 -11
- package/dist/sports/replay.d.ts.map +1 -1
- package/dist/sports/replay.js +0 -16
- package/dist/sports/replay.js.map +1 -1
- package/dist/sports/rollup-check.d.ts +0 -7
- package/dist/sports/rollup-check.d.ts.map +1 -1
- package/dist/sports/rollup-check.js +0 -14
- package/dist/sports/rollup-check.js.map +1 -1
- package/dist/sports/score-mirror.d.ts +0 -1
- package/dist/sports/score-mirror.d.ts.map +1 -1
- package/dist/sports/score-mirror.js +0 -4
- package/dist/sports/score-mirror.js.map +1 -1
- package/dist/sports/scoring-display.d.ts +0 -30
- package/dist/sports/scoring-display.d.ts.map +1 -1
- package/dist/sports/scoring-display.js +0 -9
- package/dist/sports/scoring-display.js.map +1 -1
- package/dist/sports/scoring.d.ts +0 -36
- package/dist/sports/scoring.d.ts.map +1 -1
- package/dist/sports/scoring.js +0 -10
- package/dist/sports/scoring.js.map +1 -1
- package/dist/sports/shared-columns.d.ts +0 -1
- package/dist/sports/shared-columns.d.ts.map +1 -1
- package/dist/sports/shared-columns.js +0 -7
- package/dist/sports/shared-columns.js.map +1 -1
- package/dist/sports/sport-adapter.d.ts +0 -32
- package/dist/sports/sport-adapter.d.ts.map +1 -1
- package/dist/sports/sport-adapter.js +0 -7
- package/dist/sports/sport-adapter.js.map +1 -1
- package/dist/sports/store-driver.d.ts +0 -28
- package/dist/sports/store-driver.d.ts.map +1 -1
- package/dist/sports/store-driver.js +0 -38
- package/dist/sports/store-driver.js.map +1 -1
- package/dist/types/audit.d.ts +1 -1
- package/dist/types/audit.d.ts.map +1 -1
- package/dist/types/audit.js +1 -67
- package/dist/types/audit.js.map +1 -1
- package/dist/types/claims.d.ts +0 -10
- package/dist/types/claims.d.ts.map +1 -1
- package/dist/types/claims.js +0 -16
- package/dist/types/claims.js.map +1 -1
- package/dist/types/notifications.d.ts.map +1 -1
- package/dist/types/notifications.js +7 -25
- package/dist/types/notifications.js.map +1 -1
- package/dist/types/picture-owners.d.ts +0 -1
- package/dist/types/picture-owners.d.ts.map +1 -1
- package/dist/types/picture-owners.js +0 -6
- package/dist/types/picture-owners.js.map +1 -1
- package/dist/types/schedules.d.ts.map +1 -1
- package/dist/types/schedules.js +0 -9
- package/dist/types/schedules.js.map +1 -1
- package/dist/types/sports.d.ts.map +1 -1
- package/dist/types/sports.js +0 -24
- package/dist/types/sports.js.map +1 -1
- package/dist/types/stats.d.ts.map +1 -1
- package/dist/types/stats.js +0 -65
- package/dist/types/stats.js.map +1 -1
- package/dist/types/unions.d.ts +0 -2
- package/dist/types/unions.d.ts.map +1 -1
- package/dist/types/unions.js +3 -91
- package/dist/types/unions.js.map +1 -1
- package/dist/types/uploads.d.ts.map +1 -1
- package/dist/types/uploads.js +0 -7
- package/dist/types/uploads.js.map +1 -1
- package/dist/upload-variables/on-progress.d.ts.map +1 -1
- package/dist/upload-variables/on-progress.js +2 -5
- package/dist/upload-variables/on-progress.js.map +1 -1
- package/dist/upload-variables/picture-upload-variables.d.ts +0 -1
- package/dist/upload-variables/picture-upload-variables.d.ts.map +1 -1
- package/dist/upload-variables/picture-upload-variables.js +0 -4
- package/dist/upload-variables/picture-upload-variables.js.map +1 -1
- package/dist/upload-variables/sign-hardware-contract-variables.d.ts.map +1 -1
- package/dist/upload-variables/sign-hardware-contract-variables.js +0 -2
- package/dist/upload-variables/sign-hardware-contract-variables.js.map +1 -1
- package/dist/upload-variables/sign-waiver-variables.d.ts.map +1 -1
- package/dist/upload-variables/sign-waiver-variables.js +0 -4
- package/dist/upload-variables/sign-waiver-variables.js.map +1 -1
- package/dist/utils/account-status.d.ts.map +1 -1
- package/dist/utils/account-status.js +0 -4
- package/dist/utils/account-status.js.map +1 -1
- package/dist/utils/app-config.d.ts +0 -53
- package/dist/utils/app-config.d.ts.map +1 -1
- package/dist/utils/app-config.js +0 -62
- package/dist/utils/app-config.js.map +1 -1
- package/dist/utils/display-name.d.ts +0 -7
- package/dist/utils/display-name.d.ts.map +1 -1
- package/dist/utils/display-name.js +0 -8
- package/dist/utils/display-name.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/league-calendar.d.ts +0 -11
- package/dist/utils/league-calendar.d.ts.map +1 -1
- package/dist/utils/league-calendar.js +7 -19
- package/dist/utils/league-calendar.js.map +1 -1
- package/dist/utils/league-join-warning.d.ts +0 -11
- package/dist/utils/league-join-warning.d.ts.map +1 -1
- package/dist/utils/league-join-warning.js +0 -28
- package/dist/utils/league-join-warning.js.map +1 -1
- package/dist/utils/league-joining.d.ts +0 -1
- package/dist/utils/league-joining.d.ts.map +1 -1
- package/dist/utils/league-joining.js +0 -7
- package/dist/utils/league-joining.js.map +1 -1
- package/dist/utils/league-mode.d.ts +0 -1
- package/dist/utils/league-mode.d.ts.map +1 -1
- package/dist/utils/league-mode.js +0 -4
- package/dist/utils/league-mode.js.map +1 -1
- package/dist/utils/schedules.d.ts +0 -15
- package/dist/utils/schedules.d.ts.map +1 -1
- package/dist/utils/schedules.js +0 -19
- package/dist/utils/schedules.js.map +1 -1
- package/dist/utils/stats-operation-request.d.ts +20 -0
- package/dist/utils/stats-operation-request.d.ts.map +1 -0
- package/dist/utils/stats-operation-request.js +10 -0
- package/dist/utils/stats-operation-request.js.map +1 -0
- package/dist/utils/team-creation.d.ts +0 -2
- package/dist/utils/team-creation.d.ts.map +1 -1
- package/dist/utils/team-creation.js +0 -6
- package/dist/utils/team-creation.js.map +1 -1
- package/dist/utils/team-member-actions.d.ts +0 -6
- package/dist/utils/team-member-actions.d.ts.map +1 -1
- package/dist/utils/team-member-actions.js +0 -12
- package/dist/utils/team-member-actions.js.map +1 -1
- package/package.json +2 -1
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
// `statsOperations/{operationId}` — one logical run of a stats action: a rebuild, a validation, a
|
|
2
|
-
// game's correction or recalculation, a historical-baseline update, a ghost's stats half, or a game
|
|
3
|
-
// deletion. The stats cores write it in the same commit as each page it records, so an interrupted
|
|
4
|
-
// run resumes the same operation instead of starting a second one, and a retried single-game action
|
|
5
|
-
// finds its operation `complete` and is acknowledged.
|
|
6
|
-
//
|
|
7
|
-
// It is also the hold on a game: while a multi-page operation works a game, the game's
|
|
8
|
-
// `statsOperationId` names this document, and every other writer of that game refuses it.
|
|
9
|
-
//
|
|
10
|
-
// The id is minted by the client when the admin starts the action, except two the server derives: a
|
|
11
|
-
// ghost's, from the team and the ghost, so a ghost has one operation for its links and its removal;
|
|
12
|
-
// and a game deletion's, from the game (`buildGameDeletionOperationId`).
|
|
13
|
-
// Admin read; written only by the stats cores.
|
|
14
1
|
import { z } from 'zod';
|
|
15
2
|
import { GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS, STATS_OPERATION_STATUS_KEYS, STATS_VALIDATION_PHASE_KEYS, } from '../types/stats.js';
|
|
16
3
|
import { countSchema, epochMsSchema, gameIdSchema, leagueIdSchema, repairReasonSchema, sportKeySchema, teamIdSchema, userIdSchema, } from './atoms.js';
|
|
@@ -25,41 +12,36 @@ const operationBase = {
|
|
|
25
12
|
startedAt: epochMsSchema,
|
|
26
13
|
updatedAt: epochMsSchema,
|
|
27
14
|
status: z.enum(STATS_OPERATION_STATUS_KEYS),
|
|
28
|
-
// The last document id a paged run finished; absent before its first page.
|
|
29
15
|
resumeAfter: z.string().min(1).optional(),
|
|
30
16
|
counts: StatsOperationCountsSchema,
|
|
31
17
|
};
|
|
32
|
-
// A rebuild replaces a destination whole and never rebuilds from a game whose record disagrees with
|
|
33
|
-
// its rollup; it names each such game and rebuilds everything that game does not feed.
|
|
34
18
|
const rebuildFields = {
|
|
35
19
|
...operationBase,
|
|
36
20
|
reason: repairReasonSchema,
|
|
37
21
|
stoppedOnGameIds: z.array(gameIdSchema),
|
|
38
22
|
};
|
|
39
23
|
const gameScope = z.strictObject({ gameId: gameIdSchema });
|
|
24
|
+
// `hashStatsOperationRequest` of the values the operation was opened with. Optional: an operation
|
|
25
|
+
// stored before it existed still resumes.
|
|
26
|
+
const requestHashSchema = z.string().regex(/^[0-9a-f]{64}$/);
|
|
40
27
|
export const LeagueStatsRebuildOperationSchema = z.strictObject({
|
|
41
28
|
...rebuildFields,
|
|
42
29
|
kind: z.literal('leagueStatsRebuild'),
|
|
43
|
-
// Absent: every league.
|
|
44
30
|
scope: z.strictObject({ leagueId: leagueIdSchema.optional() }),
|
|
45
31
|
});
|
|
46
32
|
export const LifetimeStatsRebuildOperationSchema = z.strictObject({
|
|
47
33
|
...rebuildFields,
|
|
48
34
|
kind: z.literal('lifetimeStatsRebuild'),
|
|
49
|
-
// Absent: every user.
|
|
50
35
|
scope: z.strictObject({ userId: userIdSchema.optional() }),
|
|
51
36
|
});
|
|
52
37
|
export const HallOfFameRebuildOperationSchema = z.strictObject({
|
|
53
38
|
...rebuildFields,
|
|
54
39
|
kind: z.literal('hallOfFameRebuild'),
|
|
55
|
-
// Absent user: the whole sport.
|
|
56
40
|
scope: z.strictObject({ sportKey: sportKeySchema, userId: userIdSchema.optional() }),
|
|
57
41
|
});
|
|
58
|
-
// A validation writes no stat, so it takes no reason.
|
|
59
42
|
export const StatsValidationOperationSchema = z.strictObject({
|
|
60
43
|
...operationBase,
|
|
61
44
|
kind: z.literal('statsValidation'),
|
|
62
|
-
// One game, one league, or — with neither — everything.
|
|
63
45
|
scope: StatsValidationScopeSchema,
|
|
64
46
|
phase: z.enum(STATS_VALIDATION_PHASE_KEYS),
|
|
65
47
|
});
|
|
@@ -68,6 +50,7 @@ export const GameStatsCorrectionOperationSchema = z.strictObject({
|
|
|
68
50
|
kind: z.literal('gameStatsCorrection'),
|
|
69
51
|
scope: gameScope,
|
|
70
52
|
reason: repairReasonSchema,
|
|
53
|
+
requestHash: requestHashSchema.optional(),
|
|
71
54
|
});
|
|
72
55
|
export const GameStatsRecalculationOperationSchema = z.strictObject({
|
|
73
56
|
...operationBase,
|
|
@@ -80,37 +63,24 @@ export const HistoricalStatsUpdateOperationSchema = z.strictObject({
|
|
|
80
63
|
kind: z.literal('historicalStatsUpdate'),
|
|
81
64
|
scope: z.strictObject({ userId: userIdSchema, sportKey: sportKeySchema }),
|
|
82
65
|
reason: repairReasonSchema,
|
|
66
|
+
requestHash: requestHashSchema.optional(),
|
|
83
67
|
});
|
|
84
|
-
// One completed game a never-played ghost's removal took the ghost's entry off, with what the stored
|
|
85
|
-
// participation decision said of the entry before: absent, and credited no game played. The per-game
|
|
86
|
-
// transaction that removes the entry records it, so the removal's audit event names every one.
|
|
87
68
|
export const GhostRemovedFinishedEntrySchema = z.strictObject({
|
|
88
69
|
gameId: gameIdSchema,
|
|
89
70
|
wasAbsent: z.boolean(),
|
|
90
71
|
wasNonScoring: z.boolean(),
|
|
91
72
|
});
|
|
92
|
-
// One game a ghost link moved the ghost's entry on, whether the game was completed when it did, and
|
|
93
|
-
// whether the account already held an entry there that the ghost's merged into. The per-game
|
|
94
|
-
// transaction records it, so the link's audit event names every one.
|
|
95
73
|
export const GhostLinkedGameSchema = z.strictObject({
|
|
96
74
|
gameId: gameIdSchema,
|
|
97
75
|
completed: z.boolean(),
|
|
98
76
|
merged: z.boolean(),
|
|
99
77
|
});
|
|
100
|
-
// One derived line a stats action moved — a team's standings line, a per-membership row, a lifetime
|
|
101
|
-
// line, or a hall-of-fame entry — with its value before the action's first change to it and after
|
|
102
|
-
// its latest, `null` where there was or is no line. Every repair's audit event records them, and a
|
|
103
|
-
// dry run lists them without writing (RULE-STD-BACKEND-212).
|
|
104
78
|
export const StatsDestinationChangeSchema = z.strictObject({
|
|
105
79
|
ref: z.string().min(1),
|
|
106
80
|
field: z.string().min(1),
|
|
107
81
|
before: z.record(z.string(), z.number()).nullable(),
|
|
108
82
|
after: z.record(z.string(), z.number()).nullable(),
|
|
109
83
|
});
|
|
110
|
-
// The ghost's one operation records the account a link chose, or the removal, so a call naming a
|
|
111
|
-
// different account — or a removal against a link — is refused, and the same call resumes. Neither
|
|
112
|
-
// takes a reason: a link is chosen and confirmed, and its audit event records who linked which ghost
|
|
113
|
-
// to whom and what moved (RULE-STD-BACKEND-212).
|
|
114
84
|
export const GhostPlayerStatsOperationSchema = z
|
|
115
85
|
.strictObject({
|
|
116
86
|
...operationBase,
|
|
@@ -128,17 +98,12 @@ export const GhostPlayerStatsOperationSchema = z
|
|
|
128
98
|
ghostUserId: userIdSchema,
|
|
129
99
|
}),
|
|
130
100
|
]),
|
|
131
|
-
//
|
|
132
|
-
//
|
|
133
|
-
// still resumes.
|
|
101
|
+
// Present only on an operation stored with a reason. A removal's is dropped on read; a link's
|
|
102
|
+
// is kept, so its stored operation still resumes.
|
|
134
103
|
reason: repairReasonSchema.optional(),
|
|
135
|
-
// A removal's finished-game entries, in the order it removed them; absent on a link.
|
|
136
104
|
removedFinishedGameEntries: z.array(GhostRemovedFinishedEntrySchema).optional(),
|
|
137
|
-
// A link's games moved so far, in the order it moved them, and every derived line it changed;
|
|
138
|
-
// absent on a removal.
|
|
139
105
|
linkedGames: z.array(GhostLinkedGameSchema).optional(),
|
|
140
106
|
destinationChanges: z.array(StatsDestinationChangeSchema).optional(),
|
|
141
|
-
// What a completed link did with the team's memberships, so a call after completion answers it.
|
|
142
107
|
membershipOutcome: z.enum(GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS).optional(),
|
|
143
108
|
})
|
|
144
109
|
.overwrite((operation) => {
|
|
@@ -147,8 +112,6 @@ export const GhostPlayerStatsOperationSchema = z
|
|
|
147
112
|
const { reason: _reason, ...withoutReason } = operation;
|
|
148
113
|
return withoutReason;
|
|
149
114
|
});
|
|
150
|
-
// A game deletion pages out the game's events and roster under the hold and removes the game
|
|
151
|
-
// document last; running it again on a held game continues it.
|
|
152
115
|
export const GameDeletionOperationSchema = z.strictObject({
|
|
153
116
|
...operationBase,
|
|
154
117
|
kind: z.literal('gameDeletion'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats-operation.js","sourceRoot":"","sources":["../../src/doc-schemas/stats-operation.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,oGAAoG;AACpG,mGAAmG;AACnG,oGAAoG;AACpG,sDAAsD;AACtD,EAAE;AACF,uFAAuF;AACvF,0FAA0F;AAC1F,EAAE;AACF,oGAAoG;AACpG,oGAAoG;AACpG,yEAAyE;AACzE,+CAA+C;AAE/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,kCAAkC,EAClC,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,YAAY,CAAC;IACvD,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,WAAW;CACrB,CAAC,CAAC;AAGH,MAAM,aAAa,GAAG;IACpB,eAAe,EAAE,YAAY;IAC7B,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;IACxB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC;IAC3C,2EAA2E;IAC3E,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACzC,MAAM,EAAE,0BAA0B;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ACjB,MAAM,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IACrC,qFAAqF;IACrF,0BAA0B,EAAE,CAAC,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC,QAAQ,EAAE;IAC/E,8FAA8F;IAC9F,uBAAuB;IACvB,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,QAAQ,EAAE;IACtD,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,QAAQ,EAAE;IACpE,gGAAgG;IAChG,iBAAiB,EAAE,CAAC,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC,QAAQ,EAAE;CACzE,CAAC;KACD,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE;IACvB,IAAI,SAAS,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC7F,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,aAAa,EAAE,GAAG,SAAS,CAAC;IACxD,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC,CAAC;AAGL,6FAA6F;AAC7F,+DAA+D;AAC/D,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,YAAY,CAAC;IACxD,GAAG,aAAa;IAChB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,cAA2C,CAAC;IAC5D,KAAK,EAAE,SAAS;CACjB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC/D,iCAAiC;IACjC,mCAAmC;IACnC,gCAAgC;IAChC,8BAA8B;IAC9B,kCAAkC;IAClC,qCAAqC;IACrC,oCAAoC;IACpC,+BAA+B;IAC/B,2BAA2B;CAC5B,CAAC,CAAC","sourcesContent":["// `statsOperations/{operationId}` — one logical run of a stats action: a rebuild, a validation, a\n// game's correction or recalculation, a historical-baseline update, a ghost's stats half, or a game\n// deletion. The stats cores write it in the same commit as each page it records, so an interrupted\n// run resumes the same operation instead of starting a second one, and a retried single-game action\n// finds its operation `complete` and is acknowledged.\n//\n// It is also the hold on a game: while a multi-page operation works a game, the game's\n// `statsOperationId` names this document, and every other writer of that game refuses it.\n//\n// The id is minted by the client when the admin starts the action, except two the server derives: a\n// ghost's, from the team and the ghost, so a ghost has one operation for its links and its removal;\n// and a game deletion's, from the game (`buildGameDeletionOperationId`).\n// Admin read; written only by the stats cores.\n\nimport { z } from 'zod';\nimport {\n GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS,\n STATS_OPERATION_STATUS_KEYS,\n STATS_VALIDATION_PHASE_KEYS,\n} from '../types/stats.js';\nimport type { GhostStatsOperationAction, StatsOperationKind } from '../types/stats.js';\nimport {\n countSchema,\n epochMsSchema,\n gameIdSchema,\n leagueIdSchema,\n repairReasonSchema,\n sportKeySchema,\n teamIdSchema,\n userIdSchema,\n} from './atoms.js';\nimport { StatsValidationScopeSchema } from './system.js';\n\nexport const StatsOperationCountsSchema = z.strictObject({\n read: countSchema,\n changed: countSchema,\n skipped: countSchema,\n});\nexport type StatsOperationCounts = z.infer<typeof StatsOperationCountsSchema>;\n\nconst operationBase = {\n startedByUserId: userIdSchema,\n startedAt: epochMsSchema,\n updatedAt: epochMsSchema,\n status: z.enum(STATS_OPERATION_STATUS_KEYS),\n // The last document id a paged run finished; absent before its first page.\n resumeAfter: z.string().min(1).optional(),\n counts: StatsOperationCountsSchema,\n};\n\n// A rebuild replaces a destination whole and never rebuilds from a game whose record disagrees with\n// its rollup; it names each such game and rebuilds everything that game does not feed.\nconst rebuildFields = {\n ...operationBase,\n reason: repairReasonSchema,\n stoppedOnGameIds: z.array(gameIdSchema),\n};\n\nconst gameScope = z.strictObject({ gameId: gameIdSchema });\n\nexport const LeagueStatsRebuildOperationSchema = z.strictObject({\n ...rebuildFields,\n kind: z.literal('leagueStatsRebuild' satisfies StatsOperationKind),\n // Absent: every league.\n scope: z.strictObject({ leagueId: leagueIdSchema.optional() }),\n});\n\nexport const LifetimeStatsRebuildOperationSchema = z.strictObject({\n ...rebuildFields,\n kind: z.literal('lifetimeStatsRebuild' satisfies StatsOperationKind),\n // Absent: every user.\n scope: z.strictObject({ userId: userIdSchema.optional() }),\n});\n\nexport const HallOfFameRebuildOperationSchema = z.strictObject({\n ...rebuildFields,\n kind: z.literal('hallOfFameRebuild' satisfies StatsOperationKind),\n // Absent user: the whole sport.\n scope: z.strictObject({ sportKey: sportKeySchema, userId: userIdSchema.optional() }),\n});\n\n// A validation writes no stat, so it takes no reason.\nexport const StatsValidationOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('statsValidation' satisfies StatsOperationKind),\n // One game, one league, or — with neither — everything.\n scope: StatsValidationScopeSchema,\n phase: z.enum(STATS_VALIDATION_PHASE_KEYS),\n});\n\nexport const GameStatsCorrectionOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('gameStatsCorrection' satisfies StatsOperationKind),\n scope: gameScope,\n reason: repairReasonSchema,\n});\n\nexport const GameStatsRecalculationOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('gameStatsRecalculation' satisfies StatsOperationKind),\n scope: gameScope,\n reason: repairReasonSchema,\n});\n\nexport const HistoricalStatsUpdateOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('historicalStatsUpdate' satisfies StatsOperationKind),\n scope: z.strictObject({ userId: userIdSchema, sportKey: sportKeySchema }),\n reason: repairReasonSchema,\n});\n\n// One completed game a never-played ghost's removal took the ghost's entry off, with what the stored\n// participation decision said of the entry before: absent, and credited no game played. The per-game\n// transaction that removes the entry records it, so the removal's audit event names every one.\nexport const GhostRemovedFinishedEntrySchema = z.strictObject({\n gameId: gameIdSchema,\n wasAbsent: z.boolean(),\n wasNonScoring: z.boolean(),\n});\nexport type GhostRemovedFinishedEntry = z.infer<typeof GhostRemovedFinishedEntrySchema>;\n\n// One game a ghost link moved the ghost's entry on, whether the game was completed when it did, and\n// whether the account already held an entry there that the ghost's merged into. The per-game\n// transaction records it, so the link's audit event names every one.\nexport const GhostLinkedGameSchema = z.strictObject({\n gameId: gameIdSchema,\n completed: z.boolean(),\n merged: z.boolean(),\n});\nexport type GhostLinkedGame = z.infer<typeof GhostLinkedGameSchema>;\n\n// One derived line a stats action moved — a team's standings line, a per-membership row, a lifetime\n// line, or a hall-of-fame entry — with its value before the action's first change to it and after\n// its latest, `null` where there was or is no line. Every repair's audit event records them, and a\n// dry run lists them without writing (RULE-STD-BACKEND-212).\nexport const StatsDestinationChangeSchema = z.strictObject({\n ref: z.string().min(1),\n field: z.string().min(1),\n before: z.record(z.string(), z.number()).nullable(),\n after: z.record(z.string(), z.number()).nullable(),\n});\nexport type StatsDestinationChange = z.infer<typeof StatsDestinationChangeSchema>;\n\n// The ghost's one operation records the account a link chose, or the removal, so a call naming a\n// different account — or a removal against a link — is refused, and the same call resumes. Neither\n// takes a reason: a link is chosen and confirmed, and its audit event records who linked which ghost\n// to whom and what moved (RULE-STD-BACKEND-212).\nexport const GhostPlayerStatsOperationSchema = z\n .strictObject({\n ...operationBase,\n kind: z.literal('ghostPlayerStats' satisfies StatsOperationKind),\n scope: z.discriminatedUnion('action', [\n z.strictObject({\n action: z.literal('link' satisfies GhostStatsOperationAction),\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n userId: userIdSchema,\n }),\n z.strictObject({\n action: z.literal('removal' satisfies GhostStatsOperationAction),\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n }),\n ]),\n // A reason stored by a link or a removal recorded while they still took one; no operation\n // writes one now. A removal's is dropped on read; a link's is kept, so its stored operation\n // still resumes.\n reason: repairReasonSchema.optional(),\n // A removal's finished-game entries, in the order it removed them; absent on a link.\n removedFinishedGameEntries: z.array(GhostRemovedFinishedEntrySchema).optional(),\n // A link's games moved so far, in the order it moved them, and every derived line it changed;\n // absent on a removal.\n linkedGames: z.array(GhostLinkedGameSchema).optional(),\n destinationChanges: z.array(StatsDestinationChangeSchema).optional(),\n // What a completed link did with the team's memberships, so a call after completion answers it.\n membershipOutcome: z.enum(GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS).optional(),\n })\n .overwrite((operation) => {\n if (operation.scope.action !== 'removal' || operation.reason === undefined) return operation;\n const { reason: _reason, ...withoutReason } = operation;\n return withoutReason;\n });\nexport type GhostPlayerStatsOperation = z.infer<typeof GhostPlayerStatsOperationSchema>;\n\n// A game deletion pages out the game's events and roster under the hold and removes the game\n// document last; running it again on a held game continues it.\nexport const GameDeletionOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('gameDeletion' satisfies StatsOperationKind),\n scope: gameScope,\n});\n\nexport const StatsOperationSchema = z.discriminatedUnion('kind', [\n LeagueStatsRebuildOperationSchema,\n LifetimeStatsRebuildOperationSchema,\n HallOfFameRebuildOperationSchema,\n StatsValidationOperationSchema,\n GameStatsCorrectionOperationSchema,\n GameStatsRecalculationOperationSchema,\n HistoricalStatsUpdateOperationSchema,\n GhostPlayerStatsOperationSchema,\n GameDeletionOperationSchema,\n]);\nexport type StatsOperation = z.infer<typeof StatsOperationSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"stats-operation.js","sourceRoot":"","sources":["../../src/doc-schemas/stats-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,kCAAkC,EAClC,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,YAAY,CAAC;IACvD,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,WAAW;C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AC,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS,\n STATS_OPERATION_STATUS_KEYS,\n STATS_VALIDATION_PHASE_KEYS,\n} from '../types/stats.js';\nimport type { GhostStatsOperationAction, StatsOperationKind } from '../types/stats.js';\nimport {\n countSchema,\n epochMsSchema,\n gameIdSchema,\n leagueIdSchema,\n repairReasonSchema,\n sportKeySchema,\n teamIdSchema,\n userIdSchema,\n} from './atoms.js';\nimport { StatsValidationScopeSchema } from './system.js';\n\nexport const StatsOperationCountsSchema = z.strictObject({\n read: countSchema,\n changed: countSchema,\n skipped: countSchema,\n});\nexport type StatsOperationCounts = z.infer<typeof StatsOperationCountsSchema>;\n\nconst operationBase = {\n startedByUserId: userIdSchema,\n startedAt: epochMsSchema,\n updatedAt: epochMsSchema,\n status: z.enum(STATS_OPERATION_STATUS_KEYS),\n resumeAfter: z.string().min(1).optional(),\n counts: StatsOperationCountsSchema,\n};\n\nconst rebuildFields = {\n ...operationBase,\n reason: repairReasonSchema,\n stoppedOnGameIds: z.array(gameIdSchema),\n};\n\nconst gameScope = z.strictObject({ gameId: gameIdSchema });\n\n// `hashStatsOperationRequest` of the values the operation was opened with. Optional: an operation\n// stored before it existed still resumes.\nconst requestHashSchema = z.string().regex(/^[0-9a-f]{64}$/);\n\nexport const LeagueStatsRebuildOperationSchema = z.strictObject({\n ...rebuildFields,\n kind: z.literal('leagueStatsRebuild' satisfies StatsOperationKind),\n scope: z.strictObject({ leagueId: leagueIdSchema.optional() }),\n});\n\nexport const LifetimeStatsRebuildOperationSchema = z.strictObject({\n ...rebuildFields,\n kind: z.literal('lifetimeStatsRebuild' satisfies StatsOperationKind),\n scope: z.strictObject({ userId: userIdSchema.optional() }),\n});\n\nexport const HallOfFameRebuildOperationSchema = z.strictObject({\n ...rebuildFields,\n kind: z.literal('hallOfFameRebuild' satisfies StatsOperationKind),\n scope: z.strictObject({ sportKey: sportKeySchema, userId: userIdSchema.optional() }),\n});\n\nexport const StatsValidationOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('statsValidation' satisfies StatsOperationKind),\n scope: StatsValidationScopeSchema,\n phase: z.enum(STATS_VALIDATION_PHASE_KEYS),\n});\n\nexport const GameStatsCorrectionOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('gameStatsCorrection' satisfies StatsOperationKind),\n scope: gameScope,\n reason: repairReasonSchema,\n requestHash: requestHashSchema.optional(),\n});\n\nexport const GameStatsRecalculationOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('gameStatsRecalculation' satisfies StatsOperationKind),\n scope: gameScope,\n reason: repairReasonSchema,\n});\n\nexport const HistoricalStatsUpdateOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('historicalStatsUpdate' satisfies StatsOperationKind),\n scope: z.strictObject({ userId: userIdSchema, sportKey: sportKeySchema }),\n reason: repairReasonSchema,\n requestHash: requestHashSchema.optional(),\n});\n\nexport const GhostRemovedFinishedEntrySchema = z.strictObject({\n gameId: gameIdSchema,\n wasAbsent: z.boolean(),\n wasNonScoring: z.boolean(),\n});\nexport type GhostRemovedFinishedEntry = z.infer<typeof GhostRemovedFinishedEntrySchema>;\n\nexport const GhostLinkedGameSchema = z.strictObject({\n gameId: gameIdSchema,\n completed: z.boolean(),\n merged: z.boolean(),\n});\nexport type GhostLinkedGame = z.infer<typeof GhostLinkedGameSchema>;\n\nexport const StatsDestinationChangeSchema = z.strictObject({\n ref: z.string().min(1),\n field: z.string().min(1),\n before: z.record(z.string(), z.number()).nullable(),\n after: z.record(z.string(), z.number()).nullable(),\n});\nexport type StatsDestinationChange = z.infer<typeof StatsDestinationChangeSchema>;\n\nexport const GhostPlayerStatsOperationSchema = z\n .strictObject({\n ...operationBase,\n kind: z.literal('ghostPlayerStats' satisfies StatsOperationKind),\n scope: z.discriminatedUnion('action', [\n z.strictObject({\n action: z.literal('link' satisfies GhostStatsOperationAction),\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n userId: userIdSchema,\n }),\n z.strictObject({\n action: z.literal('removal' satisfies GhostStatsOperationAction),\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n }),\n ]),\n // Present only on an operation stored with a reason. A removal's is dropped on read; a link's\n // is kept, so its stored operation still resumes.\n reason: repairReasonSchema.optional(),\n removedFinishedGameEntries: z.array(GhostRemovedFinishedEntrySchema).optional(),\n linkedGames: z.array(GhostLinkedGameSchema).optional(),\n destinationChanges: z.array(StatsDestinationChangeSchema).optional(),\n membershipOutcome: z.enum(GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS).optional(),\n })\n .overwrite((operation) => {\n if (operation.scope.action !== 'removal' || operation.reason === undefined) return operation;\n const { reason: _reason, ...withoutReason } = operation;\n return withoutReason;\n });\nexport type GhostPlayerStatsOperation = z.infer<typeof GhostPlayerStatsOperationSchema>;\n\nexport const GameDeletionOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('gameDeletion' satisfies StatsOperationKind),\n scope: gameScope,\n});\n\nexport const StatsOperationSchema = z.discriminatedUnion('kind', [\n LeagueStatsRebuildOperationSchema,\n LifetimeStatsRebuildOperationSchema,\n HallOfFameRebuildOperationSchema,\n StatsValidationOperationSchema,\n GameStatsCorrectionOperationSchema,\n GameStatsRecalculationOperationSchema,\n HistoricalStatsUpdateOperationSchema,\n GhostPlayerStatsOperationSchema,\n GameDeletionOperationSchema,\n]);\nexport type StatsOperation = z.infer<typeof StatsOperationSchema>;\n"]}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* A status change's Auth effect, owed until it lands. `writeId` names the status change that wrote
|
|
4
|
-
* it: a removal compares it, so finishing an older change never removes the entry a newer change
|
|
5
|
-
* wrote. The drain converges the account on its canonical status, never on `targetStatus`.
|
|
6
|
-
*/
|
|
7
2
|
export declare const StatusReconcileQueueAccountStatusEntrySchema: z.ZodObject<{
|
|
8
3
|
authEffect: z.ZodLiteral<"accountStatus">;
|
|
9
4
|
reason: z.ZodLiteral<"statusChangePending">;
|
|
@@ -17,7 +12,6 @@ export declare const StatusReconcileQueueAccountStatusEntrySchema: z.ZodObject<{
|
|
|
17
12
|
attemptCount: z.ZodNumber;
|
|
18
13
|
}, z.core.$strict>;
|
|
19
14
|
export type StatusReconcileQueueAccountStatusEntry = z.infer<typeof StatusReconcileQueueAccountStatusEntrySchema>;
|
|
20
|
-
/** A failed `admin` / `referee` claim write. It carries no status. */
|
|
21
15
|
export declare const StatusReconcileQueueRoleClaimsEntrySchema: z.ZodObject<{
|
|
22
16
|
authEffect: z.ZodLiteral<"roleClaims">;
|
|
23
17
|
reason: z.ZodLiteral<"postCommitAuthEffectFailed">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-reconcile-queue.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/status-reconcile-queue.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status-reconcile-queue.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/status-reconcile-queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,4CAA4C;;;;;;;;;;;kBAMvD,CAAC;AACH,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAC1D,OAAO,4CAA4C,CACpD,CAAC;AAEF,eAAO,MAAM,yCAAyC;;;;;;kBAIpD,CAAC;AACH,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,yCAAyC,CACjD,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;kCAG1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
// `statusReconcileQueue/{userId}` — the backend-only retry queue for an account's post-commit
|
|
2
|
-
// Firebase Auth effects (RULE-STD-QUALITY-104, RULE-STD-BACKEND-302). One entry per account, id = the userId, whichever
|
|
3
|
-
// effect queued it. A status change writes its entry in the status transaction itself; a role-claim
|
|
4
|
-
// entry is written when a roster change committed but its claim write failed. The drain re-converges
|
|
5
|
-
// every Auth-side mirror of the account from its canonical documents and deletes the entry once it
|
|
6
|
-
// has, so the entry names why the account was queued, never what to apply. Only the retry ledger
|
|
7
|
-
// (`attemptCount`, `lastAttemptAt`) is written back.
|
|
8
1
|
import { z } from 'zod';
|
|
9
2
|
import { ACCOUNT_STATUS_AUTH_EFFECT, ROLE_CLAIMS_EFFECT } from '../types/unions.js';
|
|
10
3
|
import { countSchema, documentIdSegmentSchema, epochMsSchema, userStatusSchema } from './atoms.js';
|
|
@@ -13,11 +6,6 @@ const statusReconcileQueueEntryBase = {
|
|
|
13
6
|
lastAttemptAt: epochMsSchema.optional(),
|
|
14
7
|
attemptCount: countSchema,
|
|
15
8
|
};
|
|
16
|
-
/**
|
|
17
|
-
* A status change's Auth effect, owed until it lands. `writeId` names the status change that wrote
|
|
18
|
-
* it: a removal compares it, so finishing an older change never removes the entry a newer change
|
|
19
|
-
* wrote. The drain converges the account on its canonical status, never on `targetStatus`.
|
|
20
|
-
*/
|
|
21
9
|
export const StatusReconcileQueueAccountStatusEntrySchema = z.strictObject({
|
|
22
10
|
...statusReconcileQueueEntryBase,
|
|
23
11
|
authEffect: z.literal(ACCOUNT_STATUS_AUTH_EFFECT),
|
|
@@ -25,7 +13,6 @@ export const StatusReconcileQueueAccountStatusEntrySchema = z.strictObject({
|
|
|
25
13
|
targetStatus: userStatusSchema,
|
|
26
14
|
writeId: documentIdSegmentSchema,
|
|
27
15
|
});
|
|
28
|
-
/** A failed `admin` / `referee` claim write. It carries no status. */
|
|
29
16
|
export const StatusReconcileQueueRoleClaimsEntrySchema = z.strictObject({
|
|
30
17
|
...statusReconcileQueueEntryBase,
|
|
31
18
|
authEffect: z.literal(ROLE_CLAIMS_EFFECT),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-reconcile-queue.js","sourceRoot":"","sources":["../../src/doc-schemas/status-reconcile-queue.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"status-reconcile-queue.js","sourceRoot":"","sources":["../../src/doc-schemas/status-reconcile-queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnG,MAAM,6BAA6B,GAAG;IACpC,UAAU,EAAE,aAAa;IACzB,aAAa,EAAE,aAAa,CAAC,QAAQ,EAAE;IACvC,YAAY,EAAE,WAAW;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,4CAA4C,GAAG,CAAC,CAAC,YAAY,CAAC;IACzE,GAAG,6BAA6B;IAChC,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC;IACjD,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC;IACxC,YAAY,EAAE,gBAAgB;IAC9B,OAAO,EAAE,uBAAuB;CACjC,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,YAAY,CAAC;IACtE,GAAG,6BAA6B;IAChC,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;IACzC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,4BAA4B,CAAC;CAChD,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,kBAAkB,CAAC,YAAY,EAAE;IAChF,4CAA4C;IAC5C,yCAAyC;CAC1C,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { ACCOUNT_STATUS_AUTH_EFFECT, ROLE_CLAIMS_EFFECT } from '../types/unions.js';\nimport { countSchema, documentIdSegmentSchema, epochMsSchema, userStatusSchema } from './atoms.js';\n\nconst statusReconcileQueueEntryBase = {\n enqueuedAt: epochMsSchema,\n lastAttemptAt: epochMsSchema.optional(),\n attemptCount: countSchema,\n};\n\nexport const StatusReconcileQueueAccountStatusEntrySchema = z.strictObject({\n ...statusReconcileQueueEntryBase,\n authEffect: z.literal(ACCOUNT_STATUS_AUTH_EFFECT),\n reason: z.literal('statusChangePending'),\n targetStatus: userStatusSchema,\n writeId: documentIdSegmentSchema,\n});\nexport type StatusReconcileQueueAccountStatusEntry = z.infer<\n typeof StatusReconcileQueueAccountStatusEntrySchema\n>;\n\nexport const StatusReconcileQueueRoleClaimsEntrySchema = z.strictObject({\n ...statusReconcileQueueEntryBase,\n authEffect: z.literal(ROLE_CLAIMS_EFFECT),\n reason: z.literal('postCommitAuthEffectFailed'),\n});\nexport type StatusReconcileQueueRoleClaimsEntry = z.infer<\n typeof StatusReconcileQueueRoleClaimsEntrySchema\n>;\n\nexport const StatusReconcileQueueEntrySchema = z.discriminatedUnion('authEffect', [\n StatusReconcileQueueAccountStatusEntrySchema,\n StatusReconcileQueueRoleClaimsEntrySchema,\n]);\nexport type StatusReconcileQueueEntry = z.infer<typeof StatusReconcileQueueEntrySchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sweep-state.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/sweep-state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sweep-state.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/sweep-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,wBAAwB;;;;;;;;;6BA0BjC,CAAC;AACL,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,sBAAsB;;;;;kBAOxB,CAAC;AACZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAItE,eAAO,MAAM,sBAAsB;;;kBAKxB,CAAC;AACZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;iBAoBzB,CAAC;AACL,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
// `sweepState/{sweepName}` — where a scheduled pass over a bounded, ordered source keeps its
|
|
2
|
-
// position (RULE-STD-BACKEND-112), one document per `SWEEP_STATE_NAMES` name. Backend-only: no client reads
|
|
3
|
-
// or writes it.
|
|
4
1
|
import { z } from 'zod';
|
|
5
2
|
import { SWEEP_STATE_MAX_DEFERRED } from '../constants/scheduled-jobs.js';
|
|
6
3
|
import { epochMsSchema } from './atoms.js';
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
// inLap — the next page starts strictly after the last row the lap moved past. `afterKey` is
|
|
10
|
-
// that row's document id; `afterValue` is its value of the numeric field the query
|
|
11
|
-
// orders by first, when it orders by one. The query orders by the field and then by the
|
|
12
|
-
// key and resumes after both, never `field > value`, which skips every row tied with it.
|
|
13
|
-
// done — the last lap reached the end of its source. The pass that exhausted it records that
|
|
14
|
-
// here rather than starting page one again in the same run; the next pass starts a new
|
|
15
|
-
// lap, so rows added behind the cursor are reached on the next lap.
|
|
4
|
+
// The query orders by the field and then by the key and resumes after both, never
|
|
5
|
+
// `field > value`, which skips every row tied with it.
|
|
16
6
|
export const SweepRollingCursorSchema = z
|
|
17
7
|
.discriminatedUnion('state', [
|
|
18
8
|
z
|
|
@@ -40,20 +30,16 @@ export const SweepRollingCursorSchema = z
|
|
|
40
30
|
});
|
|
41
31
|
}
|
|
42
32
|
});
|
|
43
|
-
// A row the cursor moved past without clearing it (a failed read or write). The pass retries it from
|
|
44
|
-
// here once it is due instead of stopping at it, so one failing row never pins the window (RULE-STD-BACKEND-309).
|
|
45
33
|
export const SweepDeferredRowSchema = z
|
|
46
34
|
.object({
|
|
47
35
|
key: z.string().min(1),
|
|
48
36
|
value: z.number().optional(),
|
|
49
|
-
/** Epoch ms from which a pass may retry it. */
|
|
50
37
|
nextAttemptAt: epochMsSchema,
|
|
51
|
-
/** Passes that examined it without clearing it; the pass that deferred it is the first. */
|
|
52
38
|
attemptCount: z.number().int().positive(),
|
|
53
39
|
})
|
|
54
40
|
.strict();
|
|
55
|
-
//
|
|
56
|
-
//
|
|
41
|
+
// Firebase Auth lists accounts only by page token, with no key to resume after; a token it no
|
|
42
|
+
// longer accepts restarts the lap.
|
|
57
43
|
export const SweepAuthScanLapSchema = z
|
|
58
44
|
.object({
|
|
59
45
|
pageToken: z.string().min(1),
|
|
@@ -62,9 +48,7 @@ export const SweepAuthScanLapSchema = z
|
|
|
62
48
|
.strict();
|
|
63
49
|
export const SweepStateSchema = z
|
|
64
50
|
.object({
|
|
65
|
-
/** Wall-clock ms the last full sign-in account scan reached the end of its lap (absent = never). */
|
|
66
51
|
fullScanLastRunAt: epochMsSchema.optional(),
|
|
67
|
-
/** The full scan's lap in progress; absent between laps. */
|
|
68
52
|
fullScanLap: SweepAuthScanLapSchema.optional(),
|
|
69
53
|
rollingCursor: SweepRollingCursorSchema.optional(),
|
|
70
54
|
deferred: z.array(SweepDeferredRowSchema).max(SWEEP_STATE_MAX_DEFERRED).optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sweep-state.js","sourceRoot":"","sources":["../../src/doc-schemas/sweep-state.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"sweep-state.js","sourceRoot":"","sources":["../../src/doc-schemas/sweep-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KA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sourcesContent":["import { z } from 'zod';\nimport { SWEEP_STATE_MAX_DEFERRED } from '../constants/scheduled-jobs.js';\nimport { epochMsSchema } from './atoms.js';\n\n// The query orders by the field and then by the key and resumes after both, never\n// `field > value`, which skips every row tied with it.\nexport const SweepRollingCursorSchema = z\n .discriminatedUnion('state', [\n z\n .object({\n state: z.literal('inLap'),\n afterKey: z.string().min(1),\n afterValue: z.number().optional(),\n lapStartedAt: epochMsSchema,\n })\n .strict(),\n z\n .object({\n state: z.literal('done'),\n lapStartedAt: epochMsSchema,\n lapCompletedAt: epochMsSchema,\n })\n .strict(),\n ])\n .superRefine((value, ctx) => {\n if (value.state === 'done' && value.lapCompletedAt < value.lapStartedAt) {\n ctx.addIssue({\n code: 'custom',\n path: ['lapCompletedAt'],\n message: 'a lap completes no earlier than it started',\n });\n }\n });\nexport type SweepRollingCursor = z.infer<typeof SweepRollingCursorSchema>;\n\nexport const SweepDeferredRowSchema = z\n .object({\n key: z.string().min(1),\n value: z.number().optional(),\n nextAttemptAt: epochMsSchema,\n attemptCount: z.number().int().positive(),\n })\n .strict();\nexport type SweepDeferredRow = z.infer<typeof SweepDeferredRowSchema>;\n\n// Firebase Auth lists accounts only by page token, with no key to resume after; a token it no\n// longer accepts restarts the lap.\nexport const SweepAuthScanLapSchema = z\n .object({\n pageToken: z.string().min(1),\n lapStartedAt: epochMsSchema,\n })\n .strict();\nexport type SweepAuthScanLap = z.infer<typeof SweepAuthScanLapSchema>;\n\nexport const SweepStateSchema = z\n .object({\n fullScanLastRunAt: epochMsSchema.optional(),\n fullScanLap: SweepAuthScanLapSchema.optional(),\n rollingCursor: SweepRollingCursorSchema.optional(),\n deferred: z.array(SweepDeferredRowSchema).max(SWEEP_STATE_MAX_DEFERRED).optional(),\n updatedAt: epochMsSchema,\n })\n .superRefine((value, ctx) => {\n const seen = new Set<string>();\n (value.deferred ?? []).forEach((row, index) => {\n if (seen.has(row.key)) {\n ctx.addIssue({\n code: 'custom',\n path: ['deferred', index, 'key'],\n message: 'a row is deferred at most once',\n });\n }\n seen.add(row.key);\n });\n });\nexport type SweepState = z.infer<typeof SweepStateSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuBxB,eAAO,MAAM,eAAe;;;;;;iBAO1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,uBAAuB;;;;;;;;;iBAKlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;iBAS5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,eAAe;;;iBAG1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,8BAA8B,2IAMzC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;kBAQjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,0BAA0B;;;kBAKpC,CAAC;AACJ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,4BAA4B;;;;;;kBAMvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAUtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -1,58 +1,36 @@
|
|
|
1
|
-
// Fixed-ID system documents in the underscore buckets, plus the derived stat documents. Every one
|
|
2
|
-
// is callable-only for writes.
|
|
3
1
|
import { z } from 'zod';
|
|
4
2
|
import { MAX_ANNOUNCEMENT_MESSAGE_LENGTH, MAX_APP_VERSION_LENGTH, MAX_LANDING_ABOUT_TEXT_LENGTH, MAX_LANDING_HERO_TITLE_LENGTH, MAX_MAINTENANCE_MESSAGE_LENGTH, } from '../constants/business.js';
|
|
5
3
|
import { MAX_STATS_VALIDATION_DISCREPANCIES } from '../constants/sports.js';
|
|
6
4
|
import { GallerySummarySchema } from './gallery.js';
|
|
7
5
|
import { countSchema, documentIdSegmentSchema, epochMsSchema, gameIdSchema, leagueIdSchema, statsBeaconActionSchema, statsDiscrepancyKindSchema, statsOperationIdSchema, teamIdSchema, userIdSchema, } from './atoms.js';
|
|
8
|
-
// `_appConfig/app` — the app-wide operational levers, set through the audited updateAppConfig
|
|
9
|
-
// callable. `appVersion` is what a live client compares itself against to force a refresh. It is
|
|
10
|
-
// written whole through `mergeAppConfigUpdate` and read one lever at a time through
|
|
11
|
-
// `readAppConfigLever` (../utils/app-config.ts). Every text lever carries the same cap as its
|
|
12
|
-
// updateAppConfig input field, so no writer can store a value the input would refuse.
|
|
13
6
|
export const AppConfigSchema = z.object({
|
|
14
7
|
// `''` is valid here — no version published yet; only the update input requires a value.
|
|
15
8
|
appVersion: z.string().max(MAX_APP_VERSION_LENGTH),
|
|
16
9
|
maintenanceMode: z.boolean(),
|
|
17
10
|
maintenanceMessage: z.string().max(MAX_MAINTENANCE_MESSAGE_LENGTH).optional(),
|
|
18
11
|
registrationEnabled: z.boolean(),
|
|
19
|
-
// Empty means no banner — there is no separate on/off flag. Non-empty is the band above every
|
|
20
|
-
// page.
|
|
21
12
|
announcementMessage: z.string().max(MAX_ANNOUNCEMENT_MESSAGE_LENGTH).optional(),
|
|
22
13
|
});
|
|
23
|
-
// `_appConfig/landingPage` — admin-authored landing page copy, written by adminUpdateLandingPage,
|
|
24
|
-
// plus the landing gallery's summary, which only the picture core writes.
|
|
25
14
|
export const LandingPageConfigSchema = z.object({
|
|
26
15
|
heroTitle: z.string().max(MAX_LANDING_HERO_TITLE_LENGTH),
|
|
27
16
|
aboutCompany: z.string().max(MAX_LANDING_ABOUT_TEXT_LENGTH),
|
|
28
17
|
pictures: GallerySummarySchema.optional(),
|
|
29
18
|
updatedAt: epochMsSchema,
|
|
30
19
|
});
|
|
31
|
-
// `_appConfig/statsBeacon` — the signal watching clients refresh their stats on, replaced whole by
|
|
32
|
-
// every write. The scope ids say what changed; an action that spans more than one game or league
|
|
33
|
-
// omits them, and because every write replaces the document, an omitted id never survives from an
|
|
34
|
-
// earlier write.
|
|
35
20
|
export const StatsBeaconSchema = z.object({
|
|
36
21
|
updatedAt: epochMsSchema,
|
|
37
22
|
// A fresh document id minted by every write, so two commits in the same millisecond still move
|
|
38
|
-
// the beacon.
|
|
23
|
+
// the beacon.
|
|
39
24
|
changeId: documentIdSegmentSchema.optional(),
|
|
40
25
|
action: statsBeaconActionSchema,
|
|
41
26
|
leagueId: leagueIdSchema.optional(),
|
|
42
27
|
gameId: gameIdSchema.optional(),
|
|
43
28
|
teamIds: z.array(teamIdSchema).optional(),
|
|
44
29
|
});
|
|
45
|
-
// `_systemData/adminList` — the admin and referee rosters. The source of truth the `admin` and
|
|
46
|
-
// `referee` custom claims are minted from, written only by the audited updateAdminList callable;
|
|
47
|
-
// the first admin of a fresh environment is seeded in the console.
|
|
48
30
|
export const AdminListSchema = z.object({
|
|
49
31
|
admins: z.array(userIdSchema),
|
|
50
32
|
referees: z.array(userIdSchema),
|
|
51
33
|
});
|
|
52
|
-
// `statsValidationReports/{reportId}` — one stats check: every place a game's stored numbers, or a
|
|
53
|
-
// derived aggregate, disagree with what the game's events and the completed games say they should
|
|
54
|
-
// be. Its id is the check's operation id, which the admin's browser mints, so two checks never share
|
|
55
|
-
// a report. Written only by the check, page by page; `complete` turns true with its last page.
|
|
56
34
|
export const STATS_DISCREPANCY_VALUE_SCHEMA = z.union([
|
|
57
35
|
z.number(),
|
|
58
36
|
z.string(),
|
|
@@ -63,9 +41,7 @@ export const STATS_DISCREPANCY_VALUE_SCHEMA = z.union([
|
|
|
63
41
|
export const StatsDiscrepancySchema = z.strictObject({
|
|
64
42
|
kind: statsDiscrepancyKindSchema,
|
|
65
43
|
gameId: gameIdSchema.optional(),
|
|
66
|
-
// The slash path of the document the finding is about.
|
|
67
44
|
path: z.string().min(1),
|
|
68
|
-
// The line or entry within it — a team id, a roster-entry id, a user id — when there is one.
|
|
69
45
|
key: z.string().min(1).optional(),
|
|
70
46
|
field: z.string().min(1).optional(),
|
|
71
47
|
expected: STATS_DISCREPANCY_VALUE_SCHEMA.optional(),
|
|
@@ -88,9 +64,7 @@ export const StatsValidationReportSchema = z.strictObject({
|
|
|
88
64
|
ranByUserId: userIdSchema,
|
|
89
65
|
scope: StatsValidationScopeSchema,
|
|
90
66
|
complete: z.boolean(),
|
|
91
|
-
// Game-tier findings first, then aggregate ones, at most MAX_STATS_VALIDATION_DISCREPANCIES.
|
|
92
67
|
discrepancies: z.array(StatsDiscrepancySchema).max(MAX_STATS_VALIDATION_DISCREPANCIES),
|
|
93
|
-
// Every finding, kept or not, counted by kind.
|
|
94
68
|
discrepancyCounts: z.partialRecord(statsDiscrepancyKindSchema, countSchema),
|
|
95
69
|
summary: StatsValidationSummarySchema,
|
|
96
70
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],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{ z } from 'zod';\nimport {\n MAX_ANNOUNCEMENT_MESSAGE_LENGTH,\n MAX_APP_VERSION_LENGTH,\n MAX_LANDING_ABOUT_TEXT_LENGTH,\n MAX_LANDING_HERO_TITLE_LENGTH,\n MAX_MAINTENANCE_MESSAGE_LENGTH,\n} from '../constants/business.js';\nimport { MAX_STATS_VALIDATION_DISCREPANCIES } from '../constants/sports.js';\nimport { GallerySummarySchema } from './gallery.js';\nimport {\n countSchema,\n documentIdSegmentSchema,\n epochMsSchema,\n gameIdSchema,\n leagueIdSchema,\n statsBeaconActionSchema,\n statsDiscrepancyKindSchema,\n statsOperationIdSchema,\n teamIdSchema,\n userIdSchema,\n} from './atoms.js';\n\nexport const AppConfigSchema = z.object({\n // `''` is valid here — no version published yet; only the update input requires a value.\n appVersion: z.string().max(MAX_APP_VERSION_LENGTH),\n maintenanceMode: z.boolean(),\n maintenanceMessage: z.string().max(MAX_MAINTENANCE_MESSAGE_LENGTH).optional(),\n registrationEnabled: z.boolean(),\n announcementMessage: z.string().max(MAX_ANNOUNCEMENT_MESSAGE_LENGTH).optional(),\n});\nexport type AppConfig = z.infer<typeof AppConfigSchema>;\n\nexport const LandingPageConfigSchema = z.object({\n heroTitle: z.string().max(MAX_LANDING_HERO_TITLE_LENGTH),\n aboutCompany: z.string().max(MAX_LANDING_ABOUT_TEXT_LENGTH),\n pictures: GallerySummarySchema.optional(),\n updatedAt: epochMsSchema,\n});\nexport type LandingPageConfig = z.infer<typeof LandingPageConfigSchema>;\n\nexport const StatsBeaconSchema = z.object({\n updatedAt: epochMsSchema,\n // A fresh document id minted by every write, so two commits in the same millisecond still move\n // the beacon.\n changeId: documentIdSegmentSchema.optional(),\n action: statsBeaconActionSchema,\n leagueId: leagueIdSchema.optional(),\n gameId: gameIdSchema.optional(),\n teamIds: z.array(teamIdSchema).optional(),\n});\nexport type StatsBeacon = z.infer<typeof StatsBeaconSchema>;\n\nexport const AdminListSchema = z.object({\n admins: z.array(userIdSchema),\n referees: z.array(userIdSchema),\n});\nexport type AdminList = z.infer<typeof AdminListSchema>;\n\nexport const STATS_DISCREPANCY_VALUE_SCHEMA = z.union([\n z.number(),\n z.string(),\n z.array(z.number().nullable()),\n z.record(z.string(), z.number()),\n z.null(),\n]);\n\nexport const StatsDiscrepancySchema = z.strictObject({\n kind: statsDiscrepancyKindSchema,\n gameId: gameIdSchema.optional(),\n path: z.string().min(1),\n key: z.string().min(1).optional(),\n field: z.string().min(1).optional(),\n expected: STATS_DISCREPANCY_VALUE_SCHEMA.optional(),\n actual: STATS_DISCREPANCY_VALUE_SCHEMA.optional(),\n});\nexport type StatsDiscrepancy = z.infer<typeof StatsDiscrepancySchema>;\n\nexport const StatsValidationScopeSchema = z\n .strictObject({ gameId: gameIdSchema.optional(), leagueId: leagueIdSchema.optional() })\n .refine(\n (scope) => scope.gameId === undefined || scope.leagueId === undefined,\n 'One game or one league, not both.',\n );\nexport type StatsValidationScope = z.infer<typeof StatsValidationScopeSchema>;\n\nexport const StatsValidationSummarySchema = z.strictObject({\n totalGamesChecked: countSchema,\n totalUsersChecked: countSchema,\n totalTeamsChecked: countSchema,\n totalLeaguesChecked: countSchema,\n discrepanciesFound: countSchema,\n});\nexport type StatsValidationSummary = z.infer<typeof StatsValidationSummarySchema>;\n\nexport const StatsValidationReportSchema = z.strictObject({\n reportId: z.string().min(1),\n operationId: statsOperationIdSchema,\n ranAt: epochMsSchema,\n ranByUserId: userIdSchema,\n scope: StatsValidationScopeSchema,\n complete: z.boolean(),\n discrepancies: z.array(StatsDiscrepancySchema).max(MAX_STATS_VALIDATION_DISCREPANCIES),\n discrepancyCounts: z.partialRecord(statsDiscrepancyKindSchema, countSchema),\n summary: StatsValidationSummarySchema,\n});\nexport type StatsValidationReport = z.infer<typeof StatsValidationReportSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team-membership.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/team-membership.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"team-membership.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/team-membership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;iBAY/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;iBAS/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;iBAOhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,qBAAqB;;;;iBAIhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
// The documents that put a user on a team: the membership itself and the three ways to reach one.
|
|
2
|
-
// Every one of them stores user ids only — names resolve from `publicUsers` (RULE-STD-ARCH-103).
|
|
3
1
|
import { z } from 'zod';
|
|
4
2
|
import { epochMsSchema, teamJoinRequestStatusSchema, leagueIdSchema, teamIdSchema, teamInvitationStatusSchema, teamJoinMethodSchema, teamMembershipStatusSchema, teamRoleSchema, userIdSchema, } from './atoms.js';
|
|
5
|
-
// `teamMemberships/{leagueId}_{teamId}_{userId}` — canonical membership and team role. The id is
|
|
6
|
-
// load-bearing: rules and callables read a membership by id to decide captain authority.
|
|
7
3
|
export const TeamMembershipSchema = z.object({
|
|
8
4
|
leagueId: leagueIdSchema,
|
|
9
5
|
teamId: teamIdSchema,
|
|
@@ -12,14 +8,11 @@ export const TeamMembershipSchema = z.object({
|
|
|
12
8
|
status: teamMembershipStatusSchema,
|
|
13
9
|
isGhost: z.boolean(),
|
|
14
10
|
joinedVia: teamJoinMethodSchema.optional(),
|
|
15
|
-
// The invite this membership came from, when `joinedVia` is `invite`.
|
|
16
11
|
teamInvitationId: z.string().optional(),
|
|
17
|
-
// The ghost id this real user's membership replaced, when a ghost was linked to them.
|
|
18
12
|
linkedFromGhostUserId: z.string().optional(),
|
|
19
13
|
joinedAt: epochMsSchema,
|
|
20
14
|
updatedAt: epochMsSchema,
|
|
21
15
|
});
|
|
22
|
-
// `teamInvitations/{inviteId}` — a captain invites a user onto their team.
|
|
23
16
|
export const TeamInvitationSchema = z.object({
|
|
24
17
|
leagueId: leagueIdSchema,
|
|
25
18
|
teamId: teamIdSchema,
|
|
@@ -30,7 +23,6 @@ export const TeamInvitationSchema = z.object({
|
|
|
30
23
|
createdAt: epochMsSchema,
|
|
31
24
|
respondedAt: epochMsSchema.optional(),
|
|
32
25
|
});
|
|
33
|
-
// `teamJoinRequests/{requestId}` — a player asks to join a team.
|
|
34
26
|
export const TeamJoinRequestSchema = z.object({
|
|
35
27
|
leagueId: leagueIdSchema,
|
|
36
28
|
teamId: teamIdSchema,
|
|
@@ -39,8 +31,6 @@ export const TeamJoinRequestSchema = z.object({
|
|
|
39
31
|
status: teamJoinRequestStatusSchema,
|
|
40
32
|
createdAt: epochMsSchema,
|
|
41
33
|
});
|
|
42
|
-
// `leagueFreeAgents/{leagueId}_{userId}` — a player available for assignment in a league. The
|
|
43
|
-
// document exists while the player is available and is deleted when they are placed or withdraw.
|
|
44
34
|
export const LeagueFreeAgentSchema = z.object({
|
|
45
35
|
leagueId: leagueIdSchema,
|
|
46
36
|
userId: userIdSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team-membership.js","sourceRoot":"","sources":["../../src/doc-schemas/team-membership.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"team-membership.js","sourceRoot":"","sources":["../../src/doc-schemas/team-membership.ts"],"names":[],"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,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,YAAY;IACpB,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n epochMsSchema,\n teamJoinRequestStatusSchema,\n leagueIdSchema,\n teamIdSchema,\n teamInvitationStatusSchema,\n teamJoinMethodSchema,\n teamMembershipStatusSchema,\n teamRoleSchema,\n userIdSchema,\n} from './atoms.js';\n\nexport const TeamMembershipSchema = z.object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n role: teamRoleSchema,\n status: teamMembershipStatusSchema,\n isGhost: z.boolean(),\n joinedVia: teamJoinMethodSchema.optional(),\n teamInvitationId: z.string().optional(),\n linkedFromGhostUserId: z.string().optional(),\n joinedAt: epochMsSchema,\n updatedAt: epochMsSchema,\n});\nexport type TeamMembership = z.infer<typeof TeamMembershipSchema>;\n\nexport const TeamInvitationSchema = z.object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n invitedUserId: userIdSchema,\n invitedByUserId: userIdSchema,\n message: z.string(),\n status: teamInvitationStatusSchema,\n createdAt: epochMsSchema,\n respondedAt: epochMsSchema.optional(),\n});\nexport type TeamInvitation = z.infer<typeof TeamInvitationSchema>;\n\nexport const TeamJoinRequestSchema = z.object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n message: z.string(),\n status: teamJoinRequestStatusSchema,\n createdAt: epochMsSchema,\n});\nexport type TeamJoinRequest = z.infer<typeof TeamJoinRequestSchema>;\n\nexport const LeagueFreeAgentSchema = z.object({\n leagueId: leagueIdSchema,\n userId: userIdSchema,\n createdAt: epochMsSchema,\n});\nexport type LeagueFreeAgent = z.infer<typeof LeagueFreeAgentSchema>;\n"]}
|
|
@@ -62,6 +62,5 @@ export declare const HistoricalStatsSchema: z.ZodObject<{
|
|
|
62
62
|
gamesPlayed: z.ZodNumber;
|
|
63
63
|
}, z.core.$strict>;
|
|
64
64
|
export type HistoricalStats = z.infer<typeof HistoricalStatsSchema>;
|
|
65
|
-
/** A baseline's totals, in the order an admin enters them. */
|
|
66
65
|
export declare const HISTORICAL_STAT_KEYS: readonly (keyof HistoricalStats)[];
|
|
67
66
|
//# sourceMappingURL=user-profile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-profile.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/user-profile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user-profile.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/user-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,eAAe;;;;EAAsB,CAAC;AAEnD,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAU5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;iBAQhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,qBAAqB;;;;;kBAA6D,CAAC;AAChG,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AASpE,eAAO,MAAM,oBAAoB,EAE5B,SAAS,CAAC,MAAM,eAAe,CAAC,EAAE,CAAC"}
|