@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
package/dist/schemas/awards.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
// Callable contracts for the award catalog, award grants, and the badges an account features.
|
|
2
|
-
//
|
|
3
|
-
// An award is created by its first badge's publication (the `award-badge` upload, ./uploads.ts), so
|
|
4
|
-
// no callable here creates one. Grants and revokes to named accounts share one input — two named
|
|
5
|
-
// lists, never an action discriminator (RULE-STD-BACKEND-002) — like the role roster's. A team's or a whole
|
|
6
|
-
// league's grant is its own decision, carried out a page of people at a time.
|
|
7
1
|
import { z } from 'zod';
|
|
8
2
|
import { MAX_AWARD_GRANT_TARGETS } from '../constants/business.js';
|
|
9
3
|
import { awardGroupGrantActionSchema, awardGroupGrantDecisionSchema, awardGroupGrantStatusSchema, awardGroupTypeSchema, } from '../doc-schemas/award-group-grant.js';
|
|
@@ -11,8 +5,6 @@ import { countSchema, documentIdSegmentSchema, epochMsSchema, userIdSchema, } fr
|
|
|
11
5
|
import { awardIdSchema } from '../doc-schemas/catalogs.js';
|
|
12
6
|
import { AWARD_GRANT_SKIP_REASON_KEYS, FEATURED_AWARD_SLOT_KEYS } from '../types/unions.js';
|
|
13
7
|
const targetList = (atom) => z.array(atom).max(MAX_AWARD_GRANT_TARGETS).optional();
|
|
14
|
-
// An admin grants an award to named accounts and revokes it from named accounts, in one commit.
|
|
15
|
-
// Recipients are deduplicated on the server; a ghost holds no account and is skipped.
|
|
16
8
|
export const AdminUpdateAwardGrantsInputSchema = z
|
|
17
9
|
.object({
|
|
18
10
|
awardId: awardIdSchema,
|
|
@@ -28,9 +20,6 @@ export const AdminUpdateAwardGrantsInputSchema = z
|
|
|
28
20
|
export const AwardGrantSkipSchema = z
|
|
29
21
|
.object({ userId: userIdSchema, reason: z.enum(AWARD_GRANT_SKIP_REASON_KEYS) })
|
|
30
22
|
.strict();
|
|
31
|
-
// What the change did for each account it reached: granted now, already held, revoked now, not held
|
|
32
|
-
// to begin with, or skipped with its reason. A retried call reports the accounts its first call
|
|
33
|
-
// changed as already held or not held, and writes nothing again.
|
|
34
23
|
export const AdminUpdateAwardGrantsResultSchema = z
|
|
35
24
|
.object({
|
|
36
25
|
awardId: awardIdSchema,
|
|
@@ -41,21 +30,12 @@ export const AdminUpdateAwardGrantsResultSchema = z
|
|
|
41
30
|
skipped: z.array(AwardGrantSkipSchema),
|
|
42
31
|
})
|
|
43
32
|
.strict();
|
|
44
|
-
// The group a group grant reaches: every active member of one team, or of one whole league.
|
|
45
|
-
// `groupId` is that team's or league's id.
|
|
46
33
|
export const AwardGroupSchema = z
|
|
47
34
|
.object({ groupType: awardGroupTypeSchema, groupId: documentIdSegmentSchema })
|
|
48
35
|
.strict();
|
|
49
|
-
// An admin grants an award to a group, or takes back what the group's grants gave. The decision opens
|
|
50
|
-
// at once and its people are reached a page at a time after the answer; a request the group's latest
|
|
51
|
-
// decision already settles (granting what is granted, taking back what is not) opens nothing.
|
|
52
36
|
export const AdminUpdateAwardGroupGrantInputSchema = z
|
|
53
37
|
.object({ awardId: awardIdSchema, action: awardGroupGrantActionSchema, group: AwardGroupSchema })
|
|
54
38
|
.strict();
|
|
55
|
-
// Where one decision on an award for a group stands. `peopleReached` is how many people it has dealt
|
|
56
|
-
// with so far: a grant's recorded people, or the people a revoke has taken the award back from or left
|
|
57
|
-
// holding it. A pending decision that failed carries its failure and how many times it has tried; the
|
|
58
|
-
// scheduled resume tries it again.
|
|
59
39
|
export const AwardGroupGrantProgressSchema = z
|
|
60
40
|
.object({
|
|
61
41
|
grantId: z.string().min(1),
|
|
@@ -69,8 +49,6 @@ export const AwardGroupGrantProgressSchema = z
|
|
|
69
49
|
completedAt: epochMsSchema.nullable(),
|
|
70
50
|
})
|
|
71
51
|
.strict();
|
|
72
|
-
// `opened` is false when the group's latest decision already settled the request; `grant` is then that
|
|
73
|
-
// decision, or null when the group has none.
|
|
74
52
|
export const AdminUpdateAwardGroupGrantResultSchema = z
|
|
75
53
|
.object({
|
|
76
54
|
awardId: awardIdSchema,
|
|
@@ -78,23 +56,16 @@ export const AdminUpdateAwardGroupGrantResultSchema = z
|
|
|
78
56
|
grant: AwardGroupGrantProgressSchema.nullable(),
|
|
79
57
|
})
|
|
80
58
|
.strict();
|
|
81
|
-
// An admin reads the latest decision on an award for a group, so the progress survives a closed page.
|
|
82
59
|
export const AdminGetAwardGroupGrantStatusInputSchema = z
|
|
83
60
|
.object({ awardId: awardIdSchema, group: AwardGroupSchema })
|
|
84
61
|
.strict();
|
|
85
62
|
export const AdminGetAwardGroupGrantStatusResultSchema = z
|
|
86
63
|
.object({ grant: AwardGroupGrantProgressSchema.nullable() })
|
|
87
64
|
.strict();
|
|
88
|
-
// An admin deletes an award nobody holds. Its badge's files are retired with it.
|
|
89
65
|
export const AdminDeleteAwardDefinitionInputSchema = z.object({ awardId: awardIdSchema }).strict();
|
|
90
|
-
// `deleted` is false when the award was already gone: nothing was written.
|
|
91
66
|
export const AdminDeleteAwardDefinitionResultSchema = z
|
|
92
67
|
.object({ awardId: awardIdSchema, deleted: z.boolean() })
|
|
93
68
|
.strict();
|
|
94
|
-
// The signed-in account chooses which of its own awards to show beside its name: a primary and a
|
|
95
|
-
// secondary badge, each an award it holds, or none. The input is the one change the person made —
|
|
96
|
-
// set a slot, clear a slot, or swap the two — and the core applies it to the pair as stored, so a
|
|
97
|
-
// change to one slot never writes back a stale value of the other. No user id is ever sent.
|
|
98
69
|
const featuredAwardSlotSchema = z.enum(FEATURED_AWARD_SLOT_KEYS);
|
|
99
70
|
export const UpdateFeaturedAwardsInputSchema = z.discriminatedUnion('action', [
|
|
100
71
|
z
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"awards.js","sourceRoot":"","sources":["../../src/schemas/awards.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,EAAE;AAC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AO,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;KACxD,MAAM,EAAE,CAAC;AAKZ,iGAAiG;AACjG,kGAAkG;AAClG,kGAAkG;AAClG,4FAA4F;AAC5F,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IAC5E,CAAC;SACE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;SAC3F,MAAM,EAAE;IACX,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 to named accounts share one input — two named\n// lists, never an action discriminator (RULE-STD-BACKEND-002) — like the role roster's. A team's or a whole\n// league's grant is its own decision, carried out a page of people at a time.\n\nimport { z } from 'zod';\nimport { MAX_AWARD_GRANT_TARGETS } from '../constants/business.js';\nimport {\n awardGroupGrantActionSchema,\n awardGroupGrantDecisionSchema,\n awardGroupGrantStatusSchema,\n awardGroupTypeSchema,\n} from '../doc-schemas/award-group-grant.js';\nimport {\n countSchema,\n documentIdSegmentSchema,\n epochMsSchema,\n userIdSchema,\n} from '../doc-schemas/atoms.js';\nimport { awardIdSchema } from '../doc-schemas/catalogs.js';\nimport { AWARD_GRANT_SKIP_REASON_KEYS, FEATURED_AWARD_SLOT_KEYS } from '../types/unions.js';\n\nconst targetList = <T extends z.ZodTypeAny>(atom: T) =>\n z.array(atom).max(MAX_AWARD_GRANT_TARGETS).optional();\n\n// An admin grants an award to named accounts and revokes it from named accounts, in one commit.\n// Recipients are deduplicated on the server; a ghost holds no account and is skipped.\nexport const AdminUpdateAwardGrantsInputSchema = z\n .object({\n awardId: awardIdSchema,\n grantUserIds: targetList(userIdSchema),\n revokeUserIds: targetList(userIdSchema),\n })\n .strict()\n .refine(\n (input) =>\n [input.grantUserIds, input.revokeUserIds].some(\n (list) => list !== undefined && list.length > 0,\n ),\n { message: 'Name someone to grant the award to or revoke it from.' },\n )\n .refine(\n (input) =>\n !(input.grantUserIds ?? []).some((userId) => (input.revokeUserIds ?? []).includes(userId)),\n {\n message: 'An account cannot be granted and revoked the award in one change.',\n path: ['revokeUserIds'],\n },\n );\nexport type AdminUpdateAwardGrantsInput = z.infer<typeof AdminUpdateAwardGrantsInputSchema>;\n\nexport const AwardGrantSkipSchema = z\n .object({ userId: userIdSchema, reason: z.enum(AWARD_GRANT_SKIP_REASON_KEYS) })\n .strict();\nexport type AwardGrantSkip = z.infer<typeof AwardGrantSkipSchema>;\n\n// What the change did for each account it reached: granted now, already held, revoked now, not held\n// to begin with, or skipped with its reason. A retried call reports the accounts its first call\n// changed as already held or not held, and writes nothing again.\nexport const AdminUpdateAwardGrantsResultSchema = z\n .object({\n awardId: awardIdSchema,\n granted: z.array(userIdSchema),\n alreadyHeld: z.array(userIdSchema),\n revoked: z.array(userIdSchema),\n notHeld: z.array(userIdSchema),\n skipped: z.array(AwardGrantSkipSchema),\n })\n .strict();\nexport type AdminUpdateAwardGrantsResult = z.infer<typeof AdminUpdateAwardGrantsResultSchema>;\n\n// The group a group grant reaches: every active member of one team, or of one whole league.\n// `groupId` is that team's or league's id.\nexport const AwardGroupSchema = z\n .object({ groupType: awardGroupTypeSchema, groupId: documentIdSegmentSchema })\n .strict();\nexport type AwardGroup = z.infer<typeof AwardGroupSchema>;\n\n// An admin grants an award to a group, or takes back what the group's grants gave. The decision opens\n// at once and its people are reached a page at a time after the answer; a request the group's latest\n// decision already settles (granting what is granted, taking back what is not) opens nothing.\nexport const AdminUpdateAwardGroupGrantInputSchema = z\n .object({ awardId: awardIdSchema, action: awardGroupGrantActionSchema, group: AwardGroupSchema })\n .strict();\nexport type AdminUpdateAwardGroupGrantInput = z.infer<typeof AdminUpdateAwardGroupGrantInputSchema>;\n\n// Where one decision on an award for a group stands. `peopleReached` is how many people it has dealt\n// with so far: a grant's recorded people, or the people a revoke has taken the award back from or left\n// holding it. A pending decision that failed carries its failure and how many times it has tried; the\n// scheduled resume tries it again.\nexport const AwardGroupGrantProgressSchema = z\n .object({\n grantId: z.string().min(1),\n action: awardGroupGrantActionSchema,\n decision: awardGroupGrantDecisionSchema,\n status: awardGroupGrantStatusSchema,\n peopleReached: countSchema,\n attemptCount: countSchema,\n lastError: z.string().nullable(),\n createdAt: epochMsSchema,\n completedAt: epochMsSchema.nullable(),\n })\n .strict();\nexport type AwardGroupGrantProgress = z.infer<typeof AwardGroupGrantProgressSchema>;\n\n// `opened` is false when the group's latest decision already settled the request; `grant` is then that\n// decision, or null when the group has none.\nexport const AdminUpdateAwardGroupGrantResultSchema = z\n .object({\n awardId: awardIdSchema,\n opened: z.boolean(),\n grant: AwardGroupGrantProgressSchema.nullable(),\n })\n .strict();\nexport type AdminUpdateAwardGroupGrantResult = z.infer<\n typeof AdminUpdateAwardGroupGrantResultSchema\n>;\n\n// An admin reads the latest decision on an award for a group, so the progress survives a closed page.\nexport const AdminGetAwardGroupGrantStatusInputSchema = z\n .object({ awardId: awardIdSchema, group: AwardGroupSchema })\n .strict();\nexport type AdminGetAwardGroupGrantStatusInput = z.infer<\n typeof AdminGetAwardGroupGrantStatusInputSchema\n>;\nexport const AdminGetAwardGroupGrantStatusResultSchema = z\n .object({ grant: AwardGroupGrantProgressSchema.nullable() })\n .strict();\nexport type AdminGetAwardGroupGrantStatusResult = z.infer<\n typeof AdminGetAwardGroupGrantStatusResultSchema\n>;\n\n// An admin deletes an award nobody holds. Its badge's files are retired with it.\nexport const AdminDeleteAwardDefinitionInputSchema = z.object({ awardId: awardIdSchema }).strict();\nexport type AdminDeleteAwardDefinitionInput = z.infer<typeof AdminDeleteAwardDefinitionInputSchema>;\n\n// `deleted` is false when the award was already gone: nothing was written.\nexport const AdminDeleteAwardDefinitionResultSchema = z\n .object({ awardId: awardIdSchema, deleted: z.boolean() })\n .strict();\nexport type AdminDeleteAwardDefinitionResult = z.infer<\n typeof AdminDeleteAwardDefinitionResultSchema\n>;\n\n// The signed-in account chooses which of its own awards to show beside its name: a primary and a\n// secondary badge, each an award it holds, or none. The input is the one change the person made —\n// set a slot, clear a slot, or swap the two — and the core applies it to the pair as stored, so a\n// change to one slot never writes back a stale value of the other. No user id is ever sent.\nconst featuredAwardSlotSchema = z.enum(FEATURED_AWARD_SLOT_KEYS);\nexport const UpdateFeaturedAwardsInputSchema = z.discriminatedUnion('action', [\n z\n .object({ action: z.literal('set'), slot: featuredAwardSlotSchema, awardId: awardIdSchema })\n .strict(),\n z.object({ action: z.literal('clear'), slot: featuredAwardSlotSchema }).strict(),\n z.object({ action: z.literal('swap') }).strict(),\n]);\nexport type UpdateFeaturedAwardsInput = z.infer<typeof UpdateFeaturedAwardsInputSchema>;\n\nexport const UpdateFeaturedAwardsResultSchema = z\n .object({\n userId: userIdSchema,\n primaryAwardId: awardIdSchema.nullable(),\n secondaryAwardId: awardIdSchema.nullable(),\n changed: z.boolean(),\n })\n .strict();\nexport type UpdateFeaturedAwardsResult = z.infer<typeof UpdateFeaturedAwardsResultSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"awards.js","sourceRoot":"","sources":["../../src/schemas/awards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,2BAA2B,EAC3B,oBAAoB,GACrB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,aAAa,EACb,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE5F,MAAM,UAAU,GAAG,CAAyB,IAAO,EAAE,EAAE,CACrD,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE,CAAC;AAExD,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,OAAO,EAAE,aAAa;IACtB,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC;IACtC,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,aAAa,CAAC,CAAC,IAAI,CAC5C,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAChD,EACH,EAAE,OAAO,EAAE,uDAAuD,EAAE,CACrE;KACA,MAAM,CACL,CAAC,KAAK,EAAE,EAAE,CACR,CAAC,CAAC,KAAK,CAAC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CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IAC5E,CAAC;SACE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;SAC3F,MAAM,EAAE;IACX,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":["import { z } from 'zod';\nimport { MAX_AWARD_GRANT_TARGETS } from '../constants/business.js';\nimport {\n awardGroupGrantActionSchema,\n awardGroupGrantDecisionSchema,\n awardGroupGrantStatusSchema,\n awardGroupTypeSchema,\n} from '../doc-schemas/award-group-grant.js';\nimport {\n countSchema,\n documentIdSegmentSchema,\n epochMsSchema,\n userIdSchema,\n} from '../doc-schemas/atoms.js';\nimport { awardIdSchema } from '../doc-schemas/catalogs.js';\nimport { AWARD_GRANT_SKIP_REASON_KEYS, FEATURED_AWARD_SLOT_KEYS } from '../types/unions.js';\n\nconst targetList = <T extends z.ZodTypeAny>(atom: T) =>\n z.array(atom).max(MAX_AWARD_GRANT_TARGETS).optional();\n\nexport const AdminUpdateAwardGrantsInputSchema = z\n .object({\n awardId: awardIdSchema,\n grantUserIds: targetList(userIdSchema),\n revokeUserIds: targetList(userIdSchema),\n })\n .strict()\n .refine(\n (input) =>\n [input.grantUserIds, input.revokeUserIds].some(\n (list) => list !== undefined && list.length > 0,\n ),\n { message: 'Name someone to grant the award to or revoke it from.' },\n )\n .refine(\n (input) =>\n !(input.grantUserIds ?? []).some((userId) => (input.revokeUserIds ?? []).includes(userId)),\n {\n message: 'An account cannot be granted and revoked the award in one change.',\n path: ['revokeUserIds'],\n },\n );\nexport type AdminUpdateAwardGrantsInput = z.infer<typeof AdminUpdateAwardGrantsInputSchema>;\n\nexport const AwardGrantSkipSchema = z\n .object({ userId: userIdSchema, reason: z.enum(AWARD_GRANT_SKIP_REASON_KEYS) })\n .strict();\nexport type AwardGrantSkip = z.infer<typeof AwardGrantSkipSchema>;\n\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\nexport const AwardGroupSchema = z\n .object({ groupType: awardGroupTypeSchema, groupId: documentIdSegmentSchema })\n .strict();\nexport type AwardGroup = z.infer<typeof AwardGroupSchema>;\n\nexport const AdminUpdateAwardGroupGrantInputSchema = z\n .object({ awardId: awardIdSchema, action: awardGroupGrantActionSchema, group: AwardGroupSchema })\n .strict();\nexport type AdminUpdateAwardGroupGrantInput = z.infer<typeof AdminUpdateAwardGroupGrantInputSchema>;\n\nexport const AwardGroupGrantProgressSchema = z\n .object({\n grantId: z.string().min(1),\n action: awardGroupGrantActionSchema,\n decision: awardGroupGrantDecisionSchema,\n status: awardGroupGrantStatusSchema,\n peopleReached: countSchema,\n attemptCount: countSchema,\n lastError: z.string().nullable(),\n createdAt: epochMsSchema,\n completedAt: epochMsSchema.nullable(),\n })\n .strict();\nexport type AwardGroupGrantProgress = z.infer<typeof AwardGroupGrantProgressSchema>;\n\nexport const AdminUpdateAwardGroupGrantResultSchema = z\n .object({\n awardId: awardIdSchema,\n opened: z.boolean(),\n grant: AwardGroupGrantProgressSchema.nullable(),\n })\n .strict();\nexport type AdminUpdateAwardGroupGrantResult = z.infer<\n typeof AdminUpdateAwardGroupGrantResultSchema\n>;\n\nexport const AdminGetAwardGroupGrantStatusInputSchema = z\n .object({ awardId: awardIdSchema, group: AwardGroupSchema })\n .strict();\nexport type AdminGetAwardGroupGrantStatusInput = z.infer<\n typeof AdminGetAwardGroupGrantStatusInputSchema\n>;\nexport const AdminGetAwardGroupGrantStatusResultSchema = z\n .object({ grant: AwardGroupGrantProgressSchema.nullable() })\n .strict();\nexport type AdminGetAwardGroupGrantStatusResult = z.infer<\n typeof AdminGetAwardGroupGrantStatusResultSchema\n>;\n\nexport const AdminDeleteAwardDefinitionInputSchema = z.object({ awardId: awardIdSchema }).strict();\nexport type AdminDeleteAwardDefinitionInput = z.infer<typeof AdminDeleteAwardDefinitionInputSchema>;\n\nexport const AdminDeleteAwardDefinitionResultSchema = z\n .object({ awardId: awardIdSchema, deleted: z.boolean() })\n .strict();\nexport type AdminDeleteAwardDefinitionResult = z.infer<\n typeof AdminDeleteAwardDefinitionResultSchema\n>;\n\nconst featuredAwardSlotSchema = z.enum(FEATURED_AWARD_SLOT_KEYS);\nexport const UpdateFeaturedAwardsInputSchema = z.discriminatedUnion('action', [\n z\n .object({ action: z.literal('set'), slot: featuredAwardSlotSchema, awardId: awardIdSchema })\n .strict(),\n z.object({ action: z.literal('clear'), slot: featuredAwardSlotSchema }).strict(),\n z.object({ action: z.literal('swap') }).strict(),\n]);\nexport type UpdateFeaturedAwardsInput = z.infer<typeof UpdateFeaturedAwardsInputSchema>;\n\nexport const UpdateFeaturedAwardsResultSchema = z\n .object({\n userId: userIdSchema,\n primaryAwardId: awardIdSchema.nullable(),\n secondaryAwardId: awardIdSchema.nullable(),\n changed: z.boolean(),\n })\n .strict();\nexport type UpdateFeaturedAwardsResult = z.infer<typeof UpdateFeaturedAwardsResultSchema>;\n"]}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
/** Every ledger the dead-letter replay supports. */
|
|
3
2
|
export declare const DEAD_LETTER_COLLECTION_KEYS: readonly ["notificationDeliveries"];
|
|
4
3
|
export declare const DeadLetterCollectionSchema: z.ZodEnum<{
|
|
5
4
|
notificationDeliveries: "notificationDeliveries";
|
|
6
5
|
}>;
|
|
7
6
|
export type DeadLetterCollection = z.infer<typeof DeadLetterCollectionSchema>;
|
|
8
|
-
/** What the operator's screen calls each lane, beside its raw collection id. */
|
|
9
7
|
export declare const DEAD_LETTER_COLLECTION_LABELS: {
|
|
10
8
|
readonly [K in DeadLetterCollection]: string;
|
|
11
9
|
};
|
|
12
|
-
/** The most rows the list returns per lane. */
|
|
13
10
|
export declare const MAX_DEAD_LETTERS_LISTED = 200;
|
|
14
11
|
export declare const GetDeadLettersInputSchema: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
15
12
|
collection: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dead-letters.d.ts","sourceRoot":"","sources":["../../src/schemas/dead-letters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dead-letters.d.ts","sourceRoot":"","sources":["../../src/schemas/dead-letters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,2BAA2B,qCAAsC,CAAC;AAC/E,eAAO,MAAM,0BAA0B;;EAAsC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,6BAA6B,EAAE;IAAE,QAAQ,EAAE,CAAC,IAAI,oBAAoB,GAAG,MAAM;CAEzF,CAAC;AAEF,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,eAAO,MAAM,yBAAyB;;;;;oBAM1B,CAAC;AACb,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,mBAAmB;;;;;;;;kBAQrB,CAAC;AACZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;kBAM5B,CAAC;AACZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,gCAAgC;;;;;;;kBAOlC,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,eAAO,MAAM,iCAAiC;;;;;;;;;;kBAUnC,CAAC;AACZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC"}
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
// Callable contracts for the operator's dead letters: the read-only list of the durable rows every
|
|
2
|
-
// supported pipeline stopped retrying, and the replay that puts one back to work after the cause is
|
|
3
|
-
// fixed. The replay is a repair, so it takes the admin's reason (RULE-STD-BACKEND-212). The caller names a lane
|
|
4
|
-
// and a row id, never a Firestore path: the backend's lane registry derives the document from them
|
|
5
|
-
// (RULE-STD-ARCH-106).
|
|
6
1
|
import { z } from 'zod';
|
|
7
2
|
import { countSchema, documentIdSegmentSchema, epochMsSchema, repairReasonSchema, } from '../doc-schemas/atoms.js';
|
|
8
|
-
/** Every ledger the dead-letter replay supports. */
|
|
9
3
|
export const DEAD_LETTER_COLLECTION_KEYS = ['notificationDeliveries'];
|
|
10
4
|
export const DeadLetterCollectionSchema = z.enum(DEAD_LETTER_COLLECTION_KEYS);
|
|
11
|
-
/** What the operator's screen calls each lane, beside its raw collection id. */
|
|
12
5
|
export const DEAD_LETTER_COLLECTION_LABELS = {
|
|
13
6
|
notificationDeliveries: 'Admin notification delivery',
|
|
14
7
|
};
|
|
15
|
-
/** The most rows the list returns per lane. */
|
|
16
8
|
export const MAX_DEAD_LETTERS_LISTED = 200;
|
|
17
|
-
// The list: every lane, or one; at most `limit` rows per lane, under the callable's own ceiling.
|
|
18
9
|
export const GetDeadLettersInputSchema = z
|
|
19
10
|
.object({
|
|
20
11
|
collection: DeadLetterCollectionSchema.optional(),
|
|
@@ -22,8 +13,6 @@ export const GetDeadLettersInputSchema = z
|
|
|
22
13
|
})
|
|
23
14
|
.strict()
|
|
24
15
|
.nullish();
|
|
25
|
-
// One parked row, a projection over the lanes' own row shapes: each names its dead-letter time, last
|
|
26
|
-
// error, and attempts in its own fields, and the list maps them onto these.
|
|
27
16
|
export const DeadLetterRowSchema = z
|
|
28
17
|
.object({
|
|
29
18
|
collection: DeadLetterCollectionSchema,
|
|
@@ -33,7 +22,6 @@ export const DeadLetterRowSchema = z
|
|
|
33
22
|
attemptCount: countSchema.nullable(),
|
|
34
23
|
})
|
|
35
24
|
.strict();
|
|
36
|
-
// `truncated` is true when any lane hit the row cap: more parked rows exist than shown.
|
|
37
25
|
export const GetDeadLettersResultSchema = z
|
|
38
26
|
.object({
|
|
39
27
|
generatedAt: epochMsSchema,
|
|
@@ -41,7 +29,6 @@ export const GetDeadLettersResultSchema = z
|
|
|
41
29
|
truncated: z.boolean(),
|
|
42
30
|
})
|
|
43
31
|
.strict();
|
|
44
|
-
// `dryRun` inspects the row — its status, and what a replay would reset it to — and writes nothing.
|
|
45
32
|
export const AdminReplayDeadLetterInputSchema = z
|
|
46
33
|
.object({
|
|
47
34
|
collection: DeadLetterCollectionSchema,
|
|
@@ -50,8 +37,6 @@ export const AdminReplayDeadLetterInputSchema = z
|
|
|
50
37
|
dryRun: z.boolean().optional(),
|
|
51
38
|
})
|
|
52
39
|
.strict();
|
|
53
|
-
// A performed replay answers `replayed` and the active value the row was reset to; a dry run answers
|
|
54
|
-
// `dryRun`, the row's current status, and what a replay would reset it to.
|
|
55
40
|
export const AdminReplayDeadLetterResultSchema = z
|
|
56
41
|
.object({
|
|
57
42
|
collection: DeadLetterCollectionSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dead-letters.js","sourceRoot":"","sources":["../../src/schemas/dead-letters.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"dead-letters.js","sourceRoot":"","sources":["../../src/schemas/dead-letters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,aAAa,EACb,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,wBAAwB,CAAU,CAAC;AAC/E,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;AAG9E,MAAM,CAAC,MAAM,6BAA6B,GAAqD;IAC7F,sBAAsB,EAAE,6BAA6B;CACtD,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,UAAU,EAAE,0BAA0B,CAAC,QAAQ,EAAE;IACjD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE;CACvE,CAAC;KACD,MAAM,EAAE;KACR,OAAO,EAAE,CAAC;AAGb,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC;KACjC,MAAM,CAAC;IACN,UAAU,EAAE,0BAA0B;IACtC,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EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n countSchema,\n documentIdSegmentSchema,\n epochMsSchema,\n repairReasonSchema,\n} from '../doc-schemas/atoms.js';\n\nexport const DEAD_LETTER_COLLECTION_KEYS = ['notificationDeliveries'] as const;\nexport const DeadLetterCollectionSchema = z.enum(DEAD_LETTER_COLLECTION_KEYS);\nexport type DeadLetterCollection = z.infer<typeof DeadLetterCollectionSchema>;\n\nexport const DEAD_LETTER_COLLECTION_LABELS: { readonly [K in DeadLetterCollection]: string } = {\n notificationDeliveries: 'Admin notification delivery',\n};\n\nexport const MAX_DEAD_LETTERS_LISTED = 200;\n\nexport const GetDeadLettersInputSchema = z\n .object({\n collection: DeadLetterCollectionSchema.optional(),\n limit: z.number().int().min(1).max(MAX_DEAD_LETTERS_LISTED).optional(),\n })\n .strict()\n .nullish();\nexport type GetDeadLettersInput = z.infer<typeof GetDeadLettersInputSchema>;\n\nexport const DeadLetterRowSchema = z\n .object({\n collection: DeadLetterCollectionSchema,\n docId: z.string().min(1),\n deadLetteredAt: epochMsSchema.nullable(),\n lastError: z.string().nullable(),\n attemptCount: countSchema.nullable(),\n })\n .strict();\nexport type DeadLetterRow = z.infer<typeof DeadLetterRowSchema>;\n\nexport const GetDeadLettersResultSchema = z\n .object({\n generatedAt: epochMsSchema,\n rows: z.array(DeadLetterRowSchema),\n truncated: z.boolean(),\n })\n .strict();\nexport type GetDeadLettersResult = z.infer<typeof GetDeadLettersResultSchema>;\n\nexport const AdminReplayDeadLetterInputSchema = z\n .object({\n collection: DeadLetterCollectionSchema,\n docId: documentIdSegmentSchema,\n reason: repairReasonSchema,\n dryRun: z.boolean().optional(),\n })\n .strict();\nexport type AdminReplayDeadLetterInput = z.infer<typeof AdminReplayDeadLetterInputSchema>;\n\nexport const AdminReplayDeadLetterResultSchema = z\n .object({\n collection: DeadLetterCollectionSchema,\n docId: z.string().min(1),\n replayed: z.literal(true).optional(),\n resetTo: z.string().optional(),\n dryRun: z.literal(true).optional(),\n currentStatus: z.unknown().optional(),\n wouldResetTo: z.string().optional(),\n })\n .strict();\nexport type AdminReplayDeadLetterResult = z.infer<typeof AdminReplayDeadLetterResultSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"game-locations.d.ts","sourceRoot":"","sources":["../../src/schemas/game-locations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"game-locations.d.ts","sourceRoot":"","sources":["../../src/schemas/game-locations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,sBAAsB,wDAAmD,CAAC;AACvF,eAAO,MAAM,+BAA+B,wDAE3C,CAAC;AACF,eAAO,MAAM,6BAA6B,wDAEzC,CAAC;AACF,eAAO,MAAM,8BAA8B,oEAKvC,CAAC;AACL,eAAO,MAAM,sBAAsB,wDAAmD,CAAC;AASvF,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;;;;;;kBAa5C,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"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Callable contracts for game locations: create, edit, and delete one venue. Admin only. The
|
|
2
|
-
// venue's picture goes through the upload pipeline, never through these.
|
|
3
1
|
import { z } from 'zod';
|
|
4
2
|
import { MAX_GAME_LOCATION_SUB_LOCATIONS } from '../constants/business.js';
|
|
5
3
|
import { textFieldSchema } from '../doc-schemas/atoms.js';
|
|
@@ -7,7 +5,6 @@ import { gameLocationIdSchema } from '../doc-schemas/game-location.js';
|
|
|
7
5
|
import { GAME_LOCATION_MEMO_INPUT_FORMAT, GAME_LOCATION_NAME_INPUT_FORMAT, GAME_LOCATION_STREET_ADDRESS_INPUT_FORMAT, GAME_LOCATION_SUB_LOCATION_INPUT_FORMAT, } from '../input-formats/input-formats.js';
|
|
8
6
|
export const gameLocationNameSchema = textFieldSchema(GAME_LOCATION_NAME_INPUT_FORMAT);
|
|
9
7
|
export const gameLocationStreetAddressSchema = textFieldSchema(GAME_LOCATION_STREET_ADDRESS_INPUT_FORMAT);
|
|
10
|
-
// One court, sheet, or room within a venue — as the venue lists it, and as a game names it.
|
|
11
8
|
export const gameLocationSubLocationSchema = textFieldSchema(GAME_LOCATION_SUB_LOCATION_INPUT_FORMAT);
|
|
12
9
|
export const gameLocationSubLocationsSchema = z
|
|
13
10
|
.array(gameLocationSubLocationSchema)
|
|
@@ -15,10 +12,7 @@ export const gameLocationSubLocationsSchema = z
|
|
|
15
12
|
.refine((subLocations) => new Set(subLocations).size === subLocations.length, {
|
|
16
13
|
message: 'Each sub-location may appear only once.',
|
|
17
14
|
});
|
|
18
|
-
// An empty memo means the venue has none.
|
|
19
15
|
export const gameLocationMemoSchema = textFieldSchema(GAME_LOCATION_MEMO_INPUT_FORMAT);
|
|
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.
|
|
22
16
|
const gameLocationFieldsShape = {
|
|
23
17
|
name: gameLocationNameSchema,
|
|
24
18
|
streetAddress: gameLocationStreetAddressSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"game-locations.js","sourceRoot":"","sources":["../../src/schemas/game-locations.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"game-locations.js","sourceRoot":"","sources":["../../src/schemas/game-locations.ts"],"names":[],"mappings":"AAAA,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,mCAAmC,CAAC;AAE3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAC,+BAA+B,CAAC,CAAC;AACvF,MAAM,CAAC,MAAM,+BAA+B,GAAG,eAAe,CAC5D,yCAAyC,CAC1C,CAAC;AACF,MAAM,CAAC,MAAM,6BAA6B,GAAG,eAAe,CAC1D,uCAAuC,CACxC,CAAC;AACF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC;KAC5C,KAAK,CAAC,6BAA6B,CAAC;KACpC,GAAG,CAAC,+BAA+B,CAAC;KACpC,MAAM,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,MAAM,EAAE;IAC5E,OAAO,EAAE,yCAAyC;CACnD,CAAC,CAAC;AACL,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAC,+BAA+B,CAAC,CAAC;AAEvF,MAAM,uBAAuB,GAAG;IAC9B,IAAI,EAAE,sBAAsB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ChD,MAAM,EAAE,CAAC","sourcesContent":["import { 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/input-formats.js';\n\nexport const gameLocationNameSchema = textFieldSchema(GAME_LOCATION_NAME_INPUT_FORMAT);\nexport const gameLocationStreetAddressSchema = textFieldSchema(\n GAME_LOCATION_STREET_ADDRESS_INPUT_FORMAT,\n);\nexport const gameLocationSubLocationSchema = textFieldSchema(\n GAME_LOCATION_SUB_LOCATION_INPUT_FORMAT,\n);\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 });\nexport const gameLocationMemoSchema = textFieldSchema(GAME_LOCATION_MEMO_INPUT_FORMAT);\n\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 }) =>\n 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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hardware-loan-contracts.d.ts","sourceRoot":"","sources":["../../src/schemas/hardware-loan-contracts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hardware-loan-contracts.d.ts","sourceRoot":"","sources":["../../src/schemas/hardware-loan-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,2BAA2B;;;EAAoC,CAAC;AAE7E,eAAO,MAAM,0CAA0C;;;;;;kBASnD,CAAC;AACL,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,0CAA0C,CAClD,CAAC;AAEF,eAAO,MAAM,2CAA2C;;kBAE7C,CAAC;AACZ,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,2CAA2C,CACnD,CAAC;AAEF,eAAO,MAAM,8CAA8C;;;kBAEhD,CAAC;AACZ,MAAM,MAAM,wCAAwC,GAAG,CAAC,CAAC,KAAK,CAC5D,OAAO,8CAA8C,CACtD,CAAC;AAEF,eAAO,MAAM,+CAA+C;;;;kBAMjD,CAAC;AACZ,MAAM,MAAM,yCAAyC,GAAG,CAAC,CAAC,KAAK,CAC7D,OAAO,+CAA+C,CACvD,CAAC;AAEF,eAAO,MAAM,0CAA0C;;kBAE5C,CAAC;AACZ,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,0CAA0C,CAClD,CAAC;AAEF,eAAO,MAAM,2CAA2C;;;;kBAM7C,CAAC;AACZ,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,2CAA2C,CACnD,CAAC;AAEF,eAAO,MAAM,0CAA0C;;kBAE5C,CAAC;AACZ,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,0CAA0C,CAClD,CAAC;AAEF,eAAO,MAAM,2CAA2C;;;kBAE7C,CAAC;AACZ,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,2CAA2C,CACnD,CAAC;AAEF,eAAO,MAAM,+CAA+C;;kBAEjD,CAAC;AACZ,MAAM,MAAM,yCAAyC,GAAG,CAAC,CAAC,KAAK,CAC7D,OAAO,+CAA+C,CACvD,CAAC"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
// Callable contracts for hardware loan contracts: an admin creates a loan for a referee, the referee
|
|
2
|
-
// signs the agreement, an admin records the equipment returned or deletes a contract never signed,
|
|
3
|
-
// and the signature is read back through a callable — never by URL.
|
|
4
1
|
import { z } from 'zod';
|
|
5
2
|
import { HARDWARE_CATALOG, HARDWARE_CATALOG_ITEM_IDS } from '../constants/business.js';
|
|
6
3
|
import { epochMsSchema, hardwareLoanContractIdSchema, userIdSchema } from '../doc-schemas/atoms.js';
|
|
7
4
|
import { stagingUploadPathSchema } from './uploads.js';
|
|
8
5
|
export const hardwareCatalogItemIdSchema = z.enum(HARDWARE_CATALOG_ITEM_IDS);
|
|
9
|
-
// The referee must be on the referee roster; each item is a catalog item, named once.
|
|
10
6
|
export const AdminCreateHardwareLoanContractInputSchema = z
|
|
11
7
|
.object({
|
|
12
8
|
refereeUserId: userIdSchema,
|
|
@@ -20,12 +16,9 @@ export const AdminCreateHardwareLoanContractInputSchema = z
|
|
|
20
16
|
export const AdminCreateHardwareLoanContractResultSchema = z
|
|
21
17
|
.object({ contractId: hardwareLoanContractIdSchema })
|
|
22
18
|
.strict();
|
|
23
|
-
// The contract's referee signs it: the drawn PNG staged at their own staging path. The signer is the
|
|
24
|
-
// caller — never named in the payload.
|
|
25
19
|
export const SubmitHardwareLoanContractSignatureInputSchema = z
|
|
26
20
|
.object({ contractId: hardwareLoanContractIdSchema, storagePath: stagingUploadPathSchema })
|
|
27
21
|
.strict();
|
|
28
|
-
// `alreadySigned` when this very signing was recorded before: a retry, answered without copying again.
|
|
29
22
|
export const SubmitHardwareLoanContractSignatureResultSchema = z
|
|
30
23
|
.object({
|
|
31
24
|
contractId: hardwareLoanContractIdSchema,
|
|
@@ -33,11 +26,9 @@ export const SubmitHardwareLoanContractSignatureResultSchema = z
|
|
|
33
26
|
alreadySigned: z.boolean(),
|
|
34
27
|
})
|
|
35
28
|
.strict();
|
|
36
|
-
// An admin records a loaned contract's equipment back. The signature is kept.
|
|
37
29
|
export const AdminReturnHardwareLoanContractInputSchema = z
|
|
38
30
|
.object({ contractId: hardwareLoanContractIdSchema })
|
|
39
31
|
.strict();
|
|
40
|
-
// `changed` is false when the contract was already returned: nothing was written.
|
|
41
32
|
export const AdminReturnHardwareLoanContractResultSchema = z
|
|
42
33
|
.object({
|
|
43
34
|
contractId: hardwareLoanContractIdSchema,
|
|
@@ -45,16 +36,12 @@ export const AdminReturnHardwareLoanContractResultSchema = z
|
|
|
45
36
|
changed: z.boolean(),
|
|
46
37
|
})
|
|
47
38
|
.strict();
|
|
48
|
-
// An admin deletes a contract the referee has not signed. A signed contract is a legal record and is
|
|
49
|
-
// never deleted.
|
|
50
39
|
export const AdminDeleteHardwareLoanContractInputSchema = z
|
|
51
40
|
.object({ contractId: hardwareLoanContractIdSchema })
|
|
52
41
|
.strict();
|
|
53
42
|
export const AdminDeleteHardwareLoanContractResultSchema = z
|
|
54
43
|
.object({ contractId: hardwareLoanContractIdSchema, deleted: z.boolean() })
|
|
55
44
|
.strict();
|
|
56
|
-
// A contract's signature, read by its referee (the member entry) or an admin (the admin entry). The
|
|
57
|
-
// answer is `SignatureFileResultSchema`, as a waiver's is.
|
|
58
45
|
export const GetHardwareLoanContractSignatureFileInputSchema = z
|
|
59
46
|
.object({ contractId: hardwareLoanContractIdSchema })
|
|
60
47
|
.strict();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hardware-loan-contracts.js","sourceRoot":"","sources":["../../src/schemas/hardware-loan-contracts.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"hardware-loan-contracts.js","sourceRoot":"","sources":["../../src/schemas/hardware-loan-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACpG,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;AAE7E,MAAM,CAAC,MAAM,0CAA0C,GAAG,CAAC;KACxD,MAAM,CAAC;IACN,aAAa,EAAE,YAAY;IAC3B,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,MAAM,CAAC;CAC1F,CAAC;KACD,MAAM,EAAE;KACR,MAAM,CAAC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EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;KAC1E,MAAM,EAAE,CAAC;AAKZ,MAAM,CAAC,MAAM,+CAA+C,GAAG,CAAC;KAC7D,MAAM,CAAC,EAAE,UAAU,EAAE,4BAA4B,EAAE,CAAC;KACpD,MAAM,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport { HARDWARE_CATALOG, HARDWARE_CATALOG_ITEM_IDS } from '../constants/business.js';\nimport { epochMsSchema, hardwareLoanContractIdSchema, userIdSchema } from '../doc-schemas/atoms.js';\nimport { stagingUploadPathSchema } from './uploads.js';\n\nexport const hardwareCatalogItemIdSchema = z.enum(HARDWARE_CATALOG_ITEM_IDS);\n\nexport const AdminCreateHardwareLoanContractInputSchema = z\n .object({\n refereeUserId: userIdSchema,\n hardwareItemIds: z.array(hardwareCatalogItemIdSchema).min(1).max(HARDWARE_CATALOG.length),\n })\n .strict()\n .refine((input) => new Set(input.hardwareItemIds).size === input.hardwareItemIds.length, {\n message: 'Name each item once.',\n path: ['hardwareItemIds'],\n });\nexport type AdminCreateHardwareLoanContractInput = z.infer<\n typeof AdminCreateHardwareLoanContractInputSchema\n>;\n\nexport const AdminCreateHardwareLoanContractResultSchema = z\n .object({ contractId: hardwareLoanContractIdSchema })\n .strict();\nexport type AdminCreateHardwareLoanContractResult = z.infer<\n typeof AdminCreateHardwareLoanContractResultSchema\n>;\n\nexport const SubmitHardwareLoanContractSignatureInputSchema = z\n .object({ contractId: hardwareLoanContractIdSchema, storagePath: stagingUploadPathSchema })\n .strict();\nexport type SubmitHardwareLoanContractSignatureInput = z.infer<\n typeof SubmitHardwareLoanContractSignatureInputSchema\n>;\n\nexport const SubmitHardwareLoanContractSignatureResultSchema = z\n .object({\n contractId: hardwareLoanContractIdSchema,\n loanedAt: epochMsSchema,\n alreadySigned: z.boolean(),\n })\n .strict();\nexport type SubmitHardwareLoanContractSignatureResult = z.infer<\n typeof SubmitHardwareLoanContractSignatureResultSchema\n>;\n\nexport const AdminReturnHardwareLoanContractInputSchema = z\n .object({ contractId: hardwareLoanContractIdSchema })\n .strict();\nexport type AdminReturnHardwareLoanContractInput = z.infer<\n typeof AdminReturnHardwareLoanContractInputSchema\n>;\n\nexport const AdminReturnHardwareLoanContractResultSchema = z\n .object({\n contractId: hardwareLoanContractIdSchema,\n returnedAt: epochMsSchema,\n changed: z.boolean(),\n })\n .strict();\nexport type AdminReturnHardwareLoanContractResult = z.infer<\n typeof AdminReturnHardwareLoanContractResultSchema\n>;\n\nexport const AdminDeleteHardwareLoanContractInputSchema = z\n .object({ contractId: hardwareLoanContractIdSchema })\n .strict();\nexport type AdminDeleteHardwareLoanContractInput = z.infer<\n typeof AdminDeleteHardwareLoanContractInputSchema\n>;\n\nexport const AdminDeleteHardwareLoanContractResultSchema = z\n .object({ contractId: hardwareLoanContractIdSchema, deleted: z.boolean() })\n .strict();\nexport type AdminDeleteHardwareLoanContractResult = z.infer<\n typeof AdminDeleteHardwareLoanContractResultSchema\n>;\n\nexport const GetHardwareLoanContractSignatureFileInputSchema = z\n .object({ contractId: hardwareLoanContractIdSchema })\n .strict();\nexport type GetHardwareLoanContractSignatureFileInput = z.infer<\n typeof GetHardwareLoanContractSignatureFileInputSchema\n>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Callable wire contracts — inputs and results. Subpath-only: not re-exported from the root barrel.
|
|
2
|
-
// A step that adds or converts a callable adds its `<Verb><Noun>InputSchema` / `ResultSchema` here.
|
|
3
1
|
export * from './atoms.js';
|
|
4
2
|
export * from './awards.js';
|
|
5
3
|
export * from './hardware-loan-contracts.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC","sourcesContent":["export * from './atoms.js';\nexport * from './awards.js';\nexport * from './hardware-loan-contracts.js';\nexport * from './account-settings.js';\nexport * from './admin-notifications.js';\nexport * from './admin-stats.js';\nexport * from './dead-letters.js';\nexport * from './app-config.js';\nexport * from './game-locations.js';\nexport * from './leagues.js';\nexport * from './pictures.js';\nexport * from './schedules.js';\nexport * from './scoring.js';\nexport * from './signed-waivers.js';\nexport * from './stats.js';\nexport * from './team-joining.js';\nexport * from './teams.js';\nexport * from './uploads.js';\nexport * from './users.js';\nexport * from './waiver-templates.js';\nexport * from './migration-console.js';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leagues.d.ts","sourceRoot":"","sources":["../../src/schemas/leagues.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"leagues.d.ts","sourceRoot":"","sources":["../../src/schemas/leagues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,eAAO,MAAM,iBAAiB,wDAA6C,CAAC;AAC5E,eAAO,MAAM,uBAAuB,wDAAmD,CAAC;AACxF,eAAO,MAAM,mBAAmB,aAAmD,CAAC;AAEpF,eAAO,MAAM,0BAA0B,6KAU7B,CAAC;AACX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9E,eAAO,MAAM,yBAAyB;;;;;;;;;;EAAqC,CAAC;AAE5E,eAAO,MAAM,yBAAyB,qEAIa,CAAC;AACpD,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAgB5E,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;kBAGV,CAAC;AACrC,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,eAAO,MAAM,kCAAkC;;kBAAkD,CAAC;AAClG,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,eAAO,MAAM,iCAAiC;;;;;;;;;;;;kBAGV,CAAC;AACrC,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;kBAMpC,CAAC;AACZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,eAAO,MAAM,uCAAuC;;;;;;;;kBAEzC,CAAC;AACZ,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,uCAAuC,CAC/C,CAAC;AAIF,eAAO,MAAM,wCAAwC;;;;;;;;;;kBAE1C,CAAC;AACZ,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,wCAAwC,CAChD,CAAC;AAEF,eAAO,MAAM,2BAA2B;;;;;;kBAE7B,CAAC;AACZ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,eAAO,MAAM,4BAA4B;;;;;;;;;kBAO9B,CAAC;AACZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
|
package/dist/schemas/leagues.js
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
// Callable contracts for the league: creation, the settings edit, the status move, and the mode
|
|
2
|
-
// switch. Every one is admin authority, and the acting admin is `request.auth.uid` — never an input
|
|
3
|
-
// field (RULE-STD-ARCH-106).
|
|
4
1
|
import { z } from 'zod';
|
|
5
2
|
import { MAX_PLAYOFF_CUTOFF } from '../constants/business.js';
|
|
6
3
|
import { LEAGUE_DESCRIPTION_INPUT_FORMAT, LEAGUE_TITLE_INPUT_FORMAT, } from '../input-formats/input-formats.js';
|
|
7
4
|
import { calendarDateSchema, textFieldSchema, countSchema, epochMsSchema, leagueIdSchema, leagueModeSchema, leagueStatusSchema, leagueTypeSchema, } from '../doc-schemas/atoms.js';
|
|
8
5
|
import { playoffCutoffCountSchema, refineLeagueSettings } from '../doc-schemas/sport-league.js';
|
|
9
6
|
import { waiverTemplateIdSchema } from '../doc-schemas/waiver-template.js';
|
|
10
|
-
// The title and description, each built from its field's one declaration, so the form and the wire
|
|
11
|
-
// run the same check.
|
|
12
7
|
export const leagueTitleSchema = textFieldSchema(LEAGUE_TITLE_INPUT_FORMAT);
|
|
13
8
|
export const leagueDescriptionSchema = textFieldSchema(LEAGUE_DESCRIPTION_INPUT_FORMAT);
|
|
14
9
|
export const playoffCutoffSchema = playoffCutoffCountSchema.max(MAX_PLAYOFF_CUTOFF);
|
|
15
|
-
// The settings an admin sets at creation and edits afterwards, in the order the update's result and
|
|
16
|
-
// audit event list them. Sport and mode are not settings: the sport is fixed at
|
|
17
|
-
// creation, and the mode changes only through the mode switch, which retypes the league's teams.
|
|
18
10
|
export const LEAGUE_SETTINGS_FIELD_KEYS = [
|
|
19
11
|
'leagueTitle',
|
|
20
12
|
'description',
|
|
@@ -27,8 +19,6 @@ export const LEAGUE_SETTINGS_FIELD_KEYS = [
|
|
|
27
19
|
'waiverTemplateId',
|
|
28
20
|
];
|
|
29
21
|
export const leagueSettingsFieldSchema = z.enum(LEAGUE_SETTINGS_FIELD_KEYS);
|
|
30
|
-
// The playoff cutoffs among the settings: a league whose mode sorts its teams by type shows the
|
|
31
|
-
// competitive and recreational pair, any other league the single cutoff.
|
|
32
22
|
export const PLAYOFF_CUTOFF_FIELD_KEYS = [
|
|
33
23
|
'playoffCutoff',
|
|
34
24
|
'playoffCutoffComp',
|
|
@@ -52,18 +42,10 @@ export const AdminCreateSportLeagueInputSchema = z
|
|
|
52
42
|
.strict()
|
|
53
43
|
.superRefine(refineLeagueSettings);
|
|
54
44
|
export const AdminCreateSportLeagueResultSchema = z.object({ leagueId: leagueIdSchema }).strict();
|
|
55
|
-
// The whole settings set, every time: the callable writes exactly these fields, and a waiver
|
|
56
|
-
// requirement turned off drops the template reference with it. `expectedUpdatedAt` is the league's
|
|
57
|
-
// `updatedAt` as the admin loaded it: a save that would change a league written since is refused,
|
|
58
|
-
// so a stale form never writes its old values over another admin's edit.
|
|
59
45
|
export const AdminUpdateSportLeagueInputSchema = z
|
|
60
46
|
.object({ leagueId: leagueIdSchema, expectedUpdatedAt: epochMsSchema, ...leagueSettingsShape })
|
|
61
47
|
.strict()
|
|
62
48
|
.superRefine(refineLeagueSettings);
|
|
63
|
-
// `changedFields` is empty when the settings already held every value sent. `updatedAt` is the
|
|
64
|
-
// league's `updatedAt` once the save is done — the value written, or the stored one when nothing
|
|
65
|
-
// changed — and the league it names holds exactly the settings sent, so it is the form's next
|
|
66
|
-
// `expectedUpdatedAt` and a second save from the same form is not refused as stale.
|
|
67
49
|
export const AdminUpdateSportLeagueResultSchema = z
|
|
68
50
|
.object({
|
|
69
51
|
leagueId: leagueIdSchema,
|
|
@@ -74,11 +56,6 @@ export const AdminUpdateSportLeagueResultSchema = z
|
|
|
74
56
|
export const AdminUpdateSportLeagueStatusInputSchema = z
|
|
75
57
|
.object({ leagueId: leagueIdSchema, status: leagueStatusSchema })
|
|
76
58
|
.strict();
|
|
77
|
-
// The league's `updatedAt` before and after a status move or a mode switch, equal when nothing moved.
|
|
78
|
-
// Neither changes a setting and neither checks the settings form, so a form advances its
|
|
79
|
-
// `expectedUpdatedAt` to `updatedAt` only when it was loaded at `previousUpdatedAt`. A form loaded
|
|
80
|
-
// at any other value was already stale, and advancing it would let its old values overwrite the
|
|
81
|
-
// edit that made it stale.
|
|
82
59
|
const leagueUpdatedAtMoveShape = { previousUpdatedAt: epochMsSchema, updatedAt: epochMsSchema };
|
|
83
60
|
export const AdminUpdateSportLeagueStatusResultSchema = z
|
|
84
61
|
.object({ leagueId: leagueIdSchema, status: leagueStatusSchema, ...leagueUpdatedAtMoveShape })
|
|
@@ -86,7 +63,6 @@ export const AdminUpdateSportLeagueStatusResultSchema = z
|
|
|
86
63
|
export const SwitchLeagueModeInputSchema = z
|
|
87
64
|
.object({ leagueId: leagueIdSchema, newMode: leagueModeSchema })
|
|
88
65
|
.strict();
|
|
89
|
-
// `teamsUpdated` is 0 when the league was already in `newMode`: nothing is rewritten.
|
|
90
66
|
export const SwitchLeagueModeResultSchema = z
|
|
91
67
|
.object({
|
|
92
68
|
leagueId: leagueIdSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leagues.js","sourceRoot":"","sources":["../../src/schemas/leagues.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"leagues.js","sourceRoot":"","sources":["../../src/schemas/leagues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,GAC1B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAChG,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,yBAAyB,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC,+BAA+B,CAAC,CAAC;AACxF,MAAM,CAAC,MAAM,mBAAmB,GAAG,wBAAwB,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;AAEpF,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,aAAa;IACb,aAAa;IACb,iBAAiB;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E,cAAc;IACxB,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC;IACjD,SAAS,EAAE,aAAa;CACzB,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC;KACrD,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;KAChE,MAAM,EAAE,CAAC;AAKZ,MAAM,wBAAwB,GAAG,EAAE,iBAAiB,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;AAEhG,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC;KACtD,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,wBAAwB,EAAE,CAAC;KAC7F,MAAM,EAAE,CAAC;AAKZ,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC;KACzC,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;KAC/D,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC;KAC1C,MAAM,CAAC;IACN,QAAQ,EAAE,cAAc;IACxB,UAAU,EAAE,gBAAgB;IAC5B,YAAY,EAAE,WAAW;IACzB,GAAG,wBAAwB;CAC5B,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport { MAX_PLAYOFF_CUTOFF } from '../constants/business.js';\nimport {\n LEAGUE_DESCRIPTION_INPUT_FORMAT,\n LEAGUE_TITLE_INPUT_FORMAT,\n} from '../input-formats/input-formats.js';\nimport {\n calendarDateSchema,\n textFieldSchema,\n countSchema,\n epochMsSchema,\n leagueIdSchema,\n leagueModeSchema,\n leagueStatusSchema,\n leagueTypeSchema,\n} from '../doc-schemas/atoms.js';\nimport { playoffCutoffCountSchema, refineLeagueSettings } from '../doc-schemas/sport-league.js';\nimport { waiverTemplateIdSchema } from '../doc-schemas/waiver-template.js';\n\nexport const leagueTitleSchema = textFieldSchema(LEAGUE_TITLE_INPUT_FORMAT);\nexport const leagueDescriptionSchema = textFieldSchema(LEAGUE_DESCRIPTION_INPUT_FORMAT);\nexport const playoffCutoffSchema = playoffCutoffCountSchema.max(MAX_PLAYOFF_CUTOFF);\n\nexport const LEAGUE_SETTINGS_FIELD_KEYS = [\n 'leagueTitle',\n 'description',\n 'leagueStartDate',\n 'leagueEndDate',\n 'playoffCutoff',\n 'playoffCutoffComp',\n 'playoffCutoffRec',\n 'requiresWaiver',\n 'waiverTemplateId',\n] as const;\nexport type LeagueSettingsField = (typeof LEAGUE_SETTINGS_FIELD_KEYS)[number];\nexport const leagueSettingsFieldSchema = z.enum(LEAGUE_SETTINGS_FIELD_KEYS);\n\nexport const PLAYOFF_CUTOFF_FIELD_KEYS = [\n 'playoffCutoff',\n 'playoffCutoffComp',\n 'playoffCutoffRec',\n] as const satisfies readonly LeagueSettingsField[];\nexport type PlayoffCutoffField = (typeof PLAYOFF_CUTOFF_FIELD_KEYS)[number];\n\n// Every cutoff is sent whether or not the league's mode shows it, so a later mode switch finds the\n// other mode's cutoffs already set.\nconst leagueSettingsShape = {\n leagueTitle: leagueTitleSchema,\n description: leagueDescriptionSchema,\n leagueStartDate: calendarDateSchema,\n leagueEndDate: calendarDateSchema,\n playoffCutoff: playoffCutoffSchema,\n playoffCutoffComp: playoffCutoffSchema,\n playoffCutoffRec: playoffCutoffSchema,\n requiresWaiver: z.boolean(),\n waiverTemplateId: waiverTemplateIdSchema.optional(),\n} satisfies Record<LeagueSettingsField, z.ZodType>;\n\nexport const AdminCreateSportLeagueInputSchema = z\n .object({ ...leagueSettingsShape, leagueType: leagueTypeSchema, leagueMode: leagueModeSchema })\n .strict()\n .superRefine(refineLeagueSettings);\nexport type AdminCreateSportLeagueInput = z.infer<typeof AdminCreateSportLeagueInputSchema>;\nexport const AdminCreateSportLeagueResultSchema = z.object({ leagueId: leagueIdSchema }).strict();\nexport type AdminCreateSportLeagueResult = z.infer<typeof AdminCreateSportLeagueResultSchema>;\n\nexport const AdminUpdateSportLeagueInputSchema = z\n .object({ leagueId: leagueIdSchema, expectedUpdatedAt: epochMsSchema, ...leagueSettingsShape })\n .strict()\n .superRefine(refineLeagueSettings);\nexport type AdminUpdateSportLeagueInput = z.infer<typeof AdminUpdateSportLeagueInputSchema>;\nexport const AdminUpdateSportLeagueResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n changedFields: z.array(leagueSettingsFieldSchema),\n updatedAt: epochMsSchema,\n })\n .strict();\nexport type AdminUpdateSportLeagueResult = z.infer<typeof AdminUpdateSportLeagueResultSchema>;\n\nexport const AdminUpdateSportLeagueStatusInputSchema = z\n .object({ leagueId: leagueIdSchema, status: leagueStatusSchema })\n .strict();\nexport type AdminUpdateSportLeagueStatusInput = z.infer<\n typeof AdminUpdateSportLeagueStatusInputSchema\n>;\n\nconst leagueUpdatedAtMoveShape = { previousUpdatedAt: epochMsSchema, updatedAt: epochMsSchema };\n\nexport const AdminUpdateSportLeagueStatusResultSchema = z\n .object({ leagueId: leagueIdSchema, status: leagueStatusSchema, ...leagueUpdatedAtMoveShape })\n .strict();\nexport type AdminUpdateSportLeagueStatusResult = z.infer<\n typeof AdminUpdateSportLeagueStatusResultSchema\n>;\n\nexport const SwitchLeagueModeInputSchema = z\n .object({ leagueId: leagueIdSchema, newMode: leagueModeSchema })\n .strict();\nexport type SwitchLeagueModeInput = z.infer<typeof SwitchLeagueModeInputSchema>;\nexport const SwitchLeagueModeResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n leagueMode: leagueModeSchema,\n teamsUpdated: countSchema,\n ...leagueUpdatedAtMoveShape,\n })\n .strict();\nexport type SwitchLeagueModeResult = z.infer<typeof SwitchLeagueModeResultSchema>;\n"]}
|