@ttt-productions/q-core 0.1.16 → 0.1.18
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/business.d.ts.map +1 -1
- package/dist/constants/business.js +25 -5
- package/dist/constants/business.js.map +1 -1
- package/dist/constants/sports.d.ts.map +1 -1
- package/dist/constants/sports.js +2 -2
- package/dist/constants/sports.js.map +1 -1
- package/dist/doc-schemas/admin-notifications.d.ts +1 -1
- package/dist/doc-schemas/admin-notifications.d.ts.map +1 -1
- package/dist/doc-schemas/admin-notifications.js +4 -1
- 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 +4 -1
- package/dist/doc-schemas/aggregate-stats.js.map +1 -1
- package/dist/doc-schemas/atoms.d.ts.map +1 -1
- package/dist/doc-schemas/atoms.js +2 -2
- package/dist/doc-schemas/atoms.js.map +1 -1
- package/dist/doc-schemas/audit-event.d.ts.map +1 -1
- package/dist/doc-schemas/audit-event.js +8 -4
- package/dist/doc-schemas/audit-event.js.map +1 -1
- package/dist/doc-schemas/award-group-grant.d.ts.map +1 -1
- package/dist/doc-schemas/award-group-grant.js +11 -3
- package/dist/doc-schemas/award-group-grant.js.map +1 -1
- package/dist/doc-schemas/catalogs.js +1 -1
- package/dist/doc-schemas/catalogs.js.map +1 -1
- package/dist/doc-schemas/gallery.js +1 -1
- package/dist/doc-schemas/gallery.js.map +1 -1
- package/dist/doc-schemas/game-stat-history.d.ts.map +1 -1
- 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 +10 -2
- package/dist/doc-schemas/game-stats.js.map +1 -1
- package/dist/doc-schemas/league-team.js +1 -1
- 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 +2 -1
- package/dist/doc-schemas/membership-roster-sync.js.map +1 -1
- package/dist/doc-schemas/migration-console.js +1 -1
- 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.map +1 -1
- package/dist/doc-schemas/picture-retirement.d.ts.map +1 -1
- package/dist/doc-schemas/picture-retirement.js +5 -1
- package/dist/doc-schemas/picture-retirement.js.map +1 -1
- package/dist/doc-schemas/registry.d.ts +1 -1
- package/dist/doc-schemas/registry.d.ts.map +1 -1
- package/dist/doc-schemas/registry.js +1 -1
- package/dist/doc-schemas/registry.js.map +1 -1
- package/dist/doc-schemas/sport-game.d.ts.map +1 -1
- package/dist/doc-schemas/sport-game.js.map +1 -1
- package/dist/doc-schemas/sport-league.d.ts.map +1 -1
- package/dist/doc-schemas/sport-league.js +10 -2
- package/dist/doc-schemas/sport-league.js.map +1 -1
- package/dist/doc-schemas/status-reconcile-queue.d.ts.map +1 -1
- 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 +10 -2
- 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.map +1 -1
- package/dist/doc-schemas/user-profile.d.ts.map +1 -1
- package/dist/doc-schemas/user-profile.js +1 -1
- package/dist/doc-schemas/user-profile.js.map +1 -1
- package/dist/doc-schemas/waivers-and-hardware.d.ts.map +1 -1
- package/dist/doc-schemas/waivers-and-hardware.js +15 -3
- 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 +88 -24
- package/dist/domain-events/domain-events.js.map +1 -1
- package/dist/ids/notification-ids.d.ts.map +1 -1
- package/dist/ids/notification-ids.js.map +1 -1
- package/dist/ids/picture-ids.d.ts.map +1 -1
- package/dist/ids/picture-ids.js.map +1 -1
- package/dist/ids/stat-event-ids.d.ts.map +1 -1
- package/dist/ids/stat-event-ids.js.map +1 -1
- package/dist/ids/waiver-template-ids.d.ts.map +1 -1
- package/dist/ids/waiver-template-ids.js.map +1 -1
- package/dist/index.d.ts +4 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -9
- package/dist/index.js.map +1 -1
- package/dist/input-formats/{index.d.ts → input-formats.d.ts} +1 -1
- package/dist/input-formats/input-formats.d.ts.map +1 -0
- package/dist/input-formats/{index.js → input-formats.js} +1 -1
- package/dist/input-formats/input-formats.js.map +1 -0
- package/dist/media/file-origins.d.ts.map +1 -1
- package/dist/media/file-origins.js +30 -6
- package/dist/media/file-origins.js.map +1 -1
- package/dist/migration-console/action-ids.d.ts.map +1 -1
- package/dist/migration-console/action-ids.js.map +1 -1
- package/dist/migration-console/manifest.d.ts.map +1 -1
- package/dist/migration-console/manifest.js +42 -7
- package/dist/migration-console/manifest.js.map +1 -1
- package/dist/migration-console/run-state.d.ts.map +1 -1
- package/dist/migration-console/run-state.js.map +1 -1
- package/dist/notifications/admin-notification-config.d.ts.map +1 -1
- package/dist/notifications/admin-notification-config.js +5 -3
- package/dist/notifications/admin-notification-config.js.map +1 -1
- package/dist/notifications/occurrences.d.ts.map +1 -1
- package/dist/notifications/occurrences.js.map +1 -1
- package/dist/paths/path-builders.d.ts.map +1 -1
- package/dist/paths/path-builders.js +60 -15
- package/dist/paths/path-builders.js.map +1 -1
- package/dist/paths/picture-owner-paths.d.ts.map +1 -1
- package/dist/paths/picture-owner-paths.js.map +1 -1
- package/dist/paths/storage-paths.d.ts.map +1 -1
- package/dist/paths/storage-paths.js.map +1 -1
- package/dist/schemas/admin-notifications.d.ts.map +1 -1
- package/dist/schemas/admin-notifications.js +8 -4
- package/dist/schemas/admin-notifications.js.map +1 -1
- package/dist/schemas/app-config.js +1 -1
- package/dist/schemas/app-config.js.map +1 -1
- package/dist/schemas/atoms.d.ts +0 -1
- package/dist/schemas/atoms.d.ts.map +1 -1
- package/dist/schemas/atoms.js +3 -5
- package/dist/schemas/atoms.js.map +1 -1
- package/dist/schemas/awards.d.ts.map +1 -1
- package/dist/schemas/awards.js +13 -5
- package/dist/schemas/awards.js.map +1 -1
- package/dist/schemas/dead-letters.d.ts.map +1 -1
- package/dist/schemas/dead-letters.js +6 -3
- 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 +1 -1
- 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 +11 -4
- package/dist/schemas/hardware-loan-contracts.js.map +1 -1
- package/dist/schemas/leagues.d.ts +2 -2
- package/dist/schemas/leagues.d.ts.map +1 -1
- package/dist/schemas/leagues.js +12 -3
- package/dist/schemas/leagues.js.map +1 -1
- package/dist/schemas/migration-console.d.ts.map +1 -1
- package/dist/schemas/migration-console.js +3 -6
- package/dist/schemas/migration-console.js.map +1 -1
- package/dist/schemas/pictures.d.ts.map +1 -1
- package/dist/schemas/pictures.js +6 -2
- package/dist/schemas/pictures.js.map +1 -1
- package/dist/schemas/schedules.d.ts +8 -8
- package/dist/schemas/schedules.d.ts.map +1 -1
- package/dist/schemas/schedules.js +9 -3
- package/dist/schemas/schedules.js.map +1 -1
- package/dist/schemas/scoring.d.ts +12 -12
- package/dist/schemas/scoring.d.ts.map +1 -1
- package/dist/schemas/scoring.js +11 -4
- package/dist/schemas/scoring.js.map +1 -1
- package/dist/schemas/signed-waivers.d.ts.map +1 -1
- package/dist/schemas/signed-waivers.js +5 -3
- package/dist/schemas/signed-waivers.js.map +1 -1
- package/dist/schemas/stats.d.ts.map +1 -1
- package/dist/schemas/stats.js +27 -8
- package/dist/schemas/stats.js.map +1 -1
- package/dist/schemas/team-joining.d.ts.map +1 -1
- package/dist/schemas/team-joining.js +13 -5
- package/dist/schemas/team-joining.js.map +1 -1
- package/dist/schemas/teams.d.ts.map +1 -1
- package/dist/schemas/teams.js +19 -6
- package/dist/schemas/teams.js.map +1 -1
- package/dist/schemas/uploads.d.ts.map +1 -1
- package/dist/schemas/uploads.js +12 -5
- package/dist/schemas/uploads.js.map +1 -1
- package/dist/schemas/users.d.ts.map +1 -1
- package/dist/schemas/users.js +22 -8
- package/dist/schemas/users.js.map +1 -1
- package/dist/schemas/waiver-templates.js +1 -1
- package/dist/schemas/waiver-templates.js.map +1 -1
- package/dist/sports/basketball-scoring.d.ts.map +1 -1
- package/dist/sports/basketball-scoring.js +67 -16
- package/dist/sports/basketball-scoring.js.map +1 -1
- package/dist/sports/basketball.d.ts.map +1 -1
- package/dist/sports/basketball.js +34 -7
- package/dist/sports/basketball.js.map +1 -1
- package/dist/sports/column-catalog.d.ts.map +1 -1
- package/dist/sports/column-catalog.js +4 -1
- package/dist/sports/column-catalog.js.map +1 -1
- package/dist/sports/contribution.d.ts.map +1 -1
- package/dist/sports/contribution.js +10 -3
- package/dist/sports/contribution.js.map +1 -1
- package/dist/sports/curling-scoring.d.ts.map +1 -1
- package/dist/sports/curling-scoring.js +30 -8
- package/dist/sports/curling-scoring.js.map +1 -1
- package/dist/sports/curling.d.ts.map +1 -1
- package/dist/sports/curling.js +1 -1
- package/dist/sports/curling.js.map +1 -1
- package/dist/sports/finalized-record.d.ts.map +1 -1
- 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 +28 -8
- package/dist/sports/football-scoring.js.map +1 -1
- package/dist/sports/football.d.ts.map +1 -1
- package/dist/sports/football.js +1 -1
- package/dist/sports/football.js.map +1 -1
- package/dist/sports/index.d.ts +2 -2
- package/dist/sports/index.d.ts.map +1 -1
- package/dist/sports/index.js +1 -1
- package/dist/sports/index.js.map +1 -1
- package/dist/sports/ledger-continuity.d.ts.map +1 -1
- package/dist/sports/ledger-continuity.js.map +1 -1
- package/dist/sports/rankings.d.ts.map +1 -1
- package/dist/sports/rankings.js +5 -1
- package/dist/sports/rankings.js.map +1 -1
- package/dist/sports/replay.d.ts.map +1 -1
- package/dist/sports/replay.js +4 -1
- package/dist/sports/replay.js.map +1 -1
- package/dist/sports/rollup-check.d.ts.map +1 -1
- package/dist/sports/rollup-check.js +15 -3
- package/dist/sports/rollup-check.js.map +1 -1
- package/dist/sports/score-mirror.d.ts.map +1 -1
- package/dist/sports/score-mirror.js.map +1 -1
- package/dist/sports/scoring-display.d.ts.map +1 -1
- package/dist/sports/scoring-display.js.map +1 -1
- package/dist/sports/scoring.d.ts.map +1 -1
- package/dist/sports/scoring.js.map +1 -1
- package/dist/sports/sport-adapter.d.ts.map +1 -1
- package/dist/sports/sport-adapter.js.map +1 -1
- package/dist/sports/store-driver.d.ts.map +1 -1
- package/dist/sports/store-driver.js +18 -7
- package/dist/sports/store-driver.js.map +1 -1
- package/dist/types/audit.d.ts.map +1 -1
- package/dist/types/audit.js +16 -3
- package/dist/types/audit.js.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/notifications.d.ts.map +1 -1
- package/dist/types/notifications.js +9 -13
- package/dist/types/notifications.js.map +1 -1
- package/dist/types/schedules.d.ts.map +1 -1
- package/dist/types/schedules.js.map +1 -1
- package/dist/types/sports.d.ts.map +1 -1
- package/dist/types/sports.js +9 -2
- package/dist/types/sports.js.map +1 -1
- package/dist/types/stats.d.ts.map +1 -1
- package/dist/types/stats.js +45 -9
- package/dist/types/stats.js.map +1 -1
- package/dist/types/unions.d.ts.map +1 -1
- package/dist/types/unions.js +32 -6
- package/dist/types/unions.js.map +1 -1
- package/dist/upload-variables/picture-upload-variables.d.ts.map +1 -1
- package/dist/upload-variables/picture-upload-variables.js +4 -2
- 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 +4 -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 +5 -3
- package/dist/upload-variables/sign-waiver-variables.js.map +1 -1
- package/dist/utils/app-config.d.ts.map +1 -1
- package/dist/utils/app-config.js +5 -1
- package/dist/utils/app-config.js.map +1 -1
- package/dist/utils/app-routes.d.ts.map +1 -1
- package/dist/utils/app-routes.js +6 -1
- package/dist/utils/app-routes.js.map +1 -1
- package/dist/utils/league-calendar.d.ts.map +1 -1
- package/dist/utils/league-calendar.js +4 -1
- package/dist/utils/league-calendar.js.map +1 -1
- package/dist/utils/league-join-warning.d.ts.map +1 -1
- package/dist/utils/league-join-warning.js +15 -5
- package/dist/utils/league-join-warning.js.map +1 -1
- package/dist/utils/schedules.d.ts.map +1 -1
- package/dist/utils/schedules.js +6 -2
- package/dist/utils/schedules.js.map +1 -1
- package/dist/utils/team-member-actions.d.ts.map +1 -1
- package/dist/utils/team-member-actions.js.map +1 -1
- package/package.json +5 -17
- package/dist/input-formats/index.d.ts.map +0 -1
- package/dist/input-formats/index.js.map +0 -1
- package/dist/migration-console/index.d.ts +0 -4
- package/dist/migration-console/index.d.ts.map +0 -1
- package/dist/migration-console/index.js +0 -5
- package/dist/migration-console/index.js.map +0 -1
- package/dist/types/documents.d.ts +0 -24
- package/dist/types/documents.d.ts.map +0 -1
- package/dist/types/documents.js +0 -5
- package/dist/types/documents.js.map +0 -1
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
// `formatLeagueJoinWarning` (ARCH-102, ENG-005). The acted-on item and a finding cross the wire, so
|
|
10
10
|
// each is declared once, as its schema, and its type is inferred from it.
|
|
11
11
|
import { z } from 'zod';
|
|
12
|
-
import { teamIdSchema
|
|
12
|
+
import { teamIdSchema } from '../doc-schemas/atoms.js';
|
|
13
|
+
import { teamInvitationIdSchema, teamJoinRequestIdSchema } from '../schemas/atoms.js';
|
|
13
14
|
// The four places a person can stand in a league.
|
|
14
15
|
export const LEAGUE_JOIN_WARNING_STATE_KEYS = [
|
|
15
16
|
'onTeam',
|
|
@@ -19,7 +20,11 @@ export const LEAGUE_JOIN_WARNING_STATE_KEYS = [
|
|
|
19
20
|
];
|
|
20
21
|
// The item a door acts on, which the warning never names: accepting a team's invitation does not
|
|
21
22
|
// warn about that invitation.
|
|
22
|
-
export const LEAGUE_JOIN_WARNING_ACTED_ON_KEYS = [
|
|
23
|
+
export const LEAGUE_JOIN_WARNING_ACTED_ON_KEYS = [
|
|
24
|
+
'teamInvitation',
|
|
25
|
+
'teamJoinRequest',
|
|
26
|
+
'leagueFreeAgent',
|
|
27
|
+
];
|
|
23
28
|
export const leagueJoinWarningActedOnSchema = z.discriminatedUnion('kind', [
|
|
24
29
|
z
|
|
25
30
|
.object({
|
|
@@ -68,12 +73,17 @@ export const leagueJoinWarningFindingSchema = z
|
|
|
68
73
|
*/
|
|
69
74
|
export function computeLeagueJoinWarning(facts, actedOn) {
|
|
70
75
|
const byTeam = (left, right) => (left.teamId ?? '').localeCompare(right.teamId ?? '');
|
|
71
|
-
const onTeam = facts.memberships.map((membership) => ({
|
|
76
|
+
const onTeam = facts.memberships.map((membership) => ({
|
|
77
|
+
state: 'onTeam',
|
|
78
|
+
teamId: membership.teamId,
|
|
79
|
+
}));
|
|
72
80
|
const pendingJoinRequest = facts.pendingJoinRequests
|
|
73
|
-
.filter((request) => !(actedOn?.kind === 'teamJoinRequest' &&
|
|
81
|
+
.filter((request) => !(actedOn?.kind === 'teamJoinRequest' &&
|
|
82
|
+
actedOn.teamJoinRequestId === request.teamJoinRequestId))
|
|
74
83
|
.map((request) => ({ state: 'pendingJoinRequest', teamId: request.teamId }));
|
|
75
84
|
const pendingInvitation = facts.pendingInvitations
|
|
76
|
-
.filter((invitation) => !(actedOn?.kind === 'teamInvitation' &&
|
|
85
|
+
.filter((invitation) => !(actedOn?.kind === 'teamInvitation' &&
|
|
86
|
+
actedOn.teamInvitationId === invitation.teamInvitationId))
|
|
77
87
|
.map((invitation) => ({ state: 'pendingInvitation', teamId: invitation.teamId }));
|
|
78
88
|
const freeAgentSignup = facts.freeAgentSignup && actedOn?.kind !== 'leagueFreeAgent'
|
|
79
89
|
? [{ state: 'freeAgentSignup', teamId: null }]
|
|
@@ -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,oGAAoG;AACpG,0EAA0E;AAE1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEpG,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,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,CAAU,CAAC;AAGnH,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,OAAO,CA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T;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` (ARCH-102, 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, 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 = ['teamInvitation', 'teamJoinRequest', 'leagueFreeAgent'] 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) => ({ state: 'onTeam' as const, teamId: membership.teamId }));\n const pendingJoinRequest = facts.pendingJoinRequests\n .filter(\n (request) => !(actedOn?.kind === 'teamJoinRequest' && actedOn.teamJoinRequestId === request.teamJoinRequestId),\n )\n .map((request) => ({ state: 'pendingJoinRequest' as const, teamId: request.teamId }));\n const pendingInvitation = facts.pendingInvitations\n .filter(\n (invitation) =>\n !(actedOn?.kind === 'teamInvitation' && actedOn.teamInvitationId === invitation.teamInvitationId),\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) => `${personName} has asked to join ${teamName}.`,\n pendingInvitation: (personName: string, teamName: string) =>\n `${personName} has an invitation waiting from ${teamName}.`,\n freeAgentSignup: (personName: string) => `${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) => `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,iFAAiF;AACjF,gGAAgG;AAChG,sFAAsF;AACtF,EAAE;AACF,mGAAmG;AACnG,8EAA8E;AAC9E,kGAAkG;AAClG,gGAAgG;AAChG,oGAAoG;AACpG,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,kBAA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AE,EAAE,CAC1C,oCAAoC,cAAc,GAAG;QACvD,iBAAiB,EAAE,GAAG,EAAE,CAAC,+CAA+C;QACxE,cAAc,EAAE,CAAC,cAAsB,EAAE,EAAE,CAAC,kBAAkB,cAAc,UAAU;QACtF,iBAAiB,EAAE,CAAC,cAAsB,EAAE,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;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` (ARCH-102, 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../../src/utils/schedules.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAE9F;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CA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C7B,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;AA6BN;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,SAAS,oBAAoB,EAAE,EAC3C,QAAQ,EAAE,SAAS,oBAAoB,EAAE,GACxC,gBAAgB,EAAE,CA8CpB"}
|
package/dist/utils/schedules.js
CHANGED
|
@@ -49,7 +49,11 @@ export function findScheduleConflicts(candidates, existing) {
|
|
|
49
49
|
for (const group of byLocation.values()) {
|
|
50
50
|
if (!reported(group))
|
|
51
51
|
continue;
|
|
52
|
-
conflicts.push({
|
|
52
|
+
conflicts.push({
|
|
53
|
+
kind: SHARED_LOCATION_CONFLICT,
|
|
54
|
+
startTime: group.startTime,
|
|
55
|
+
gameKeys: keysOf(group),
|
|
56
|
+
});
|
|
53
57
|
}
|
|
54
58
|
for (const group of byTeam.values()) {
|
|
55
59
|
if (!reported(group) || group.teamId === null)
|
|
@@ -61,7 +65,7 @@ export function findScheduleConflicts(candidates, existing) {
|
|
|
61
65
|
gameKeys: keysOf(group),
|
|
62
66
|
});
|
|
63
67
|
}
|
|
64
|
-
const teamOf = (conflict) =>
|
|
68
|
+
const teamOf = (conflict) => conflict.kind === TEAM_DOUBLE_BOOKED_CONFLICT ? conflict.teamId : '';
|
|
65
69
|
return conflicts.sort((a, b) => a.startTime - b.startTime ||
|
|
66
70
|
a.kind.localeCompare(b.kind) ||
|
|
67
71
|
teamOf(a).localeCompare(teamOf(b)) ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedules.js","sourceRoot":"","sources":["../../src/utils/schedules.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,oGAAoG;AACpG,uBAAuB;AAEvB,OAA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C,CAAC;QAClC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAC3D,CAAC;AACJ,CAAC","sourcesContent":["// A league's schedule: how a game's venue reads, and the scheduling conflicts the week form warns\n// about. Pure, so the admin form computes the warnings as the week is edited and a test proves them\n// without a component.\n\nimport { SHARED_LOCATION_CONFLICT, TEAM_DOUBLE_BOOKED_CONFLICT } from '../types/schedules.js';\n\n/**\n * How a game's venue reads on the schedule: the venue's name, and the court or room within it when\n * one was chosen. The server writes it as the game's `locationLabel`, and the form previews it.\n */\nexport function formatGameLocationLabel(venueName: string, subLocation?: string): string {\n return subLocation ? `${venueName} - ${subLocation}` : venueName;\n}\n\n/** A game as the conflict check reads it: a scheduled game, or a draft the form holds. */\nexport interface ScheduleConflictGame {\n /** The game's id, or the form's key for a draft not yet saved. */\n readonly key: string;\n readonly startTime: number;\n /** The game's real teams. A game with fewer than two is a bye: it books no venue and no team. */\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\n/**\n * Where a game is played, for comparing two games: the venue and its court when the game names a\n * venue, else its label, trimmed and case-folded.\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\n/**\n * The conflicts `candidates` — the week being created or edited — cause against each other and\n * against `existing`, the league's saved games: two games at one venue court at one start time, and\n * one team in two games at one start time. An existing game a candidate shares a key with is the\n * game being edited, so the candidate replaces it. A conflict among saved games alone is not\n * reported: the form warns about what the admin is doing now. Warnings only — nothing is refused\n * for one.\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team-member-actions.d.ts","sourceRoot":"","sources":["../../src/utils/team-member-actions.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAKL,KAAK,QAAQ,EACd,MAAM,oBAAoB,CAAC;AAE5B,iFAAiF;AACjF,eAAO,MAAM,uBAAuB,SAAwC,CAAC;AAE7E,sGAAsG;AACtG,MAAM,MAAM,eAAe,GAAG,OAAO,uBAAuB,GAAG,eAAe,CAAC;AAE/E,iFAAiF;AACjF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;CACjB;AAID,wBAAgB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"team-member-actions.d.ts","sourceRoot":"","sources":["../../src/utils/team-member-actions.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAKL,KAAK,QAAQ,EACd,MAAM,oBAAoB,CAAC;AAE5B,iFAAiF;AACjF,eAAO,MAAM,uBAAuB,SAAwC,CAAC;AAE7E,sGAAsG;AACtG,MAAM,MAAM,eAAe,GAAG,OAAO,uBAAuB,GAAG,eAAe,CAAC;AAE/E,iFAAiF;AACjF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;CACjB;AAID,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,gBAAgB,GACvB,iBAAiB,CAQnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team-member-actions.js","sourceRoot":"","sources":["../../src/utils/team-member-actions.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,kGAAkG;AAClG,qGAAqG;AACrG,EAAE;AACF,4FAA4F;AAC5F,sGAAsG;AACtG,uCAAuC;AACvC,2FAA2F;AAC3F,EAAE;AACF,+FAA+F;AAC/F,gBAAgB;AAGhB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,GAGjB,MAAM,oBAAoB,CAAC;AAE5B,iFAAiF;AACjF,MAAM,CAAC,MAAM,uBAAuB,GAAG,OAAqC,CAAC;AAoB7E,MAAM,IAAI,GAAsB,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAEjF,MAAM,UAAU,iBAAiB,
|
|
1
|
+
{"version":3,"file":"team-member-actions.js","sourceRoot":"","sources":["../../src/utils/team-member-actions.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,kGAAkG;AAClG,qGAAqG;AACrG,EAAE;AACF,4FAA4F;AAC5F,sGAAsG;AACtG,uCAAuC;AACvC,2FAA2F;AAC3F,EAAE;AACF,+FAA+F;AAC/F,gBAAgB;AAGhB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,GAGjB,MAAM,oBAAoB,CAAC;AAE5B,iFAAiF;AACjF,MAAM,CAAC,MAAM,uBAAuB,GAAG,OAAqC,CAAC;AAoB7E,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":["// What a team leader or an admin may do to one member of a team: promote a player to co-captain,\n// demote a co-captain to player, or remove them. The team's management callables refuse what this\n// leaves out, and the team page and the admin Teams tab offer exactly what it allows (FRONTEND-110):\n//\n// - the captain is never moved or removed here — an admin changes the team's captain first;\n// - only the captain and an admin promote or demote, and a ghost is never made a co-captain, since no\n// one could act with that authority;\n// - a co-captain removes plain players only — never another co-captain, never the captain.\n//\n// A ghost leaves through its own removal, which decides whether it has played; that is still a\n// removal here.\n\nimport 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\n/** An action on a member taken through its admin entry, under the admin role. */\nexport const TEAM_MEMBER_ADMIN_ACTOR = 'admin' as const satisfies SystemRole;\n\n/** The authority an action on a member is taken under: an admin, or the caller's role on the team. */\nexport type TeamMemberActor = typeof TEAM_MEMBER_ADMIN_ACTOR | CaptainTeamRole;\n\n/** The member acted on: their role on the team, and whether they are a ghost. */\nexport interface TeamMemberTarget {\n role: TeamRole;\n isGhost: boolean;\n}\n\nexport interface TeamMemberActions {\n /** Make the player a co-captain. */\n promote: boolean;\n /** Make the co-captain a player. */\n demote: boolean;\n /** Take them off the team — a ghost through the ghost removal. */\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.18",
|
|
4
4
|
"description": "Core types, Firestore path constants, zod schemas, and shared constants for Q-Sports",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,18 +32,6 @@
|
|
|
32
32
|
"types": "./dist/constants/index.d.ts",
|
|
33
33
|
"default": "./dist/constants/index.js"
|
|
34
34
|
},
|
|
35
|
-
"./constants/business": {
|
|
36
|
-
"types": "./dist/constants/business.d.ts",
|
|
37
|
-
"default": "./dist/constants/business.js"
|
|
38
|
-
},
|
|
39
|
-
"./constants/sports": {
|
|
40
|
-
"types": "./dist/constants/sports.d.ts",
|
|
41
|
-
"default": "./dist/constants/sports.js"
|
|
42
|
-
},
|
|
43
|
-
"./constants/storage-keys": {
|
|
44
|
-
"types": "./dist/constants/storage-keys.d.ts",
|
|
45
|
-
"default": "./dist/constants/storage-keys.js"
|
|
46
|
-
},
|
|
47
35
|
"./utils": {
|
|
48
36
|
"types": "./dist/utils/index.d.ts",
|
|
49
37
|
"default": "./dist/utils/index.js"
|
|
@@ -89,10 +77,10 @@
|
|
|
89
77
|
"test": "vitest run"
|
|
90
78
|
},
|
|
91
79
|
"dependencies": {
|
|
92
|
-
"@ttt-productions/input-format-core": "^0.1.
|
|
93
|
-
"@ttt-productions/media-schemas": "^0.14.
|
|
94
|
-
"@ttt-productions/notification-core": "^0.15.
|
|
95
|
-
"@ttt-productions/theme-core": "^0.12.
|
|
80
|
+
"@ttt-productions/input-format-core": "^0.1.2",
|
|
81
|
+
"@ttt-productions/media-schemas": "^0.14.11",
|
|
82
|
+
"@ttt-productions/notification-core": "^0.15.17",
|
|
83
|
+
"@ttt-productions/theme-core": "^0.12.14",
|
|
96
84
|
"zod": "^4.4.3"
|
|
97
85
|
},
|
|
98
86
|
"author": "DJ (TTT Productions)",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/input-formats/index.ts"],"names":[],"mappings":"AAwCA;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;EAIrC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,+BAA+B;;;;EAI1C,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,sCAAsC;;;;EAIjD,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,oCAAoC;;;;EAI/C,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;EAIjC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;EAIpC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;EAIjC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;EAIrC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,mCAAmC;;;;EAI9C,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;EAIlC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;;EAIpC,CAAC;AAEH;;;GAGG;AACH,eA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MAAM,EAAE,MAAM;IACd,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,8BAA8B;CACpC,CAAC,CAAC;AAEH,qDAAqD;AACrD,MAAM,CAAC,MAAM,iCAAiC,GAAG,iBAAiB,CAAC;IACjE,MAAM,EAAE,MAAM;IACd,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,+BAA+B;CACrC,CAAC,CAAC;AAEH,gFAAgF;AAChF,MAAM,CAAC,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;IACxD,MAAM,EAAE,MAAM;IACd,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,sBAAsB;CAC5B,CAAC,CAAC","sourcesContent":["// The declared formats of the free-text fields a form takes, each built from the limits the field\n// enforces (ARCH-102). ui-core's text inputs and `ConsequenceDialog`'s reason field take only a\n// declaration, never a bare bound, and a field's wire schema is built from the same declaration\n// through `textFieldSchema`, so the form and the wire run the one check and accept exactly the same\n// text. `input-format-core` is server-safe and has no dependencies, so the declarations sit in the\n// package root, which both app roots import.\n\nimport { defineInputFormat } from '@ttt-productions/input-format-core';\nimport {\n MAX_ANNOUNCEMENT_MESSAGE_LENGTH,\n MAX_APP_VERSION_LENGTH,\n MAX_AWARD_NAME_LENGTH,\n MAX_CONTACT_PHONE_LENGTH,\n MAX_DISPLAY_NAME_LENGTH,\n MAX_GAME_LOCATION_MEMO_LENGTH,\n MAX_GAME_LOCATION_NAME_LENGTH,\n MAX_GAME_LOCATION_STREET_ADDRESS_LENGTH,\n MAX_GAME_LOCATION_SUB_LOCATION_LENGTH,\n MAX_GAME_MEMO_LENGTH,\n MAX_LANDING_ABOUT_TEXT_LENGTH,\n MAX_LANDING_HERO_TITLE_LENGTH,\n MAX_LEAGUE_DESCRIPTION_LENGTH,\n MAX_LEAGUE_TITLE_LENGTH,\n MAX_MAINTENANCE_MESSAGE_LENGTH,\n MAX_REPAIR_REASON_LENGTH,\n MAX_SCHEDULE_WEEK_TITLE_LENGTH,\n MAX_TEAM_INVITATION_MESSAGE_LENGTH,\n MAX_TEAM_JOIN_REQUEST_MESSAGE_LENGTH,\n MAX_TEAM_NAME_LENGTH,\n MAX_WAIVER_TEMPLATE_TEXT_LENGTH,\n MAX_WAIVER_TEMPLATE_TITLE_LENGTH,\n MIN_AWARD_NAME_LENGTH,\n MIN_DISPLAY_NAME_LENGTH,\n MIN_LEAGUE_DESCRIPTION_LENGTH,\n MIN_LEAGUE_TITLE_LENGTH,\n MIN_REPAIR_REASON_LENGTH,\n MIN_TEAM_JOIN_REQUEST_MESSAGE_LENGTH,\n MIN_TEAM_NAME_LENGTH,\n} from '../constants/business.js';\n\n/**\n * The reason an admin gives for a repair action, as `repairReasonSchema` reads it: trimmed, then\n * bounded by the repair-reason limits, with any character and line breaks allowed.\n */\nexport const REPAIR_REASON_INPUT_FORMAT = defineInputFormat({\n format: 'none',\n min: MIN_REPAIR_REASON_LENGTH,\n max: MAX_REPAIR_REASON_LENGTH,\n});\n\n/**\n * The evidence an operator records for a cutover step the console cannot see done — an export's\n * operation name, a revocation's console record: trimmed, then bounded by the repair-reason limits,\n * line breaks allowed.\n */\nexport const MIGRATION_EVIDENCE_INPUT_FORMAT = defineInputFormat({\n format: 'none',\n min: MIN_REPAIR_REASON_LENGTH,\n max: MAX_REPAIR_REASON_LENGTH,\n});\n\n/**\n * A player's message to the team they ask to join, as `teamJoinRequestMessageSchema` reads it:\n * trimmed, then bounded by the join-request message limits, with any character and line breaks\n * allowed.\n */\nexport const TEAM_JOIN_REQUEST_MESSAGE_INPUT_FORMAT = defineInputFormat({\n format: 'none',\n min: MIN_TEAM_JOIN_REQUEST_MESSAGE_LENGTH,\n max: MAX_TEAM_JOIN_REQUEST_MESSAGE_LENGTH,\n});\n\n/**\n * The optional note a team sends with an invitation, as `teamInvitationMessageSchema` reads it:\n * trimmed, empty allowed, then bounded by the invitation note limit, line breaks allowed.\n */\nexport const TEAM_INVITATION_MESSAGE_INPUT_FORMAT = defineInputFormat({\n format: 'none',\n min: 0,\n max: MAX_TEAM_INVITATION_MESSAGE_LENGTH,\n});\n\n/**\n * A scorer's note on one person in a live game (\"red shirt\", \"#9\"), as `gameMemoSchema` reads it:\n * trimmed, one line, empty allowed — an empty memo clears the note — then bounded by the memo cap.\n */\nexport const GAME_MEMO_INPUT_FORMAT = defineInputFormat({\n format: 'singleLine',\n min: 0,\n max: MAX_GAME_MEMO_LENGTH,\n});\n\n/**\n * A person's display name — an account's, or a ghost player's, as both ghost doors and the admin's\n * ghost captain ask for it — as `displayNameSchema` reads it: trimmed, one line, then bounded by the\n * display-name limits.\n */\nexport const DISPLAY_NAME_INPUT_FORMAT = defineInputFormat({\n format: 'singleLine',\n min: MIN_DISPLAY_NAME_LENGTH,\n max: MAX_DISPLAY_NAME_LENGTH,\n});\n\n/**\n * A team's name, as `teamNameSchema` reads it at creation and at an admin's rename: trimmed, one\n * line, then bounded by the team-name limits.\n */\nexport const TEAM_NAME_INPUT_FORMAT = defineInputFormat({\n format: 'singleLine',\n min: MIN_TEAM_NAME_LENGTH,\n max: MAX_TEAM_NAME_LENGTH,\n});\n\n/**\n * The number the league reaches a team on, as `contactPhoneSchema` reads it: trimmed, one line,\n * required, and bounded by the contact-phone cap. It is kept as typed — no format is imposed.\n */\nexport const CONTACT_PHONE_INPUT_FORMAT = defineInputFormat({\n format: 'singleLine',\n min: 1,\n max: MAX_CONTACT_PHONE_LENGTH,\n});\n\n/**\n * The account's optional default contact phone on the settings page: the contact-phone format with\n * empty allowed. Empty means remove the saved number — the form sends it as\n * `UpdateAccountSettingsInput.defaultContactPhone: null` — and any other value is held to\n * `CONTACT_PHONE_INPUT_FORMAT`'s trim, one line, and cap.\n */\nexport const OPTIONAL_CONTACT_PHONE_INPUT_FORMAT = defineInputFormat({\n format: 'singleLine',\n min: 0,\n max: MAX_CONTACT_PHONE_LENGTH,\n});\n\n/**\n * An award's name in the catalog, as `awardNameSchema` reads it — at creation, sent with the award's\n * first badge: trimmed, one line, then bounded by the award-name limits.\n */\nexport const AWARD_NAME_INPUT_FORMAT = defineInputFormat({\n format: 'singleLine',\n min: MIN_AWARD_NAME_LENGTH,\n max: MAX_AWARD_NAME_LENGTH,\n});\n\n/**\n * A league's title, as `leagueTitleSchema` reads it at creation and at the settings edit: trimmed,\n * one line, then bounded by the league-title limits.\n */\nexport const LEAGUE_TITLE_INPUT_FORMAT = defineInputFormat({\n format: 'singleLine',\n min: MIN_LEAGUE_TITLE_LENGTH,\n max: MAX_LEAGUE_TITLE_LENGTH,\n});\n\n/**\n * A league's description, as `leagueDescriptionSchema` reads it at creation and at the settings\n * edit: trimmed, then bounded by the league-description limits, line breaks allowed.\n */\nexport const LEAGUE_DESCRIPTION_INPUT_FORMAT = defineInputFormat({\n format: 'none',\n min: MIN_LEAGUE_DESCRIPTION_LENGTH,\n max: MAX_LEAGUE_DESCRIPTION_LENGTH,\n});\n\n/** A venue's name, as `gameLocationNameSchema` reads it: trimmed, one line, required, within its cap. */\nexport const GAME_LOCATION_NAME_INPUT_FORMAT = defineInputFormat({\n format: 'singleLine',\n min: 1,\n max: MAX_GAME_LOCATION_NAME_LENGTH,\n});\n\n/**\n * A venue's street address, as `gameLocationStreetAddressSchema` reads it: trimmed, one line,\n * required, within its cap.\n */\nexport const GAME_LOCATION_STREET_ADDRESS_INPUT_FORMAT = defineInputFormat({\n format: 'singleLine',\n min: 1,\n max: MAX_GAME_LOCATION_STREET_ADDRESS_LENGTH,\n});\n\n/**\n * One court, sheet, or room of a venue, as `gameLocationSubLocationSchema` reads it: trimmed, one\n * line, required, within its cap.\n */\nexport const GAME_LOCATION_SUB_LOCATION_INPUT_FORMAT = defineInputFormat({\n format: 'singleLine',\n min: 1,\n max: MAX_GAME_LOCATION_SUB_LOCATION_LENGTH,\n});\n\n/**\n * A venue's memo, as `gameLocationMemoSchema` reads it: trimmed, line breaks allowed, empty allowed —\n * an empty memo means the venue has none — within its cap.\n */\nexport const GAME_LOCATION_MEMO_INPUT_FORMAT = defineInputFormat({\n format: 'none',\n min: 0,\n max: MAX_GAME_LOCATION_MEMO_LENGTH,\n});\n\n/** A schedule week's name, as `scheduleWeekTitleSchema` reads it: trimmed, one line, required. */\nexport const SCHEDULE_WEEK_TITLE_INPUT_FORMAT = defineInputFormat({\n format: 'singleLine',\n min: 1,\n max: MAX_SCHEDULE_WEEK_TITLE_LENGTH,\n});\n\n/**\n * A waiver template's title, as `waiverTemplateTitleSchema` reads it. A waiver is a legal artifact a\n * player signs, so its words are kept exactly as typed; it still cannot be blank.\n */\nexport const WAIVER_TEMPLATE_TITLE_INPUT_FORMAT = defineInputFormat({\n format: 'singleLine',\n min: 1,\n max: MAX_WAIVER_TEMPLATE_TITLE_LENGTH,\n keepAsTyped: true,\n});\n\n/**\n * A waiver template's wording, as `waiverTemplateTextSchema` reads it: the legal text a player signs,\n * kept exactly as typed, line breaks allowed, never blank.\n */\nexport const WAIVER_TEMPLATE_TEXT_INPUT_FORMAT = defineInputFormat({\n format: 'none',\n min: 1,\n max: MAX_WAIVER_TEMPLATE_TEXT_LENGTH,\n keepAsTyped: true,\n});\n\n/** The landing page's hero title: trimmed, one line; blank shows the default heading. */\nexport const LANDING_HERO_TITLE_INPUT_FORMAT = defineInputFormat({\n format: 'singleLine',\n min: 0,\n max: MAX_LANDING_HERO_TITLE_LENGTH,\n});\n\n/** The landing page's about text: trimmed, line breaks allowed, empty allowed. */\nexport const LANDING_ABOUT_TEXT_INPUT_FORMAT = defineInputFormat({\n format: 'none',\n min: 0,\n max: MAX_LANDING_ABOUT_TEXT_LENGTH,\n});\n\n/** The message shown while the app is in maintenance; empty shows none. */\nexport const MAINTENANCE_MESSAGE_INPUT_FORMAT = defineInputFormat({\n format: 'none',\n min: 0,\n max: MAX_MAINTENANCE_MESSAGE_LENGTH,\n});\n\n/** The site announcement banner; empty clears it. */\nexport const ANNOUNCEMENT_MESSAGE_INPUT_FORMAT = defineInputFormat({\n format: 'none',\n min: 0,\n max: MAX_ANNOUNCEMENT_MESSAGE_LENGTH,\n});\n\n/** The published app version the version gate compares against; never blank. */\nexport const APP_VERSION_INPUT_FORMAT = defineInputFormat({\n format: 'none',\n min: 1,\n max: MAX_APP_VERSION_LENGTH,\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migration-console/index.ts"],"names":[],"mappings":"AAEA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migration-console/index.ts"],"names":[],"mappings":"AAAA,oGAAoG;AAEpG,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC","sourcesContent":["// The 2.0 cutover: its action ids and its manifest, read by the console's callables and its screen.\n\nexport * from './action-ids.js';\nexport * from './manifest.js';\nexport * from './run-state.js';\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export type { FirestoreTimestampLike } from '../doc-schemas/firestore-primitives.js';
|
|
2
|
-
export type { GrantedAward, HistoricalStats, UserProfile } from '../doc-schemas/user-profile.js';
|
|
3
|
-
export type { PublicUser } from '../doc-schemas/publicUser.js';
|
|
4
|
-
export type { SportLeague } from '../doc-schemas/sport-league.js';
|
|
5
|
-
export type { LeagueTeam, LeagueTeamContact } from '../doc-schemas/league-team.js';
|
|
6
|
-
export type { MembershipRosterSync, MembershipRosterSyncCursor, } from '../doc-schemas/membership-roster-sync.js';
|
|
7
|
-
export type { LeagueFreeAgent, TeamJoinRequest, TeamInvitation, TeamMembership, } from '../doc-schemas/team-membership.js';
|
|
8
|
-
export type { BasketballPlayerStats, BasketballStatEvent, BasketballTeamStats, CurlingBlankEndEvent, CurlingRoundScoreEvent, CurlingStatEvent, CurlingTeamStats, FootballStatEvent, FootballTeamStats, GameStatEvent, GameStatEventType, StatCorrectionEvent, StatVoidEvent, } from '../doc-schemas/game-stats.js';
|
|
9
|
-
export type { BasketballGame, BasketballGameStats, CurlingGame, CurlingGameStats, FootballGame, FootballGameStats, GameRosterPlayer, GameStats, GameTeam, SportGame, } from '../doc-schemas/sport-game.js';
|
|
10
|
-
export type { GameStatHistoryContinuationPage, GameStatHistoryFirstPage, GameStatHistoryPage, } from '../doc-schemas/game-stat-history.js';
|
|
11
|
-
export type { BasketballPlayerTotals, BasketballTeamSeasonStats, GamesPlayedStats, PlayerSeasonStats, SportHallOfFame, TeamSeasonBaseStats, TeamSeasonStats, UserLifetimeStats, } from '../doc-schemas/aggregate-stats.js';
|
|
12
|
-
export type { StatsDestinationChange, StatsOperation, StatsOperationCounts, } from '../doc-schemas/stats-operation.js';
|
|
13
|
-
export type { HardwareLoanContract, HardwareItem, SignedWaiver, } from '../doc-schemas/waivers-and-hardware.js';
|
|
14
|
-
export type { WaiverTemplate, WaiverTemplateVersion } from '../doc-schemas/waiver-template.js';
|
|
15
|
-
export type { GameLocation } from '../doc-schemas/game-location.js';
|
|
16
|
-
export type { AwardDefinition } from '../doc-schemas/catalogs.js';
|
|
17
|
-
export type { StatusReconcileQueueAccountStatusEntry, StatusReconcileQueueEntry, StatusReconcileQueueRoleClaimsEntry, } from '../doc-schemas/status-reconcile-queue.js';
|
|
18
|
-
export type { AdminStats } from '../schemas/admin-stats.js';
|
|
19
|
-
export type { GalleryPicture, GallerySummary } from '../doc-schemas/gallery.js';
|
|
20
|
-
export type { PendingMedia, PendingMediaCompleted, PendingMediaErrorCategory, PendingMediaFailed, PendingMediaPending, PendingMediaProcessing, PendingMediaResult, PendingMediaTarget, PictureOwnerRef, StorageObjectRef, } from '../doc-schemas/pending-media.js';
|
|
21
|
-
export type { PictureRetirement, PictureRetirementTarget } from '../doc-schemas/picture-retirement.js';
|
|
22
|
-
export type { AppConfig, LandingPageConfig, AdminList, StatsBeacon, StatsDiscrepancy, StatsValidationReport, StatsValidationScope, StatsValidationSummary, } from '../doc-schemas/system.js';
|
|
23
|
-
export type { ActiveAdminNotification, AdminNotificationHistory, AdminNotificationMetadataByType, LeagueFreeAgentSignedUpNotificationMetadata, LeagueTeamCreatedNotificationMetadata, NotificationArchiveAllJob, NotificationDelivery, NotificationDeliveryPayload, } from '../doc-schemas/admin-notifications.js';
|
|
24
|
-
//# sourceMappingURL=documents.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../src/types/documents.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AACrF,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AACjG,YAAY,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACnF,YAAY,EACV,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,0CAA0C,CAAC;AAClD,YAAY,EACV,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,GACf,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACV,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,GACd,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,SAAS,GACV,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,+BAA+B,EAC/B,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,qCAAqC,CAAC;AAC7C,YAAY,EACV,sBAAsB,EACtB,yBAAyB,EACzB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,iBAAiB,GAClB,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACV,sBAAsB,EACtB,cAAc,EACd,oBAAoB,GACrB,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACV,oBAAoB,EACpB,YAAY,EACZ,YAAY,GACb,MAAM,wCAAwC,CAAC;AAChD,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/F,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,YAAY,EACV,sCAAsC,EACtC,yBAAyB,EACzB,mCAAmC,GACpC,MAAM,0CAA0C,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChF,YAAY,EACV,YAAY,EACZ,qBAAqB,EACrB,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GACjB,MAAM,iCAAiC,CAAC;AACzC,YAAY,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AACvG,YAAY,EACV,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,2CAA2C,EAC3C,qCAAqC,EACrC,yBAAyB,EACzB,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,uCAAuC,CAAC"}
|
package/dist/types/documents.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// Document types. Every shape is defined as a zod schema in ../doc-schemas and its type inferred
|
|
2
|
-
// there; this file re-exports the TYPES so they reach the root barrel while the runtime schemas stay
|
|
3
|
-
// behind the `./doc-schemas` subpath.
|
|
4
|
-
export {};
|
|
5
|
-
//# sourceMappingURL=documents.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../src/types/documents.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,qGAAqG;AACrG,sCAAsC","sourcesContent":["// Document types. Every shape is defined as a zod schema in ../doc-schemas and its type inferred\n// there; this file re-exports the TYPES so they reach the root barrel while the runtime schemas stay\n// behind the `./doc-schemas` subpath.\n\nexport type { FirestoreTimestampLike } from '../doc-schemas/firestore-primitives.js';\nexport type { GrantedAward, HistoricalStats, UserProfile } from '../doc-schemas/user-profile.js';\nexport type { PublicUser } from '../doc-schemas/publicUser.js';\nexport type { SportLeague } from '../doc-schemas/sport-league.js';\nexport type { LeagueTeam, LeagueTeamContact } from '../doc-schemas/league-team.js';\nexport type {\n MembershipRosterSync,\n MembershipRosterSyncCursor,\n} from '../doc-schemas/membership-roster-sync.js';\nexport type {\n LeagueFreeAgent,\n TeamJoinRequest,\n TeamInvitation,\n TeamMembership,\n} from '../doc-schemas/team-membership.js';\nexport type {\n BasketballPlayerStats,\n BasketballStatEvent,\n BasketballTeamStats,\n CurlingBlankEndEvent,\n CurlingRoundScoreEvent,\n CurlingStatEvent,\n CurlingTeamStats,\n FootballStatEvent,\n FootballTeamStats,\n GameStatEvent,\n GameStatEventType,\n StatCorrectionEvent,\n StatVoidEvent,\n} from '../doc-schemas/game-stats.js';\nexport type {\n BasketballGame,\n BasketballGameStats,\n CurlingGame,\n CurlingGameStats,\n FootballGame,\n FootballGameStats,\n GameRosterPlayer,\n GameStats,\n GameTeam,\n SportGame,\n} from '../doc-schemas/sport-game.js';\nexport type {\n GameStatHistoryContinuationPage,\n GameStatHistoryFirstPage,\n GameStatHistoryPage,\n} from '../doc-schemas/game-stat-history.js';\nexport type {\n BasketballPlayerTotals,\n BasketballTeamSeasonStats,\n GamesPlayedStats,\n PlayerSeasonStats,\n SportHallOfFame,\n TeamSeasonBaseStats,\n TeamSeasonStats,\n UserLifetimeStats,\n} from '../doc-schemas/aggregate-stats.js';\nexport type {\n StatsDestinationChange,\n StatsOperation,\n StatsOperationCounts,\n} from '../doc-schemas/stats-operation.js';\nexport type {\n HardwareLoanContract,\n HardwareItem,\n SignedWaiver,\n} from '../doc-schemas/waivers-and-hardware.js';\nexport type { WaiverTemplate, WaiverTemplateVersion } from '../doc-schemas/waiver-template.js';\nexport type { GameLocation } from '../doc-schemas/game-location.js';\nexport type { AwardDefinition } from '../doc-schemas/catalogs.js';\nexport type {\n StatusReconcileQueueAccountStatusEntry,\n StatusReconcileQueueEntry,\n StatusReconcileQueueRoleClaimsEntry,\n} from '../doc-schemas/status-reconcile-queue.js';\nexport type { AdminStats } from '../schemas/admin-stats.js';\nexport type { GalleryPicture, GallerySummary } from '../doc-schemas/gallery.js';\nexport type {\n PendingMedia,\n PendingMediaCompleted,\n PendingMediaErrorCategory,\n PendingMediaFailed,\n PendingMediaPending,\n PendingMediaProcessing,\n PendingMediaResult,\n PendingMediaTarget,\n PictureOwnerRef,\n StorageObjectRef,\n} from '../doc-schemas/pending-media.js';\nexport type { PictureRetirement, PictureRetirementTarget } from '../doc-schemas/picture-retirement.js';\nexport type {\n AppConfig,\n LandingPageConfig,\n AdminList,\n StatsBeacon,\n StatsDiscrepancy,\n StatsValidationReport,\n StatsValidationScope,\n StatsValidationSummary,\n} from '../doc-schemas/system.js';\nexport type {\n ActiveAdminNotification,\n AdminNotificationHistory,\n AdminNotificationMetadataByType,\n LeagueFreeAgentSignedUpNotificationMetadata,\n LeagueTeamCreatedNotificationMetadata,\n NotificationArchiveAllJob,\n NotificationDelivery,\n NotificationDeliveryPayload,\n} from '../doc-schemas/admin-notifications.js';\n"]}
|