@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"league-join-warning.js","sourceRoot":"","sources":["../../src/utils/league-join-warning.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,gGAAgG;AAChG,sFAAsF;AACtF,EAAE;AACF,mGAAmG;AACnG,8EAA8E;AAC9E,kGAAkG;AAClG,gGAAgG;AAChG,sHAAsH;AACtH,0EAA0E;AAE1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEtF,kDAAkD;AAClD,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,QAAQ;IACR,oBAAoB;IACpB,mBAAmB;IACnB,iBAAiB;CACT,CAAC;AAGX,iGAAiG;AACjG,8BAA8B;AAC9B,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;CACT,CAAC;AAGX,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACzE,CAAC;SACE,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAuD,CAAC;QACxE,gBAAgB,EAAE,sBAAsB;KACzC,CAAC;SACD,MAAM,EAAE;IACX,CAAC;SACE,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAwD,CAAC;QACzE,iBAAiB,EAAE,uBAAuB;KAC3C,CAAC;SACD,MAAM,EAAE;IACX,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,O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AU;KACT;CACvE,CAAC;AAQX;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAMvC;IACC,MAAM,WAAW,GAAG,yCAAyC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QAC1C,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC1E,IAAI,WAAW,KAAK,MAAM,EAAE,CAAC;YAC3B,OAAO,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;QAC5D,CAAC;QACD,OAAO,wBAAwB,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,wBAAwB,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;AAClG,CAAC","sourcesContent":["// The join warning: before anyone puts a person on a team in a league, or starts\n// their way onto one, they see every place that person already stands there. It warns and never\n// blocks — confirm proceeds, cancel does nothing, and no server check refuses for it.\n//\n// One decision serves every door: `computeLeagueJoinWarning` is the whole rule, and the one reader\n// of the person's standing is the server core behind `getLeagueJoinWarning` /\n// `adminGetLeagueJoinWarning`, because another person's pending requests, invitations, and signup\n// are not readable from the client. What the dialog says is `LEAGUE_JOIN_WARNING_COPY`, through\n// `formatLeagueJoinWarning` (RULE-STD-ARCH-102, RULE-STD-ENG-005). The acted-on item and a finding cross the wire, so\n// each is declared once, as its schema, and its type is inferred from it.\n\nimport { z } from 'zod';\nimport { teamIdSchema } from '../doc-schemas/atoms.js';\nimport { teamInvitationIdSchema, teamJoinRequestIdSchema } from '../schemas/atoms.js';\n\n// The four places a person can stand in a league.\nexport const LEAGUE_JOIN_WARNING_STATE_KEYS = [\n 'onTeam',\n 'pendingJoinRequest',\n 'pendingInvitation',\n 'freeAgentSignup',\n] as const;\nexport type LeagueJoinWarningState = (typeof LEAGUE_JOIN_WARNING_STATE_KEYS)[number];\n\n// The item a door acts on, which the warning never names: accepting a team's invitation does not\n// warn about that invitation.\nexport const LEAGUE_JOIN_WARNING_ACTED_ON_KEYS = [\n 'teamInvitation',\n 'teamJoinRequest',\n 'leagueFreeAgent',\n] as const;\nexport type LeagueJoinWarningActedOnKind = (typeof LEAGUE_JOIN_WARNING_ACTED_ON_KEYS)[number];\n\nexport const leagueJoinWarningActedOnSchema = z.discriminatedUnion('kind', [\n z\n .object({\n kind: z.literal('teamInvitation' satisfies LeagueJoinWarningActedOnKind),\n teamInvitationId: teamInvitationIdSchema,\n })\n .strict(),\n z\n .object({\n kind: z.literal('teamJoinRequest' satisfies LeagueJoinWarningActedOnKind),\n teamJoinRequestId: teamJoinRequestIdSchema,\n })\n .strict(),\n z.object({ kind: z.literal('leagueFreeAgent' satisfies LeagueJoinWarningActedOnKind) }).strict(),\n]);\nexport type LeagueJoinWarningActedOn = z.infer<typeof leagueJoinWarningActedOnSchema>;\n\n// Every door that shows the warning. Each is phrased either for the person acting on their own\n// behalf or for someone acting on them.\nexport const LEAGUE_JOIN_WARNING_ACTION_KEYS = [\n 'createTeam',\n 'acceptInvitation',\n 'sendJoinRequest',\n 'signUpAsFreeAgent',\n 'sendInvitation',\n 'acceptJoinRequest',\n 'assignFreeAgent',\n 'closedLeagueLink',\n] as const;\nexport type LeagueJoinWarningAction = (typeof LEAGUE_JOIN_WARNING_ACTION_KEYS)[number];\n\nexport const LEAGUE_JOIN_WARNING_PERSPECTIVE_KEYS = ['self', 'other'] as const;\nexport type LeagueJoinWarningPerspective = (typeof LEAGUE_JOIN_WARNING_PERSPECTIVE_KEYS)[number];\n\nexport const LEAGUE_JOIN_WARNING_PERSPECTIVE_BY_ACTION: Readonly<\n Record<LeagueJoinWarningAction, LeagueJoinWarningPerspective>\n> = {\n createTeam: 'self',\n acceptInvitation: 'self',\n sendJoinRequest: 'self',\n signUpAsFreeAgent: 'self',\n sendInvitation: 'other',\n acceptJoinRequest: 'other',\n assignFreeAgent: 'other',\n closedLeagueLink: 'other',\n};\n\n/** Where the person stands in the league, as the server read it. */\nexport interface LeagueJoinWarningFacts {\n memberships: readonly { teamId: string }[];\n pendingJoinRequests: readonly { teamJoinRequestId: string; teamId: string }[];\n pendingInvitations: readonly { teamInvitationId: string; teamId: string }[];\n freeAgentSignup: boolean;\n}\n\n// One place the person stands. `teamId` is null only for a free-agent signup.\nexport const leagueJoinWarningFindingSchema = z\n .object({ state: z.enum(LEAGUE_JOIN_WARNING_STATE_KEYS), teamId: teamIdSchema.nullable() })\n .strict();\nexport type LeagueJoinWarningFinding = z.infer<typeof leagueJoinWarningFindingSchema>;\n\n/**\n * Every place the person stands in the league, the acted-on item left out, in state order and then\n * team order. An empty result means no warning is shown.\n */\nexport function computeLeagueJoinWarning(\n facts: LeagueJoinWarningFacts,\n actedOn: LeagueJoinWarningActedOn | null,\n): LeagueJoinWarningFinding[] {\n const byTeam = (left: LeagueJoinWarningFinding, right: LeagueJoinWarningFinding) =>\n (left.teamId ?? '').localeCompare(right.teamId ?? '');\n\n const onTeam = facts.memberships.map((membership) => ({\n state: 'onTeam' as const,\n teamId: membership.teamId,\n }));\n const pendingJoinRequest = facts.pendingJoinRequests\n .filter(\n (request) =>\n !(\n actedOn?.kind === 'teamJoinRequest' &&\n actedOn.teamJoinRequestId === request.teamJoinRequestId\n ),\n )\n .map((request) => ({ state: 'pendingJoinRequest' as const, teamId: request.teamId }));\n const pendingInvitation = facts.pendingInvitations\n .filter(\n (invitation) =>\n !(\n actedOn?.kind === 'teamInvitation' &&\n actedOn.teamInvitationId === invitation.teamInvitationId\n ),\n )\n .map((invitation) => ({ state: 'pendingInvitation' as const, teamId: invitation.teamId }));\n const freeAgentSignup: LeagueJoinWarningFinding[] =\n facts.freeAgentSignup && actedOn?.kind !== 'leagueFreeAgent'\n ? [{ state: 'freeAgentSignup', teamId: null }]\n : [];\n\n return [\n ...onTeam.sort(byTeam),\n ...pendingJoinRequest.sort(byTeam),\n ...pendingInvitation.sort(byTeam),\n ...freeAgentSignup,\n ];\n}\n\nexport const LEAGUE_JOIN_WARNING_COPY = {\n title: 'Already in this league',\n confirmLabel: 'Continue',\n cancelLabel: 'Cancel',\n // What the person acting on their own behalf is told, per state found.\n self: {\n onTeam: (teamName: string) => `You are already on ${teamName}.`,\n pendingJoinRequest: (teamName: string) => `You have a request waiting with ${teamName}.`,\n pendingInvitation: (teamName: string) => `You have an invitation waiting from ${teamName}.`,\n freeAgentSignup: () => 'You are signed up as a free agent in this league.',\n },\n // What someone acting on the person is told, per state found.\n other: {\n onTeam: (personName: string, teamName: string) => `${personName} is already on ${teamName}.`,\n pendingJoinRequest: (personName: string, teamName: string) =>\n `${personName} has asked to join ${teamName}.`,\n pendingInvitation: (personName: string, teamName: string) =>\n `${personName} has an invitation waiting from ${teamName}.`,\n freeAgentSignup: (personName: string) =>\n `${personName} is signed up as a free agent in this league.`,\n },\n // The closing question, per door. `targetTeamName` is ignored by the doors that have no team.\n question: {\n createTeam: () => 'Do you still want to create a new team?',\n acceptInvitation: (targetTeamName: string) => `Do you still want to join ${targetTeamName}?`,\n sendJoinRequest: (targetTeamName: string) =>\n `Do you still want to ask to join ${targetTeamName}?`,\n signUpAsFreeAgent: () => 'Do you still want to sign up as a free agent?',\n sendInvitation: (targetTeamName: string) => `Invite them to ${targetTeamName} anyway?`,\n acceptJoinRequest: (targetTeamName: string) => `Accept them onto ${targetTeamName} anyway?`,\n assignFreeAgent: (targetTeamName: string) => `Assign them to ${targetTeamName} anyway?`,\n closedLeagueLink: (targetTeamName: string) => `Link them to ${targetTeamName} anyway?`,\n } satisfies Record<LeagueJoinWarningAction, (targetTeamName: string) => string>,\n} as const;\n\nexport interface LeagueJoinWarningText {\n /** One sentence per finding, in the findings' order. */\n lines: string[];\n question: string;\n}\n\n/**\n * The dialog's words for a warning. `teamName` resolves a finding's team id to its display name;\n * `personName` names the person for a door acting on someone else. Empty findings are no warning,\n * and a caller shows no dialog for them.\n */\nexport function formatLeagueJoinWarning(args: {\n action: LeagueJoinWarningAction;\n findings: readonly LeagueJoinWarningFinding[];\n teamName: (teamId: string) => string;\n personName: string;\n targetTeamName: string;\n}): LeagueJoinWarningText {\n const perspective = LEAGUE_JOIN_WARNING_PERSPECTIVE_BY_ACTION[args.action];\n const lines = args.findings.map((finding) => {\n const team = finding.teamId === null ? '' : args.teamName(finding.teamId);\n if (perspective === 'self') {\n return LEAGUE_JOIN_WARNING_COPY.self[finding.state](team);\n }\n return LEAGUE_JOIN_WARNING_COPY.other[finding.state](args.personName, team);\n });\n return { lines, question: LEAGUE_JOIN_WARNING_COPY.question[args.action](args.targetTeamName) };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"league-join-warning.js","sourceRoot":"","sources":["../../src/utils/league-join-warning.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEtF,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,QAAQ;IACR,oBAAoB;IACpB,mBAAmB;IACnB,iBAAiB;CACT,CAAC;AAGX,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;CACT,CAAC;AAGX,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACzE,CAAC;SACE,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,OAAO,CA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EAAE,CAAC,oBAAoB,cAAc,UAAU;QAC3F,eAAe,EAAE,CAAC,cAAsB,EAAE,EAAE,CAAC,kBAAkB,cAAc,UAAU;QACvF,gBAAgB,EAAE,CAAC,cAAsB,EAAE,EAAE,CAAC,gBAAgB,cAAc,UAAU;KACT;CACvE,CAAC;AAOX,MAAM,UAAU,uBAAuB,CAAC,IAMvC;IACC,MAAM,WAAW,GAAG,yCAAyC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QAC1C,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC1E,IAAI,WAAW,KAAK,MAAM,EAAE,CAAC;YAC3B,OAAO,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;QAC5D,CAAC;QACD,OAAO,wBAAwB,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,wBAAwB,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;AAClG,CAAC","sourcesContent":["import { z } from 'zod';\nimport { teamIdSchema } from '../doc-schemas/atoms.js';\nimport { teamInvitationIdSchema, teamJoinRequestIdSchema } from '../schemas/atoms.js';\n\nexport const LEAGUE_JOIN_WARNING_STATE_KEYS = [\n 'onTeam',\n 'pendingJoinRequest',\n 'pendingInvitation',\n 'freeAgentSignup',\n] as const;\nexport type LeagueJoinWarningState = (typeof LEAGUE_JOIN_WARNING_STATE_KEYS)[number];\n\nexport const LEAGUE_JOIN_WARNING_ACTED_ON_KEYS = [\n 'teamInvitation',\n 'teamJoinRequest',\n 'leagueFreeAgent',\n] as const;\nexport type LeagueJoinWarningActedOnKind = (typeof LEAGUE_JOIN_WARNING_ACTED_ON_KEYS)[number];\n\nexport const leagueJoinWarningActedOnSchema = z.discriminatedUnion('kind', [\n z\n .object({\n kind: z.literal('teamInvitation' satisfies LeagueJoinWarningActedOnKind),\n teamInvitationId: teamInvitationIdSchema,\n })\n .strict(),\n z\n .object({\n kind: z.literal('teamJoinRequest' satisfies LeagueJoinWarningActedOnKind),\n teamJoinRequestId: teamJoinRequestIdSchema,\n })\n .strict(),\n z.object({ kind: z.literal('leagueFreeAgent' satisfies LeagueJoinWarningActedOnKind) }).strict(),\n]);\nexport type LeagueJoinWarningActedOn = z.infer<typeof leagueJoinWarningActedOnSchema>;\n\nexport const LEAGUE_JOIN_WARNING_ACTION_KEYS = [\n 'createTeam',\n 'acceptInvitation',\n 'sendJoinRequest',\n 'signUpAsFreeAgent',\n 'sendInvitation',\n 'acceptJoinRequest',\n 'assignFreeAgent',\n 'closedLeagueLink',\n] as const;\nexport type LeagueJoinWarningAction = (typeof LEAGUE_JOIN_WARNING_ACTION_KEYS)[number];\n\nexport const LEAGUE_JOIN_WARNING_PERSPECTIVE_KEYS = ['self', 'other'] as const;\nexport type LeagueJoinWarningPerspective = (typeof LEAGUE_JOIN_WARNING_PERSPECTIVE_KEYS)[number];\n\nexport const LEAGUE_JOIN_WARNING_PERSPECTIVE_BY_ACTION: Readonly<\n Record<LeagueJoinWarningAction, LeagueJoinWarningPerspective>\n> = {\n createTeam: 'self',\n acceptInvitation: 'self',\n sendJoinRequest: 'self',\n signUpAsFreeAgent: 'self',\n sendInvitation: 'other',\n acceptJoinRequest: 'other',\n assignFreeAgent: 'other',\n closedLeagueLink: 'other',\n};\n\nexport interface LeagueJoinWarningFacts {\n memberships: readonly { teamId: string }[];\n pendingJoinRequests: readonly { teamJoinRequestId: string; teamId: string }[];\n pendingInvitations: readonly { teamInvitationId: string; teamId: string }[];\n freeAgentSignup: boolean;\n}\n\nexport const leagueJoinWarningFindingSchema = z\n .object({ state: z.enum(LEAGUE_JOIN_WARNING_STATE_KEYS), teamId: teamIdSchema.nullable() })\n .strict();\nexport type LeagueJoinWarningFinding = z.infer<typeof leagueJoinWarningFindingSchema>;\n\nexport function computeLeagueJoinWarning(\n facts: LeagueJoinWarningFacts,\n actedOn: LeagueJoinWarningActedOn | null,\n): LeagueJoinWarningFinding[] {\n const byTeam = (left: LeagueJoinWarningFinding, right: LeagueJoinWarningFinding) =>\n (left.teamId ?? '').localeCompare(right.teamId ?? '');\n\n const onTeam = facts.memberships.map((membership) => ({\n state: 'onTeam' as const,\n teamId: membership.teamId,\n }));\n const pendingJoinRequest = facts.pendingJoinRequests\n .filter(\n (request) =>\n !(\n actedOn?.kind === 'teamJoinRequest' &&\n actedOn.teamJoinRequestId === request.teamJoinRequestId\n ),\n )\n .map((request) => ({ state: 'pendingJoinRequest' as const, teamId: request.teamId }));\n const pendingInvitation = facts.pendingInvitations\n .filter(\n (invitation) =>\n !(\n actedOn?.kind === 'teamInvitation' &&\n actedOn.teamInvitationId === invitation.teamInvitationId\n ),\n )\n .map((invitation) => ({ state: 'pendingInvitation' as const, teamId: invitation.teamId }));\n const freeAgentSignup: LeagueJoinWarningFinding[] =\n facts.freeAgentSignup && actedOn?.kind !== 'leagueFreeAgent'\n ? [{ state: 'freeAgentSignup', teamId: null }]\n : [];\n\n return [\n ...onTeam.sort(byTeam),\n ...pendingJoinRequest.sort(byTeam),\n ...pendingInvitation.sort(byTeam),\n ...freeAgentSignup,\n ];\n}\n\nexport const LEAGUE_JOIN_WARNING_COPY = {\n title: 'Already in this league',\n confirmLabel: 'Continue',\n cancelLabel: 'Cancel',\n self: {\n onTeam: (teamName: string) => `You are already on ${teamName}.`,\n pendingJoinRequest: (teamName: string) => `You have a request waiting with ${teamName}.`,\n pendingInvitation: (teamName: string) => `You have an invitation waiting from ${teamName}.`,\n freeAgentSignup: () => 'You are signed up as a free agent in this league.',\n },\n other: {\n onTeam: (personName: string, teamName: string) => `${personName} is already on ${teamName}.`,\n pendingJoinRequest: (personName: string, teamName: string) =>\n `${personName} has asked to join ${teamName}.`,\n pendingInvitation: (personName: string, teamName: string) =>\n `${personName} has an invitation waiting from ${teamName}.`,\n freeAgentSignup: (personName: string) =>\n `${personName} is signed up as a free agent in this league.`,\n },\n question: {\n createTeam: () => 'Do you still want to create a new team?',\n acceptInvitation: (targetTeamName: string) => `Do you still want to join ${targetTeamName}?`,\n sendJoinRequest: (targetTeamName: string) =>\n `Do you still want to ask to join ${targetTeamName}?`,\n signUpAsFreeAgent: () => 'Do you still want to sign up as a free agent?',\n sendInvitation: (targetTeamName: string) => `Invite them to ${targetTeamName} anyway?`,\n acceptJoinRequest: (targetTeamName: string) => `Accept them onto ${targetTeamName} anyway?`,\n assignFreeAgent: (targetTeamName: string) => `Assign them to ${targetTeamName} anyway?`,\n closedLeagueLink: (targetTeamName: string) => `Link them to ${targetTeamName} anyway?`,\n } satisfies Record<LeagueJoinWarningAction, (targetTeamName: string) => string>,\n} as const;\n\nexport interface LeagueJoinWarningText {\n lines: string[];\n question: string;\n}\n\nexport function formatLeagueJoinWarning(args: {\n action: LeagueJoinWarningAction;\n findings: readonly LeagueJoinWarningFinding[];\n teamName: (teamId: string) => string;\n personName: string;\n targetTeamName: string;\n}): LeagueJoinWarningText {\n const perspective = LEAGUE_JOIN_WARNING_PERSPECTIVE_BY_ACTION[args.action];\n const lines = args.findings.map((finding) => {\n const team = finding.teamId === null ? '' : args.teamName(finding.teamId);\n if (perspective === 'self') {\n return LEAGUE_JOIN_WARNING_COPY.self[finding.state](team);\n }\n return LEAGUE_JOIN_WARNING_COPY.other[finding.state](args.personName, team);\n });\n return { lines, question: LEAGUE_JOIN_WARNING_COPY.question[args.action](args.targetTeamName) };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"league-joining.d.ts","sourceRoot":"","sources":["../../src/utils/league-joining.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"league-joining.d.ts","sourceRoot":"","sources":["../../src/utils/league-joining.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAEnE"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
// Whether a league takes new members. A closed league's season is over and `closed` is final, so no
|
|
2
|
-
// door puts a person on one of its teams: sending or accepting an invitation, sending or accepting a
|
|
3
|
-
// join request, free-agent signup, and the admin's free-agent placement each refuse it, reading the
|
|
4
|
-
// league inside their transaction, and the UI does not offer them there (RULE-STD-FRONTEND-110). The one way
|
|
5
|
-
// onto a closed league's team is the admin's closed-league ghost link. An admin still creates teams
|
|
6
|
-
// and edits the schedule on a closed league, to repair a past season.
|
|
7
1
|
import { CLOSED_LEAGUE_STATUS } from '../types/unions.js';
|
|
8
|
-
/** Whether a league in `status` takes new members: every status but `closed`. */
|
|
9
2
|
export function leagueTakesNewMembers(status) {
|
|
10
3
|
return status !== CLOSED_LEAGUE_STATUS;
|
|
11
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"league-joining.js","sourceRoot":"","sources":["../../src/utils/league-joining.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"league-joining.js","sourceRoot":"","sources":["../../src/utils/league-joining.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG1D,MAAM,UAAU,qBAAqB,CAAC,MAAoB;IACxD,OAAO,MAAM,KAAK,oBAAoB,CAAC;AACzC,CAAC","sourcesContent":["import { CLOSED_LEAGUE_STATUS } from '../types/unions.js';\nimport type { LeagueStatus } from '../types/unions.js';\n\nexport function leagueTakesNewMembers(status: LeagueStatus): boolean {\n return status !== CLOSED_LEAGUE_STATUS;\n}\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { type LeagueMode } from '../types/unions.js';
|
|
2
|
-
/** Whether a league in `mode` sorts its teams by type, so each team carries a `teamType`. */
|
|
3
2
|
export declare function leagueModeSortsTeamsByType(mode: LeagueMode): boolean;
|
|
4
3
|
//# sourceMappingURL=league-mode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"league-mode.d.ts","sourceRoot":"","sources":["../../src/utils/league-mode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"league-mode.d.ts","sourceRoot":"","sources":["../../src/utils/league-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE7E,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAEpE"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
// Whether a league sorts its teams by type. It is the one reading every surface makes — the team
|
|
2
|
-
// form's required type, the type control, the standings and rankings split into pools, the team list
|
|
3
|
-
// grouped by type, and the admin's mode copy — so no reader compares the mode on its own (RULE-STD-ENG-005).
|
|
4
1
|
import { TEAM_TYPED_LEAGUE_MODE } from '../types/unions.js';
|
|
5
|
-
/** Whether a league in `mode` sorts its teams by type, so each team carries a `teamType`. */
|
|
6
2
|
export function leagueModeSortsTeamsByType(mode) {
|
|
7
3
|
return mode === TEAM_TYPED_LEAGUE_MODE;
|
|
8
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"league-mode.js","sourceRoot":"","sources":["../../src/utils/league-mode.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"league-mode.js","sourceRoot":"","sources":["../../src/utils/league-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAmB,MAAM,oBAAoB,CAAC;AAE7E,MAAM,UAAU,0BAA0B,CAAC,IAAgB;IACzD,OAAO,IAAI,KAAK,sBAAsB,CAAC;AACzC,CAAC","sourcesContent":["import { TEAM_TYPED_LEAGUE_MODE, type LeagueMode } from '../types/unions.js';\n\nexport function leagueModeSortsTeamsByType(mode: LeagueMode): boolean {\n return mode === TEAM_TYPED_LEAGUE_MODE;\n}\n"]}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import { SHARED_LOCATION_CONFLICT, TEAM_DOUBLE_BOOKED_CONFLICT } from '../types/schedules.js';
|
|
2
|
-
/**
|
|
3
|
-
* How a game's venue reads on the schedule: the venue's name, and the court or room within it when
|
|
4
|
-
* one was chosen. The server writes it as the game's `locationLabel`, and the form previews it.
|
|
5
|
-
*/
|
|
6
2
|
export declare function formatGameLocationLabel(venueName: string, subLocation?: string): string;
|
|
7
|
-
/** A game as the conflict check reads it: a scheduled game, or a draft the form holds. */
|
|
8
3
|
export interface ScheduleConflictGame {
|
|
9
|
-
/** The game's id, or the form's key for a draft not yet saved. */
|
|
10
4
|
readonly key: string;
|
|
11
5
|
readonly startTime: number;
|
|
12
|
-
/** The game's real teams. A game with fewer than two is a bye: it books no venue and no team. */
|
|
13
6
|
readonly teamIds: readonly string[];
|
|
14
7
|
readonly gameLocationId?: string;
|
|
15
8
|
readonly subLocation?: string;
|
|
@@ -25,13 +18,5 @@ export type ScheduleConflict = {
|
|
|
25
18
|
readonly teamId: string;
|
|
26
19
|
readonly gameKeys: string[];
|
|
27
20
|
};
|
|
28
|
-
/**
|
|
29
|
-
* The conflicts `candidates` — the week being created or edited — cause against each other and
|
|
30
|
-
* against `existing`, the league's saved games: two games at one venue court at one start time, and
|
|
31
|
-
* one team in two games at one start time. An existing game a candidate shares a key with is the
|
|
32
|
-
* game being edited, so the candidate replaces it. A conflict among saved games alone is not
|
|
33
|
-
* reported: the form warns about what the admin is doing now. Warnings only — nothing is refused
|
|
34
|
-
* for one.
|
|
35
|
-
*/
|
|
36
21
|
export declare function findScheduleConflicts(candidates: readonly ScheduleConflictGame[], existing: readonly ScheduleConflictGame[]): ScheduleConflict[];
|
|
37
22
|
//# sourceMappingURL=schedules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../../src/utils/schedules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../../src/utils/schedules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAE9F,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvF;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,MAAM,gBAAgB,GACxB;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,wBAAwB,CAAC;IAC/C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;CAC7B,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,2BAA2B,CAAC;IAClD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAyBN,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,SAAS,oBAAoB,EAAE,EAC3C,QAAQ,EAAE,SAAS,oBAAoB,EAAE,GACxC,gBAAgB,EAAE,CA8CpB"}
|
package/dist/utils/schedules.js
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
// A league's schedule: how a game's venue reads, and the scheduling conflicts the week form warns
|
|
2
|
-
// about. Pure, so the admin form computes the warnings as the week is edited and a test proves them
|
|
3
|
-
// without a component.
|
|
4
1
|
import { SHARED_LOCATION_CONFLICT, TEAM_DOUBLE_BOOKED_CONFLICT } from '../types/schedules.js';
|
|
5
|
-
/**
|
|
6
|
-
* How a game's venue reads on the schedule: the venue's name, and the court or room within it when
|
|
7
|
-
* one was chosen. The server writes it as the game's `locationLabel`, and the form previews it.
|
|
8
|
-
*/
|
|
9
2
|
export function formatGameLocationLabel(venueName, subLocation) {
|
|
10
3
|
return subLocation ? `${venueName} - ${subLocation}` : venueName;
|
|
11
4
|
}
|
|
12
|
-
/**
|
|
13
|
-
* Where a game is played, for comparing two games: the venue and its court when the game names a
|
|
14
|
-
* venue, else its label, trimmed and case-folded.
|
|
15
|
-
*/
|
|
16
5
|
function locationKey(game) {
|
|
17
6
|
if (game.gameLocationId !== undefined)
|
|
18
7
|
return `venue:${game.gameLocationId}:${game.subLocation ?? ''}`;
|
|
@@ -25,14 +14,6 @@ function addToGroup(groups, key, game, teamId) {
|
|
|
25
14
|
else
|
|
26
15
|
groups.set(key, { startTime: game.startTime, teamId, games: [game] });
|
|
27
16
|
}
|
|
28
|
-
/**
|
|
29
|
-
* The conflicts `candidates` — the week being created or edited — cause against each other and
|
|
30
|
-
* against `existing`, the league's saved games: two games at one venue court at one start time, and
|
|
31
|
-
* one team in two games at one start time. An existing game a candidate shares a key with is the
|
|
32
|
-
* game being edited, so the candidate replaces it. A conflict among saved games alone is not
|
|
33
|
-
* reported: the form warns about what the admin is doing now. Warnings only — nothing is refused
|
|
34
|
-
* for one.
|
|
35
|
-
*/
|
|
36
17
|
export function findScheduleConflicts(candidates, existing) {
|
|
37
18
|
const candidateKeys = new Set(candidates.map((game) => game.key));
|
|
38
19
|
const games = [...existing.filter((game) => !candidateKeys.has(game.key)), ...candidates].filter((game) => game.teamIds.length >= 2);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedules.js","sourceRoot":"","sources":["../../src/utils/schedules.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"schedules.js","sourceRoot":"","sources":["../../src/utils/schedules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAE9F,MAAM,UAAU,uBAAuB,CAAC,SAAiB,EAAE,WAAoB;IAC7E,OAAO,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,MAAM,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACnE,CAAC;AAwBD,SAAS,WAAW,CAAC,IAA0B;IAC7C,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS;QACnC,OAAO,SAAS,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,WAAW,IAAI,EAAE,EAAE,CAAC;IAClE,OAAO,SAAS,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;AAC5D,CAAC;AAQD,SAAS,UAAU,CACjB,MAAkC,EAClC,GAAW,EACX,IAA0B,EAC1B,MAAqB;IAErB,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,KAAK;QAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;QAC7B,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,UAA2C,EAC3C,QAAyC;IAEzC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,GA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AAC;AACJ,CAAC","sourcesContent":["import { SHARED_LOCATION_CONFLICT, TEAM_DOUBLE_BOOKED_CONFLICT } from '../types/schedules.js';\n\nexport function formatGameLocationLabel(venueName: string, subLocation?: string): string {\n return subLocation ? `${venueName} - ${subLocation}` : venueName;\n}\n\nexport interface ScheduleConflictGame {\n readonly key: string;\n readonly startTime: number;\n readonly teamIds: readonly string[];\n readonly gameLocationId?: string;\n readonly subLocation?: string;\n readonly locationLabel: string;\n}\n\nexport type ScheduleConflict =\n | {\n readonly kind: typeof SHARED_LOCATION_CONFLICT;\n readonly startTime: number;\n readonly gameKeys: string[];\n }\n | {\n readonly kind: typeof TEAM_DOUBLE_BOOKED_CONFLICT;\n readonly startTime: number;\n readonly teamId: string;\n readonly gameKeys: string[];\n };\n\nfunction locationKey(game: ScheduleConflictGame): string {\n if (game.gameLocationId !== undefined)\n return `venue:${game.gameLocationId}:${game.subLocation ?? ''}`;\n return `label:${game.locationLabel.trim().toLowerCase()}`;\n}\n\ninterface ConflictGroup {\n readonly startTime: number;\n readonly teamId: string | null;\n readonly games: ScheduleConflictGame[];\n}\n\nfunction addToGroup(\n groups: Map<string, ConflictGroup>,\n key: string,\n game: ScheduleConflictGame,\n teamId: string | null,\n): void {\n const group = groups.get(key);\n if (group) group.games.push(game);\n else groups.set(key, { startTime: game.startTime, teamId, games: [game] });\n}\n\nexport function findScheduleConflicts(\n candidates: readonly ScheduleConflictGame[],\n existing: readonly ScheduleConflictGame[],\n): ScheduleConflict[] {\n const candidateKeys = new Set(candidates.map((game) => game.key));\n const games = [...existing.filter((game) => !candidateKeys.has(game.key)), ...candidates].filter(\n (game) => game.teamIds.length >= 2,\n );\n\n const byLocation = new Map<string, ConflictGroup>();\n const byTeam = new Map<string, ConflictGroup>();\n for (const game of games) {\n addToGroup(byLocation, `${game.startTime}|${locationKey(game)}`, game, null);\n for (const teamId of new Set(game.teamIds))\n addToGroup(byTeam, `${game.startTime}|${teamId}`, game, teamId);\n }\n\n const conflicts: ScheduleConflict[] = [];\n const reported = (group: ConflictGroup) =>\n group.games.length > 1 && group.games.some((game) => candidateKeys.has(game.key));\n const keysOf = (group: ConflictGroup) => group.games.map((game) => game.key).sort();\n\n for (const group of byLocation.values()) {\n if (!reported(group)) continue;\n conflicts.push({\n kind: SHARED_LOCATION_CONFLICT,\n startTime: group.startTime,\n gameKeys: keysOf(group),\n });\n }\n for (const group of byTeam.values()) {\n if (!reported(group) || group.teamId === null) continue;\n conflicts.push({\n kind: TEAM_DOUBLE_BOOKED_CONFLICT,\n startTime: group.startTime,\n teamId: group.teamId,\n gameKeys: keysOf(group),\n });\n }\n\n const teamOf = (conflict: ScheduleConflict) =>\n conflict.kind === TEAM_DOUBLE_BOOKED_CONFLICT ? conflict.teamId : '';\n return conflicts.sort(\n (a, b) =>\n a.startTime - b.startTime ||\n a.kind.localeCompare(b.kind) ||\n teamOf(a).localeCompare(teamOf(b)) ||\n a.gameKeys.join(',').localeCompare(b.gameKeys.join(',')),\n );\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { HistoricalStats } from '../doc-schemas/user-profile.js';
|
|
2
|
+
import type { GameStatsCorrectionTarget } from '../schemas/stats.js';
|
|
3
|
+
import type { SportKey } from '../types/sports.js';
|
|
4
|
+
export type StatsOperationRequest = {
|
|
5
|
+
kind: 'gameStatsCorrection';
|
|
6
|
+
scope: {
|
|
7
|
+
gameId: string;
|
|
8
|
+
};
|
|
9
|
+
targets?: readonly GameStatsCorrectionTarget[];
|
|
10
|
+
keepStored?: true;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'historicalStatsUpdate';
|
|
13
|
+
scope: {
|
|
14
|
+
userId: string;
|
|
15
|
+
sportKey: SportKey;
|
|
16
|
+
};
|
|
17
|
+
stats: HistoricalStats;
|
|
18
|
+
};
|
|
19
|
+
export declare function hashStatsOperationRequest(request: StatsOperationRequest): Promise<string>;
|
|
20
|
+
//# sourceMappingURL=stats-operation-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats-operation-request.d.ts","sourceRoot":"","sources":["../../src/utils/stats-operation-request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGnD,MAAM,MAAM,qBAAqB,GAC7B;IACE,IAAI,EAAE,qBAAqB,CAAC;IAC5B,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,SAAS,yBAAyB,EAAE,CAAC;IAC/C,UAAU,CAAC,EAAE,IAAI,CAAC;CACnB,GACD;IACE,IAAI,EAAE,uBAAuB,CAAC;IAC9B,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,QAAQ,CAAA;KAAE,CAAC;IAC9C,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AAGN,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAQzF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { canonicalize, hashPayload } from '@ttt-productions/edge-protocol-core';
|
|
2
|
+
// The same targets sent in another order are the same request.
|
|
3
|
+
export function hashStatsOperationRequest(request) {
|
|
4
|
+
if (request.kind !== 'gameStatsCorrection' || request.targets === undefined) {
|
|
5
|
+
return hashPayload(request);
|
|
6
|
+
}
|
|
7
|
+
const targets = [...request.targets].sort((left, right) => canonicalize(left) < canonicalize(right) ? -1 : 1);
|
|
8
|
+
return hashPayload({ ...request, targets });
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=stats-operation-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats-operation-request.js","sourceRoot":"","sources":["../../src/utils/stats-operation-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAmBhF,+DAA+D;AAC/D,MAAM,UAAU,yBAAyB,CAAC,OAA8B;IACtE,IAAI,OAAO,CAAC,IAAI,KAAK,qBAAqB,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAC5E,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IACD,MAAM,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACxD,YAAY,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAClD,CAAC;IACF,OAAO,WAAW,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["import { canonicalize, hashPayload } from '@ttt-productions/edge-protocol-core';\nimport type { HistoricalStats } from '../doc-schemas/user-profile.js';\nimport type { GameStatsCorrectionTarget } from '../schemas/stats.js';\nimport type { SportKey } from '../types/sports.js';\n\n// What a held operation is bound to: its kind, scope, and values, never its reason.\nexport type StatsOperationRequest =\n | {\n kind: 'gameStatsCorrection';\n scope: { gameId: string };\n targets?: readonly GameStatsCorrectionTarget[];\n keepStored?: true;\n }\n | {\n kind: 'historicalStatsUpdate';\n scope: { userId: string; sportKey: SportKey };\n stats: HistoricalStats;\n };\n\n// The same targets sent in another order are the same request.\nexport function hashStatsOperationRequest(request: StatsOperationRequest): Promise<string> {\n if (request.kind !== 'gameStatsCorrection' || request.targets === undefined) {\n return hashPayload(request);\n }\n const targets = [...request.targets].sort((left, right) =>\n canonicalize(left) < canonicalize(right) ? -1 : 1,\n );\n return hashPayload({ ...request, targets });\n}\n"]}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** The last calendar day a player may create a team in a league that starts on `leagueStartDate`. */
|
|
2
1
|
export declare function teamCreationLastDay(leagueStartDate: string): string;
|
|
3
|
-
/** Whether a player may still create a team on `todayDayKey` (see `toLeagueDayKey`). */
|
|
4
2
|
export declare function isTeamCreationOpen(leagueStartDate: string, todayDayKey: string): boolean;
|
|
5
3
|
//# sourceMappingURL=team-creation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team-creation.d.ts","sourceRoot":"","sources":["../../src/utils/team-creation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"team-creation.d.ts","sourceRoot":"","sources":["../../src/utils/team-creation.ts"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,wBAAgB,kBAAkB,CAAC,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAExF"}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
// The team-creation window: a player may create a team in a league until TEAM_CREATION_CUTOFF_DAYS
|
|
2
|
-
// days after the league's start date, inclusive. The create-team callable refuses a late creation
|
|
3
|
-
// and the league page hides the affordance, both through these two functions (RULE-STD-ENG-005). An admin
|
|
4
|
-
// creating a team from the admin console is not held to the window.
|
|
5
1
|
import { TEAM_CREATION_CUTOFF_DAYS } from '../constants/business.js';
|
|
6
2
|
import { addCalendarDays } from './league-calendar.js';
|
|
7
|
-
/** The last calendar day a player may create a team in a league that starts on `leagueStartDate`. */
|
|
8
3
|
export function teamCreationLastDay(leagueStartDate) {
|
|
9
4
|
return addCalendarDays(leagueStartDate, TEAM_CREATION_CUTOFF_DAYS);
|
|
10
5
|
}
|
|
11
|
-
/** Whether a player may still create a team on `todayDayKey` (see `toLeagueDayKey`). */
|
|
12
6
|
export function isTeamCreationOpen(leagueStartDate, todayDayKey) {
|
|
13
7
|
return todayDayKey <= teamCreationLastDay(leagueStartDate);
|
|
14
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team-creation.js","sourceRoot":"","sources":["../../src/utils/team-creation.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"team-creation.js","sourceRoot":"","sources":["../../src/utils/team-creation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,UAAU,mBAAmB,CAAC,eAAuB;IACzD,OAAO,eAAe,CAAC,eAAe,EAAE,yBAAyB,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,eAAuB,EAAE,WAAmB;IAC7E,OAAO,WAAW,IAAI,mBAAmB,CAAC,eAAe,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import { TEAM_CREATION_CUTOFF_DAYS } from '../constants/business.js';\nimport { addCalendarDays } from './league-calendar.js';\n\nexport function teamCreationLastDay(leagueStartDate: string): string {\n return addCalendarDays(leagueStartDate, TEAM_CREATION_CUTOFF_DAYS);\n}\n\nexport function isTeamCreationOpen(leagueStartDate: string, todayDayKey: string): boolean {\n return todayDayKey <= teamCreationLastDay(leagueStartDate);\n}\n"]}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import type { CaptainTeamRole } from '../types/audit.js';
|
|
2
2
|
import { type TeamRole } from '../types/unions.js';
|
|
3
|
-
/** An action on a member taken under the admin role, where no captaincy on the team admits the caller. */
|
|
4
3
|
export declare const TEAM_MEMBER_ADMIN_ACTOR: "admin";
|
|
5
|
-
/** The authority an action on a member is taken under: an admin, or the caller's role on the team. */
|
|
6
4
|
export type TeamMemberActor = typeof TEAM_MEMBER_ADMIN_ACTOR | CaptainTeamRole;
|
|
7
|
-
/** The member acted on: their role on the team, and whether they are a ghost. */
|
|
8
5
|
export interface TeamMemberTarget {
|
|
9
6
|
role: TeamRole;
|
|
10
7
|
isGhost: boolean;
|
|
11
8
|
}
|
|
12
9
|
export interface TeamMemberActions {
|
|
13
|
-
/** Make the player a co-captain. */
|
|
14
10
|
promote: boolean;
|
|
15
|
-
/** Make the co-captain a player. */
|
|
16
11
|
demote: boolean;
|
|
17
|
-
/** Take them off the team — a ghost through the ghost removal. */
|
|
18
12
|
remove: boolean;
|
|
19
13
|
}
|
|
20
14
|
export declare function teamMemberActions(actor: TeamMemberActor, target: TeamMemberTarget): TeamMemberActions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team-member-actions.d.ts","sourceRoot":"","sources":["../../src/utils/team-member-actions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"team-member-actions.d.ts","sourceRoot":"","sources":["../../src/utils/team-member-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAKL,KAAK,QAAQ,EACd,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,uBAAuB,SAAwC,CAAC;AAE7E,MAAM,MAAM,eAAe,GAAG,OAAO,uBAAuB,GAAG,eAAe,CAAC;AAE/E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CACjB;AAID,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,gBAAgB,GACvB,iBAAiB,CAQnB"}
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
// What a team leader or an admin may do to one member of a team: promote a player to co-captain,
|
|
2
|
-
// demote a co-captain to player, or remove them. The team's management callables refuse what this
|
|
3
|
-
// leaves out, and the team page and the admin Teams tab offer exactly what it allows (RULE-STD-FRONTEND-110):
|
|
4
|
-
//
|
|
5
|
-
// - the captain is never moved or removed here — an admin changes the team's captain first;
|
|
6
|
-
// - only the captain and an admin promote or demote, and a ghost is never made a co-captain, since no
|
|
7
|
-
// one could act with that authority;
|
|
8
|
-
// - a co-captain removes plain players only — never another co-captain, never the captain.
|
|
9
|
-
//
|
|
10
|
-
// A ghost leaves through its own removal, which decides whether it has played; that is still a
|
|
11
|
-
// removal here.
|
|
12
1
|
import { TEAM_CAPTAIN_ROLE, TEAM_CO_CAPTAIN_ROLE, TEAM_PLAYER_ROLE, } from '../types/unions.js';
|
|
13
|
-
/** An action on a member taken under the admin role, where no captaincy on the team admits the caller. */
|
|
14
2
|
export const TEAM_MEMBER_ADMIN_ACTOR = 'admin';
|
|
15
3
|
const NONE = { promote: false, demote: false, remove: false };
|
|
16
4
|
export function teamMemberActions(actor, target) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team-member-actions.js","sourceRoot":"","sources":["../../src/utils/team-member-actions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"team-member-actions.js","sourceRoot":"","sources":["../../src/utils/team-member-actions.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,GAGjB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,uBAAuB,GAAG,OAAqC,CAAC;AAe7E,MAAM,IAAI,GAAsB,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAEjF,MAAM,UAAU,iBAAiB,CAC/B,KAAsB,EACtB,MAAwB;IAExB,IAAI,MAAM,CAAC,IAAI,KAAK,iBAAiB;QAAE,OAAO,IAAI,CAAC;IACnD,MAAM,iBAAiB,GAAG,KAAK,KAAK,uBAAuB,IAAI,KAAK,KAAK,iBAAiB,CAAC;IAC3F,OAAO;QACL,OAAO,EAAE,iBAAiB,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,IAAI,CAAC,MAAM,CAAC,OAAO;QACjF,MAAM,EAAE,iBAAiB,IAAI,MAAM,CAAC,IAAI,KAAK,oBAAoB;QACjE,MAAM,EAAE,iBAAiB,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB;KAC9D,CAAC;AACJ,CAAC","sourcesContent":["import type { CaptainTeamRole } from '../types/audit.js';\nimport {\n TEAM_CAPTAIN_ROLE,\n TEAM_CO_CAPTAIN_ROLE,\n TEAM_PLAYER_ROLE,\n type SystemRole,\n type TeamRole,\n} from '../types/unions.js';\n\nexport const TEAM_MEMBER_ADMIN_ACTOR = 'admin' as const satisfies SystemRole;\n\nexport type TeamMemberActor = typeof TEAM_MEMBER_ADMIN_ACTOR | CaptainTeamRole;\n\nexport interface TeamMemberTarget {\n role: TeamRole;\n isGhost: boolean;\n}\n\nexport interface TeamMemberActions {\n promote: boolean;\n demote: boolean;\n remove: boolean;\n}\n\nconst NONE: TeamMemberActions = { promote: false, demote: false, remove: false };\n\nexport function teamMemberActions(\n actor: TeamMemberActor,\n target: TeamMemberTarget,\n): TeamMemberActions {\n if (target.role === TEAM_CAPTAIN_ROLE) return NONE;\n const managesCoCaptains = actor === TEAM_MEMBER_ADMIN_ACTOR || actor === TEAM_CAPTAIN_ROLE;\n return {\n promote: managesCoCaptains && target.role === TEAM_PLAYER_ROLE && !target.isGhost,\n demote: managesCoCaptains && target.role === TEAM_CO_CAPTAIN_ROLE,\n remove: managesCoCaptains || target.role === TEAM_PLAYER_ROLE,\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttt-productions/q-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"description": "Core types, Firestore path constants, zod schemas, and shared constants for Q-Sports",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
"test": "vitest run"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
+
"@ttt-productions/edge-protocol-core": "^0.1.15",
|
|
80
81
|
"@ttt-productions/input-format-core": "^0.1.4",
|
|
81
82
|
"@ttt-productions/media-schemas": "^0.14.14",
|
|
82
83
|
"@ttt-productions/notification-core": "^0.15.22",
|