@ttt-productions/q-core 0.1.39 → 0.1.41
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/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/sports.d.ts +0 -6
- package/dist/constants/sports.d.ts.map +1 -1
- package/dist/constants/sports.js +0 -6
- package/dist/constants/sports.js.map +1 -1
- package/dist/constants/text-fields.d.ts +147 -0
- package/dist/constants/text-fields.d.ts.map +1 -0
- package/dist/{input-formats/input-formats.js → constants/text-fields.js} +50 -26
- package/dist/constants/text-fields.js.map +1 -0
- package/dist/doc-schemas/atoms.d.ts +0 -13
- package/dist/doc-schemas/atoms.d.ts.map +1 -1
- package/dist/doc-schemas/atoms.js +3 -28
- package/dist/doc-schemas/atoms.js.map +1 -1
- package/dist/doc-schemas/audit-event.d.ts +0 -2
- package/dist/doc-schemas/audit-event.d.ts.map +1 -1
- package/dist/doc-schemas/catalogs.d.ts.map +1 -1
- package/dist/doc-schemas/catalogs.js +4 -3
- package/dist/doc-schemas/catalogs.js.map +1 -1
- package/dist/doc-schemas/game-location.d.ts.map +1 -1
- package/dist/doc-schemas/game-location.js +7 -6
- package/dist/doc-schemas/game-location.js.map +1 -1
- package/dist/doc-schemas/league-team.d.ts.map +1 -1
- package/dist/doc-schemas/league-team.js +5 -4
- package/dist/doc-schemas/league-team.js.map +1 -1
- package/dist/doc-schemas/migration-console.d.ts.map +1 -1
- package/dist/doc-schemas/migration-console.js +4 -3
- package/dist/doc-schemas/migration-console.js.map +1 -1
- package/dist/doc-schemas/registry.d.ts +0 -75
- package/dist/doc-schemas/registry.d.ts.map +1 -1
- package/dist/doc-schemas/sport-game.d.ts +0 -6
- package/dist/doc-schemas/sport-game.d.ts.map +1 -1
- package/dist/doc-schemas/sport-game.js +5 -5
- 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 +5 -4
- package/dist/doc-schemas/sport-league.js.map +1 -1
- package/dist/doc-schemas/stats-operation.d.ts +0 -141
- package/dist/doc-schemas/stats-operation.d.ts.map +1 -1
- package/dist/doc-schemas/stats-operation.js +2 -41
- package/dist/doc-schemas/stats-operation.js.map +1 -1
- package/dist/doc-schemas/system.d.ts +0 -3
- package/dist/doc-schemas/system.d.ts.map +1 -1
- package/dist/doc-schemas/system.js +7 -6
- package/dist/doc-schemas/system.js.map +1 -1
- package/dist/doc-schemas/team-membership.js +5 -4
- package/dist/doc-schemas/team-membership.js.map +1 -1
- package/dist/doc-schemas/user-profile.d.ts.map +1 -1
- package/dist/doc-schemas/user-profile.js +5 -4
- 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 +5 -4
- package/dist/doc-schemas/waiver-template.js.map +1 -1
- package/dist/ids/index.d.ts +0 -1
- package/dist/ids/index.d.ts.map +1 -1
- package/dist/ids/index.js +0 -1
- package/dist/ids/index.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/schemas/app-config.d.ts.map +1 -1
- package/dist/schemas/app-config.js +8 -7
- package/dist/schemas/app-config.js.map +1 -1
- package/dist/schemas/atoms.d.ts.map +1 -1
- package/dist/schemas/atoms.js +8 -7
- package/dist/schemas/atoms.js.map +1 -1
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/leagues.d.ts.map +1 -1
- package/dist/schemas/leagues.js +5 -4
- package/dist/schemas/leagues.js.map +1 -1
- package/dist/schemas/schedules.d.ts +0 -4
- package/dist/schemas/schedules.d.ts.map +1 -1
- package/dist/schemas/schedules.js +5 -9
- package/dist/schemas/schedules.js.map +1 -1
- package/dist/schemas/scoring.d.ts +6 -6
- package/dist/schemas/scoring.d.ts.map +1 -1
- package/dist/schemas/scoring.js +4 -3
- package/dist/schemas/scoring.js.map +1 -1
- package/dist/schemas/stats.d.ts +0 -1
- package/dist/schemas/stats.d.ts.map +1 -1
- package/dist/schemas/teams.d.ts +4 -16
- package/dist/schemas/teams.d.ts.map +1 -1
- package/dist/schemas/teams.js +4 -16
- package/dist/schemas/teams.js.map +1 -1
- package/dist/schemas/text-field.d.ts +4 -0
- package/dist/schemas/text-field.d.ts.map +1 -0
- package/dist/schemas/text-field.js +12 -0
- package/dist/schemas/text-field.js.map +1 -0
- package/dist/schemas/waiver-templates.d.ts.map +1 -1
- package/dist/schemas/waiver-templates.js +4 -4
- package/dist/schemas/waiver-templates.js.map +1 -1
- package/dist/sports/contribution.d.ts +3 -10
- package/dist/sports/contribution.d.ts.map +1 -1
- package/dist/sports/contribution.js +10 -9
- package/dist/sports/contribution.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 +0 -1
- package/dist/types/audit.js.map +1 -1
- package/dist/types/schedules.d.ts +1 -1
- package/dist/types/schedules.d.ts.map +1 -1
- package/dist/types/schedules.js +1 -2
- package/dist/types/schedules.js.map +1 -1
- package/dist/types/stats.d.ts +3 -7
- package/dist/types/stats.d.ts.map +1 -1
- package/dist/types/stats.js +1 -16
- package/dist/types/stats.js.map +1 -1
- package/dist/types/unions.d.ts +2 -2
- package/dist/types/unions.d.ts.map +1 -1
- package/dist/types/unions.js +0 -1
- package/dist/types/unions.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/text-field.d.ts +15 -0
- package/dist/utils/text-field.d.ts.map +1 -0
- package/dist/utils/text-field.js +32 -0
- package/dist/utils/text-field.js.map +1 -0
- package/package.json +1 -1
- package/dist/ids/stats-operation-ids.d.ts +0 -3
- package/dist/ids/stats-operation-ids.d.ts.map +0 -1
- package/dist/ids/stats-operation-ids.js +0 -10
- package/dist/ids/stats-operation-ids.js.map +0 -1
- package/dist/input-formats/input-formats.d.ts +0 -123
- package/dist/input-formats/input-formats.d.ts.map +0 -1
- package/dist/input-formats/input-formats.js.map +0 -1
package/dist/schemas/teams.js
CHANGED
|
@@ -85,9 +85,7 @@ export const LinkGhostPlayerResultSchema = z
|
|
|
85
85
|
teamId: teamIdSchema,
|
|
86
86
|
ghostUserId: userIdSchema,
|
|
87
87
|
userId: userIdSchema,
|
|
88
|
-
|
|
89
|
-
gamesMoved: countSchema,
|
|
90
|
-
membershipOutcome: z.enum(GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS).optional(),
|
|
88
|
+
membershipOutcome: z.enum(GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS),
|
|
91
89
|
publicUserDeleted: z.boolean(),
|
|
92
90
|
})
|
|
93
91
|
.strict();
|
|
@@ -133,16 +131,12 @@ export const DeleteTeamGhostPlayerResultSchema = z
|
|
|
133
131
|
leagueId: leagueIdSchema,
|
|
134
132
|
teamId: teamIdSchema,
|
|
135
133
|
ghostUserId: userIdSchema,
|
|
136
|
-
complete: z.boolean(),
|
|
137
134
|
finishedGameEntriesRemoved: countSchema,
|
|
138
135
|
publicUserDeleted: z.boolean(),
|
|
139
136
|
})
|
|
140
137
|
.strict();
|
|
141
138
|
export const GhostRemovalRefusalDetailsSchema = z
|
|
142
|
-
.object({
|
|
143
|
-
reason: z.enum(GHOST_REMOVAL_REFUSAL_KEYS),
|
|
144
|
-
finishedGameEntriesRemoved: countSchema.optional(),
|
|
145
|
-
})
|
|
139
|
+
.object({ reason: z.enum(GHOST_REMOVAL_REFUSAL_KEYS) })
|
|
146
140
|
.strict();
|
|
147
141
|
export const AdminUpdateLeagueTeamCaptainInputSchema = z
|
|
148
142
|
.object({ teamId: teamIdSchema, captainUserId: userIdSchema })
|
|
@@ -170,15 +164,9 @@ export const AdminUpdateLeagueTeamContactInputSchema = z
|
|
|
170
164
|
.strict();
|
|
171
165
|
export const AdminUpdateLeagueTeamContactResultSchema = AdminUpdateLeagueTeamResultSchema;
|
|
172
166
|
export const AdminDeleteLeagueTeamInputSchema = z.object({ teamId: teamIdSchema }).strict();
|
|
173
|
-
export const AdminDeleteLeagueTeamResultSchema = z
|
|
174
|
-
.object({
|
|
175
|
-
teamId: teamIdSchema,
|
|
176
|
-
complete: z.boolean(),
|
|
177
|
-
remainingGameCount: countSchema,
|
|
178
|
-
})
|
|
179
|
-
.strict();
|
|
167
|
+
export const AdminDeleteLeagueTeamResultSchema = z.object({ teamId: teamIdSchema }).strict();
|
|
180
168
|
export const LEAGUE_TEAM_DELETE_REFUSAL_KEYS = ['teamHasPlayed'];
|
|
181
169
|
export const LeagueTeamDeleteRefusalDetailsSchema = z
|
|
182
|
-
.object({ reason: z.enum(LEAGUE_TEAM_DELETE_REFUSAL_KEYS)
|
|
170
|
+
.object({ reason: z.enum(LEAGUE_TEAM_DELETE_REFUSAL_KEYS) })
|
|
183
171
|
.strict();
|
|
184
172
|
//# sourceMappingURL=teams.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teams.js","sourceRoot":"","sources":["../../src/schemas/teams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,YAAY,EACZ,cAAc,EACd,gCAAgC,EAChC,cAAc,EACd,YAAY,EACZ,cAAc,EACd,cAAc,EACd,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC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EAAE,WAAW;CAChC,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,eAAe,CAAU,CAAC;AAE1E,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,+BAA+B,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAC;KAC1F,MAAM,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n leagueJoinWarningActedOnSchema,\n leagueJoinWarningFindingSchema,\n} from '../utils/league-join-warning.js';\nimport {\n countSchema,\n documentIdSegmentSchema,\n gameIdSchema,\n leagueIdSchema,\n membershipRosterSyncStatusSchema,\n teamIconSchema,\n teamIdSchema,\n teamRoleSchema,\n teamTypeSchema,\n userIdSchema,\n} from '../doc-schemas/atoms.js';\nimport { buildGhostUserIdForRequest, isGhostUserId } from '../ids/minted-ids.js';\nimport { isDocumentIdSegment } from '../paths/utils.js';\nimport { GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS, GHOST_REMOVAL_REFUSAL_KEYS } from '../types/stats.js';\nimport { MEMBER_ASSIGNABLE_TEAM_ROLES } from '../types/unions.js';\nimport { contactPhoneSchema, displayNameSchema, teamNameSchema } from './atoms.js';\n\nconst teamCreationFields = {\n leagueId: leagueIdSchema,\n name: teamNameSchema,\n icon: teamIconSchema,\n teamType: teamTypeSchema.optional(),\n contactPhone: contactPhoneSchema,\n};\n\nexport const CreateLeagueTeamInputSchema = z.object(teamCreationFields).strict();\nexport type CreateLeagueTeamInput = z.infer<typeof CreateLeagueTeamInputSchema>;\n\nexport const AdminCreateLeagueTeamInputSchema = z\n .object({ ...teamCreationFields, captainDisplayName: displayNameSchema })\n .strict();\nexport type AdminCreateLeagueTeamInput = z.infer<typeof AdminCreateLeagueTeamInputSchema>;\n\nexport const CreateLeagueTeamResultSchema = z\n .object({ leagueId: leagueIdSchema, teamId: teamIdSchema, captainUserId: userIdSchema })\n .strict();\nexport type CreateLeagueTeamResult = z.infer<typeof CreateLeagueTeamResultSchema>;\n\nexport const ghostCreateRequestIdSchema = documentIdSegmentSchema.refine(\n (requestId) => isDocumentIdSegment(buildGhostUserIdForRequest(requestId)),\n 'Not a ghost add request id.',\n);\n\nexport const CreateTeamGhostPlayerInputSchema = z\n .object({\n teamId: teamIdSchema,\n displayName: displayNameSchema,\n requestId: ghostCreateRequestIdSchema,\n })\n .strict();\nexport type CreateTeamGhostPlayerInput = z.infer<typeof CreateTeamGhostPlayerInputSchema>;\n\nexport const CreateGameGhostPlayerInputSchema = z\n .object({\n gameId: gameIdSchema,\n teamId: teamIdSchema,\n displayName: displayNameSchema,\n requestId: ghostCreateRequestIdSchema,\n })\n .strict();\nexport type CreateGameGhostPlayerInput = z.infer<typeof CreateGameGhostPlayerInputSchema>;\n\nexport const CreateGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n rosterSyncStatus: membershipRosterSyncStatusSchema,\n })\n .strict();\nexport type CreateGhostPlayerResult = z.infer<typeof CreateGhostPlayerResultSchema>;\n\nexport const GetLeagueJoinWarningInputSchema = z\n .object({\n leagueId: leagueIdSchema,\n userId: userIdSchema,\n targetTeamId: teamIdSchema.optional(),\n actedOn: leagueJoinWarningActedOnSchema.optional(),\n })\n .strict();\nexport type GetLeagueJoinWarningInput = z.infer<typeof GetLeagueJoinWarningInputSchema>;\n\nexport const GetLeagueJoinWarningResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n userId: userIdSchema,\n findings: z.array(leagueJoinWarningFindingSchema),\n })\n .strict();\nexport type GetLeagueJoinWarningResult = z.infer<typeof GetLeagueJoinWarningResultSchema>;\n\nexport const AdminRetryLeagueTeamRosterSyncInputSchema = z\n .object({ teamId: teamIdSchema })\n .strict();\nexport type AdminRetryLeagueTeamRosterSyncInput = z.infer<\n typeof AdminRetryLeagueTeamRosterSyncInputSchema\n>;\n\nexport const AdminRetryLeagueTeamRosterSyncResultSchema = z\n .object({\n teamId: teamIdSchema,\n retried: countSchema,\n // null when the immediate attempt after the commit did not run; the scheduler still finishes\n // every obligation the retry re-armed.\n reconciled: countSchema.nullable(),\n damagedTeamMembershipIds: z.array(z.string().min(1)),\n })\n .strict();\nexport type AdminRetryLeagueTeamRosterSyncResult = z.infer<\n typeof AdminRetryLeagueTeamRosterSyncResultSchema\n>;\n\nexport const LinkGhostPlayerInputSchema = z\n .object({\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n userId: userIdSchema,\n })\n .strict();\nexport type LinkGhostPlayerInput = z.infer<typeof LinkGhostPlayerInputSchema>;\n\nexport const LinkGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n userId: userIdSchema,\n complete: z.boolean(),\n gamesMoved: countSchema,\n membershipOutcome: z.enum(GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS).optional(),\n publicUserDeleted: z.boolean(),\n })\n .strict();\nexport type LinkGhostPlayerResult = z.infer<typeof LinkGhostPlayerResultSchema>;\n\nexport const AdminLinkClosedLeagueGhostPlayerInputSchema = LinkGhostPlayerInputSchema;\nexport type AdminLinkClosedLeagueGhostPlayerInput = LinkGhostPlayerInput;\nexport const AdminLinkClosedLeagueGhostPlayerResultSchema = LinkGhostPlayerResultSchema;\nexport type AdminLinkClosedLeagueGhostPlayerResult = LinkGhostPlayerResult;\n\nexport const ghostUserIdSchema = userIdSchema.refine(isGhostUserId, 'Not a ghost player.');\n\nexport const UpdateTeamMembershipRoleInputSchema = z\n .object({\n teamId: teamIdSchema,\n userId: userIdSchema,\n role: z.enum(MEMBER_ASSIGNABLE_TEAM_ROLES),\n })\n .strict();\nexport type UpdateTeamMembershipRoleInput = z.infer<typeof UpdateTeamMembershipRoleInputSchema>;\n\nexport const UpdateTeamMembershipRoleResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n role: teamRoleSchema,\n changed: z.boolean(),\n })\n .strict();\nexport type UpdateTeamMembershipRoleResult = z.infer<typeof UpdateTeamMembershipRoleResultSchema>;\n\nexport const DeleteTeamMembershipInputSchema = z\n .object({\n teamId: teamIdSchema,\n userId: userIdSchema.refine(\n (userId) => !isGhostUserId(userId),\n 'A ghost player is removed as a ghost player.',\n ),\n })\n .strict();\nexport type DeleteTeamMembershipInput = z.infer<typeof DeleteTeamMembershipInputSchema>;\n\nexport const DeleteTeamMembershipResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n deleted: z.boolean(),\n rosterSyncStatus: membershipRosterSyncStatusSchema,\n })\n .strict();\nexport type DeleteTeamMembershipResult = z.infer<typeof DeleteTeamMembershipResultSchema>;\n\nexport const DeleteTeamGhostPlayerInputSchema = z\n .object({ teamId: teamIdSchema, ghostUserId: ghostUserIdSchema })\n .strict();\nexport type DeleteTeamGhostPlayerInput = z.infer<typeof DeleteTeamGhostPlayerInputSchema>;\n\nexport const DeleteTeamGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n complete: z.boolean(),\n finishedGameEntriesRemoved: countSchema,\n publicUserDeleted: z.boolean(),\n })\n .strict();\nexport type DeleteTeamGhostPlayerResult = z.infer<typeof DeleteTeamGhostPlayerResultSchema>;\n\nexport const GhostRemovalRefusalDetailsSchema = z\n .object({\n reason: z.enum(GHOST_REMOVAL_REFUSAL_KEYS),\n finishedGameEntriesRemoved: countSchema.optional(),\n })\n .strict();\nexport type GhostRemovalRefusalDetails = z.infer<typeof GhostRemovalRefusalDetailsSchema>;\n\nexport const AdminUpdateLeagueTeamCaptainInputSchema = z\n .object({ teamId: teamIdSchema, captainUserId: userIdSchema })\n .strict();\nexport type AdminUpdateLeagueTeamCaptainInput = z.infer<\n typeof AdminUpdateLeagueTeamCaptainInputSchema\n>;\n\nexport const AdminUpdateLeagueTeamCaptainResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n captainUserId: userIdSchema,\n demotedUserIds: z.array(userIdSchema),\n changed: z.boolean(),\n })\n .strict();\nexport type AdminUpdateLeagueTeamCaptainResult = z.infer<\n typeof AdminUpdateLeagueTeamCaptainResultSchema\n>;\n\nexport const AdminUpdateLeagueTeamNameInputSchema = z\n .object({ teamId: teamIdSchema, name: teamNameSchema })\n .strict();\nexport type AdminUpdateLeagueTeamNameInput = z.infer<typeof AdminUpdateLeagueTeamNameInputSchema>;\n\nexport const AdminUpdateLeagueTeamTypeInputSchema = z\n .object({ teamId: teamIdSchema, teamType: teamTypeSchema })\n .strict();\nexport type AdminUpdateLeagueTeamTypeInput = z.infer<typeof AdminUpdateLeagueTeamTypeInputSchema>;\n\nexport const AdminUpdateLeagueTeamResultSchema = z\n .object({ leagueId: leagueIdSchema, teamId: teamIdSchema, changed: z.boolean() })\n .strict();\nexport type AdminUpdateLeagueTeamResult = z.infer<typeof AdminUpdateLeagueTeamResultSchema>;\n\nexport const AdminUpdateLeagueTeamContactInputSchema = z\n .object({ teamId: teamIdSchema, contactPhone: contactPhoneSchema })\n .strict();\nexport type AdminUpdateLeagueTeamContactInput = z.infer<\n typeof AdminUpdateLeagueTeamContactInputSchema\n>;\n\nexport const AdminUpdateLeagueTeamContactResultSchema = AdminUpdateLeagueTeamResultSchema;\nexport type AdminUpdateLeagueTeamContactResult = AdminUpdateLeagueTeamResult;\n\nexport const AdminDeleteLeagueTeamInputSchema = z.object({ teamId: teamIdSchema }).strict();\nexport type AdminDeleteLeagueTeamInput = z.infer<typeof AdminDeleteLeagueTeamInputSchema>;\n\nexport const AdminDeleteLeagueTeamResultSchema = z\n .object({\n teamId: teamIdSchema,\n complete: z.boolean(),\n remainingGameCount: countSchema,\n })\n .strict();\nexport type AdminDeleteLeagueTeamResult = z.infer<typeof AdminDeleteLeagueTeamResultSchema>;\n\nexport const LEAGUE_TEAM_DELETE_REFUSAL_KEYS = ['teamHasPlayed'] as const;\nexport type LeagueTeamDeleteRefusal = (typeof LEAGUE_TEAM_DELETE_REFUSAL_KEYS)[number];\nexport const LeagueTeamDeleteRefusalDetailsSchema = z\n .object({ reason: z.enum(LEAGUE_TEAM_DELETE_REFUSAL_KEYS), deletedGameCount: countSchema })\n .strict();\nexport type LeagueTeamDeleteRefusalDetails = z.infer<typeof LeagueTeamDeleteRefusalDetailsSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"teams.js","sourceRoot":"","sources":["../../src/schemas/teams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,YAAY,EACZ,cAAc,EACd,gCAAgC,EAChC,cAAc,EACd,YAAY,EACZ,cAAc,EACd,cAAc,EACd,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,kCAAkC,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEnF,MAAM,kBAAkB,GAAG;IACzB,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE;IACnC,YAAY,EAAE,kBAAkB;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,MAAM,EAAE,CAAC;AA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E,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;KAChF,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC;KACrD,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,CAAC;KAClE,MAAM,EAAE,CAAC;AAKZ,MAAM,CAAC,MAAM,wCAAwC,GAAG,iCAAiC,CAAC;AAG1F,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAG5F,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAG7F,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,eAAe,CAAU,CAAC;AAE1E,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,+BAA+B,CAAC,EAAE,CAAC;KAC3D,MAAM,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n leagueJoinWarningActedOnSchema,\n leagueJoinWarningFindingSchema,\n} from '../utils/league-join-warning.js';\nimport {\n countSchema,\n documentIdSegmentSchema,\n gameIdSchema,\n leagueIdSchema,\n membershipRosterSyncStatusSchema,\n teamIconSchema,\n teamIdSchema,\n teamRoleSchema,\n teamTypeSchema,\n userIdSchema,\n} from '../doc-schemas/atoms.js';\nimport { buildGhostUserIdForRequest, isGhostUserId } from '../ids/minted-ids.js';\nimport { isDocumentIdSegment } from '../paths/utils.js';\nimport { GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS, GHOST_REMOVAL_REFUSAL_KEYS } from '../types/stats.js';\nimport { MEMBER_ASSIGNABLE_TEAM_ROLES } from '../types/unions.js';\nimport { contactPhoneSchema, displayNameSchema, teamNameSchema } from './atoms.js';\n\nconst teamCreationFields = {\n leagueId: leagueIdSchema,\n name: teamNameSchema,\n icon: teamIconSchema,\n teamType: teamTypeSchema.optional(),\n contactPhone: contactPhoneSchema,\n};\n\nexport const CreateLeagueTeamInputSchema = z.object(teamCreationFields).strict();\nexport type CreateLeagueTeamInput = z.infer<typeof CreateLeagueTeamInputSchema>;\n\nexport const AdminCreateLeagueTeamInputSchema = z\n .object({ ...teamCreationFields, captainDisplayName: displayNameSchema })\n .strict();\nexport type AdminCreateLeagueTeamInput = z.infer<typeof AdminCreateLeagueTeamInputSchema>;\n\nexport const CreateLeagueTeamResultSchema = z\n .object({ leagueId: leagueIdSchema, teamId: teamIdSchema, captainUserId: userIdSchema })\n .strict();\nexport type CreateLeagueTeamResult = z.infer<typeof CreateLeagueTeamResultSchema>;\n\nexport const ghostCreateRequestIdSchema = documentIdSegmentSchema.refine(\n (requestId) => isDocumentIdSegment(buildGhostUserIdForRequest(requestId)),\n 'Not a ghost add request id.',\n);\n\nexport const CreateTeamGhostPlayerInputSchema = z\n .object({\n teamId: teamIdSchema,\n displayName: displayNameSchema,\n requestId: ghostCreateRequestIdSchema,\n })\n .strict();\nexport type CreateTeamGhostPlayerInput = z.infer<typeof CreateTeamGhostPlayerInputSchema>;\n\nexport const CreateGameGhostPlayerInputSchema = z\n .object({\n gameId: gameIdSchema,\n teamId: teamIdSchema,\n displayName: displayNameSchema,\n requestId: ghostCreateRequestIdSchema,\n })\n .strict();\nexport type CreateGameGhostPlayerInput = z.infer<typeof CreateGameGhostPlayerInputSchema>;\n\nexport const CreateGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n rosterSyncStatus: membershipRosterSyncStatusSchema,\n })\n .strict();\nexport type CreateGhostPlayerResult = z.infer<typeof CreateGhostPlayerResultSchema>;\n\nexport const GetLeagueJoinWarningInputSchema = z\n .object({\n leagueId: leagueIdSchema,\n userId: userIdSchema,\n targetTeamId: teamIdSchema.optional(),\n actedOn: leagueJoinWarningActedOnSchema.optional(),\n })\n .strict();\nexport type GetLeagueJoinWarningInput = z.infer<typeof GetLeagueJoinWarningInputSchema>;\n\nexport const GetLeagueJoinWarningResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n userId: userIdSchema,\n findings: z.array(leagueJoinWarningFindingSchema),\n })\n .strict();\nexport type GetLeagueJoinWarningResult = z.infer<typeof GetLeagueJoinWarningResultSchema>;\n\nexport const AdminRetryLeagueTeamRosterSyncInputSchema = z\n .object({ teamId: teamIdSchema })\n .strict();\nexport type AdminRetryLeagueTeamRosterSyncInput = z.infer<\n typeof AdminRetryLeagueTeamRosterSyncInputSchema\n>;\n\nexport const AdminRetryLeagueTeamRosterSyncResultSchema = z\n .object({\n teamId: teamIdSchema,\n retried: countSchema,\n // null when the immediate attempt after the commit did not run; the scheduler still finishes\n // every obligation the retry re-armed.\n reconciled: countSchema.nullable(),\n damagedTeamMembershipIds: z.array(z.string().min(1)),\n })\n .strict();\nexport type AdminRetryLeagueTeamRosterSyncResult = z.infer<\n typeof AdminRetryLeagueTeamRosterSyncResultSchema\n>;\n\nexport const LinkGhostPlayerInputSchema = z\n .object({\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n userId: userIdSchema,\n })\n .strict();\nexport type LinkGhostPlayerInput = z.infer<typeof LinkGhostPlayerInputSchema>;\n\nexport const LinkGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n userId: userIdSchema,\n membershipOutcome: z.enum(GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS),\n publicUserDeleted: z.boolean(),\n })\n .strict();\nexport type LinkGhostPlayerResult = z.infer<typeof LinkGhostPlayerResultSchema>;\n\nexport const AdminLinkClosedLeagueGhostPlayerInputSchema = LinkGhostPlayerInputSchema;\nexport type AdminLinkClosedLeagueGhostPlayerInput = LinkGhostPlayerInput;\nexport const AdminLinkClosedLeagueGhostPlayerResultSchema = LinkGhostPlayerResultSchema;\nexport type AdminLinkClosedLeagueGhostPlayerResult = LinkGhostPlayerResult;\n\nexport const ghostUserIdSchema = userIdSchema.refine(isGhostUserId, 'Not a ghost player.');\n\nexport const UpdateTeamMembershipRoleInputSchema = z\n .object({\n teamId: teamIdSchema,\n userId: userIdSchema,\n role: z.enum(MEMBER_ASSIGNABLE_TEAM_ROLES),\n })\n .strict();\nexport type UpdateTeamMembershipRoleInput = z.infer<typeof UpdateTeamMembershipRoleInputSchema>;\n\nexport const UpdateTeamMembershipRoleResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n role: teamRoleSchema,\n changed: z.boolean(),\n })\n .strict();\nexport type UpdateTeamMembershipRoleResult = z.infer<typeof UpdateTeamMembershipRoleResultSchema>;\n\nexport const DeleteTeamMembershipInputSchema = z\n .object({\n teamId: teamIdSchema,\n userId: userIdSchema.refine(\n (userId) => !isGhostUserId(userId),\n 'A ghost player is removed as a ghost player.',\n ),\n })\n .strict();\nexport type DeleteTeamMembershipInput = z.infer<typeof DeleteTeamMembershipInputSchema>;\n\nexport const DeleteTeamMembershipResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n deleted: z.boolean(),\n rosterSyncStatus: membershipRosterSyncStatusSchema,\n })\n .strict();\nexport type DeleteTeamMembershipResult = z.infer<typeof DeleteTeamMembershipResultSchema>;\n\nexport const DeleteTeamGhostPlayerInputSchema = z\n .object({ teamId: teamIdSchema, ghostUserId: ghostUserIdSchema })\n .strict();\nexport type DeleteTeamGhostPlayerInput = z.infer<typeof DeleteTeamGhostPlayerInputSchema>;\n\nexport const DeleteTeamGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n finishedGameEntriesRemoved: countSchema,\n publicUserDeleted: z.boolean(),\n })\n .strict();\nexport type DeleteTeamGhostPlayerResult = z.infer<typeof DeleteTeamGhostPlayerResultSchema>;\n\nexport const GhostRemovalRefusalDetailsSchema = z\n .object({ reason: z.enum(GHOST_REMOVAL_REFUSAL_KEYS) })\n .strict();\nexport type GhostRemovalRefusalDetails = z.infer<typeof GhostRemovalRefusalDetailsSchema>;\n\nexport const AdminUpdateLeagueTeamCaptainInputSchema = z\n .object({ teamId: teamIdSchema, captainUserId: userIdSchema })\n .strict();\nexport type AdminUpdateLeagueTeamCaptainInput = z.infer<\n typeof AdminUpdateLeagueTeamCaptainInputSchema\n>;\n\nexport const AdminUpdateLeagueTeamCaptainResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n captainUserId: userIdSchema,\n demotedUserIds: z.array(userIdSchema),\n changed: z.boolean(),\n })\n .strict();\nexport type AdminUpdateLeagueTeamCaptainResult = z.infer<\n typeof AdminUpdateLeagueTeamCaptainResultSchema\n>;\n\nexport const AdminUpdateLeagueTeamNameInputSchema = z\n .object({ teamId: teamIdSchema, name: teamNameSchema })\n .strict();\nexport type AdminUpdateLeagueTeamNameInput = z.infer<typeof AdminUpdateLeagueTeamNameInputSchema>;\n\nexport const AdminUpdateLeagueTeamTypeInputSchema = z\n .object({ teamId: teamIdSchema, teamType: teamTypeSchema })\n .strict();\nexport type AdminUpdateLeagueTeamTypeInput = z.infer<typeof AdminUpdateLeagueTeamTypeInputSchema>;\n\nexport const AdminUpdateLeagueTeamResultSchema = z\n .object({ leagueId: leagueIdSchema, teamId: teamIdSchema, changed: z.boolean() })\n .strict();\nexport type AdminUpdateLeagueTeamResult = z.infer<typeof AdminUpdateLeagueTeamResultSchema>;\n\nexport const AdminUpdateLeagueTeamContactInputSchema = z\n .object({ teamId: teamIdSchema, contactPhone: contactPhoneSchema })\n .strict();\nexport type AdminUpdateLeagueTeamContactInput = z.infer<\n typeof AdminUpdateLeagueTeamContactInputSchema\n>;\n\nexport const AdminUpdateLeagueTeamContactResultSchema = AdminUpdateLeagueTeamResultSchema;\nexport type AdminUpdateLeagueTeamContactResult = AdminUpdateLeagueTeamResult;\n\nexport const AdminDeleteLeagueTeamInputSchema = z.object({ teamId: teamIdSchema }).strict();\nexport type AdminDeleteLeagueTeamInput = z.infer<typeof AdminDeleteLeagueTeamInputSchema>;\n\nexport const AdminDeleteLeagueTeamResultSchema = z.object({ teamId: teamIdSchema }).strict();\nexport type AdminDeleteLeagueTeamResult = z.infer<typeof AdminDeleteLeagueTeamResultSchema>;\n\nexport const LEAGUE_TEAM_DELETE_REFUSAL_KEYS = ['teamHasPlayed'] as const;\nexport type LeagueTeamDeleteRefusal = (typeof LEAGUE_TEAM_DELETE_REFUSAL_KEYS)[number];\nexport const LeagueTeamDeleteRefusalDetailsSchema = z\n .object({ reason: z.enum(LEAGUE_TEAM_DELETE_REFUSAL_KEYS) })\n .strict();\nexport type LeagueTeamDeleteRefusalDetails = z.infer<typeof LeagueTeamDeleteRefusalDetailsSchema>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../src/schemas/text-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,KAAK,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnF,wBAAgB,eAAe,CAAC,WAAW,EAAE,oBAAoB,0DAOhE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { checkTextField } from '../utils/text-field.js';
|
|
3
|
+
export function textFieldSchema(declaration) {
|
|
4
|
+
return z.string().transform((text, ctx) => {
|
|
5
|
+
const result = checkTextField(declaration, text);
|
|
6
|
+
if (result.ok)
|
|
7
|
+
return result.value;
|
|
8
|
+
ctx.addIssue({ code: 'custom', message: result.reason, input: text });
|
|
9
|
+
return z.NEVER;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=text-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-field.js","sourceRoot":"","sources":["../../src/schemas/text-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAA6B,MAAM,wBAAwB,CAAC;AAEnF,MAAM,UAAU,eAAe,CAAC,WAAiC;IAC/D,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QACxC,MAAM,MAAM,GAAG,cAAc,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QACjD,IAAI,MAAM,CAAC,EAAE;YAAE,OAAO,MAAM,CAAC,KAAK,CAAC;QACnC,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACtE,OAAO,CAAC,CAAC,KAAK,CAAC;IACjB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { z } from 'zod';\nimport { checkTextField, type TextFieldDeclaration } from '../utils/text-field.js';\n\nexport function textFieldSchema(declaration: TextFieldDeclaration) {\n return z.string().transform((text, ctx) => {\n const result = checkTextField(declaration, text);\n if (result.ok) return result.value;\n ctx.addIssue({ code: 'custom', message: result.reason, input: text });\n return z.NEVER;\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waiver-templates.d.ts","sourceRoot":"","sources":["../../src/schemas/waiver-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"waiver-templates.d.ts","sourceRoot":"","sources":["../../src/schemas/waiver-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,yBAAyB,wDAA+C,CAAC;AACtF,eAAO,MAAM,wBAAwB,wDAA8C,CAAC;AAEpF,eAAO,MAAM,oCAAoC;;;kBAEtC,CAAC;AACZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAClG,eAAO,MAAM,qCAAqC;;;kBAEvC,CAAC;AACZ,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG,eAAO,MAAM,oCAAoC;;;;;kBAOtC,CAAC;AACZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAClG,eAAO,MAAM,qCAAqC;;;;kBAMvC,CAAC;AACZ,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG,eAAO,MAAM,oCAAoC;;kBAEtC,CAAC;AACZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAClG,eAAO,MAAM,qCAAqC;;;;;;kBAKvC,CAAC;AACZ,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { textFieldSchema } from '
|
|
2
|
+
import { textFieldSchema } from './text-field.js';
|
|
3
3
|
import { waiverTemplateIdSchema, waiverTemplateVersionNumberSchema, } from '../doc-schemas/waiver-template.js';
|
|
4
4
|
import { WAIVER_TEMPLATE_DELETE_OUTCOME_KEYS } from '../types/unions.js';
|
|
5
|
-
import {
|
|
6
|
-
export const waiverTemplateTitleSchema = textFieldSchema(
|
|
7
|
-
export const waiverTemplateTextSchema = textFieldSchema(
|
|
5
|
+
import { WAIVER_TEMPLATE_TEXT_INPUT, WAIVER_TEMPLATE_TITLE_INPUT, } from '../constants/text-fields.js';
|
|
6
|
+
export const waiverTemplateTitleSchema = textFieldSchema(WAIVER_TEMPLATE_TITLE_INPUT);
|
|
7
|
+
export const waiverTemplateTextSchema = textFieldSchema(WAIVER_TEMPLATE_TEXT_INPUT);
|
|
8
8
|
export const AdminCreateWaiverTemplateInputSchema = z
|
|
9
9
|
.object({ title: waiverTemplateTitleSchema, waiverText: waiverTemplateTextSchema })
|
|
10
10
|
.strict();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waiver-templates.js","sourceRoot":"","sources":["../../src/schemas/waiver-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"waiver-templates.js","sourceRoot":"","sources":["../../src/schemas/waiver-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,mCAAmC,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,6BAA6B,CAAC;AAErC,MAAM,CAAC,MAAM,yBAAyB,GAAG,eAAe,CAAC,2BAA2B,CAAC,CAAC;AACtF,MAAM,CAAC,MAAM,wBAAwB,GAAG,eAAe,CAAC,0BAA0B,CAAC,CAAC;AAEpF,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC,EAAE,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,wBAAwB,EAAE,CAAC;KAClF,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC;KACnD,MAAM,CAAC,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;KAChG,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC;IACN,gBAAgB,EAAE,sBAAsB;IACxC,eAAe,EAAE,iCAAiC;IAClD,KAAK,EAAE,yBAAyB;IAChC,UAAU,EAAE,wBAAwB;CACrC,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC;KACnD,MAAM,CAAC;IACN,gBAAgB,EAAE,sBAAsB;IACxC,OAAO,EAAE,iCAAiC;IAC1C,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;CACvB,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,CAAC;KACpD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC;KACnD,MAAM,CAAC;IACN,gBAAgB,EAAE,sBAAsB;IACxC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,mCAAmC,CAAC;CACrD,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport { textFieldSchema } from './text-field.js';\nimport {\n waiverTemplateIdSchema,\n waiverTemplateVersionNumberSchema,\n} from '../doc-schemas/waiver-template.js';\nimport { WAIVER_TEMPLATE_DELETE_OUTCOME_KEYS } from '../types/unions.js';\nimport {\n WAIVER_TEMPLATE_TEXT_INPUT,\n WAIVER_TEMPLATE_TITLE_INPUT,\n} from '../constants/text-fields.js';\n\nexport const waiverTemplateTitleSchema = textFieldSchema(WAIVER_TEMPLATE_TITLE_INPUT);\nexport const waiverTemplateTextSchema = textFieldSchema(WAIVER_TEMPLATE_TEXT_INPUT);\n\nexport const AdminCreateWaiverTemplateInputSchema = z\n .object({ title: waiverTemplateTitleSchema, waiverText: waiverTemplateTextSchema })\n .strict();\nexport type AdminCreateWaiverTemplateInput = z.infer<typeof AdminCreateWaiverTemplateInputSchema>;\nexport const AdminCreateWaiverTemplateResultSchema = z\n .object({ waiverTemplateId: waiverTemplateIdSchema, version: waiverTemplateVersionNumberSchema })\n .strict();\nexport type AdminCreateWaiverTemplateResult = z.infer<typeof AdminCreateWaiverTemplateResultSchema>;\n\nexport const AdminUpdateWaiverTemplateInputSchema = z\n .object({\n waiverTemplateId: waiverTemplateIdSchema,\n expectedVersion: waiverTemplateVersionNumberSchema,\n title: waiverTemplateTitleSchema,\n waiverText: waiverTemplateTextSchema,\n })\n .strict();\nexport type AdminUpdateWaiverTemplateInput = z.infer<typeof AdminUpdateWaiverTemplateInputSchema>;\nexport const AdminUpdateWaiverTemplateResultSchema = z\n .object({\n waiverTemplateId: waiverTemplateIdSchema,\n version: waiverTemplateVersionNumberSchema,\n published: z.boolean(),\n })\n .strict();\nexport type AdminUpdateWaiverTemplateResult = z.infer<typeof AdminUpdateWaiverTemplateResultSchema>;\n\nexport const AdminDeleteWaiverTemplateInputSchema = z\n .object({ waiverTemplateId: waiverTemplateIdSchema })\n .strict();\nexport type AdminDeleteWaiverTemplateInput = z.infer<typeof AdminDeleteWaiverTemplateInputSchema>;\nexport const AdminDeleteWaiverTemplateResultSchema = z\n .object({\n waiverTemplateId: waiverTemplateIdSchema,\n outcome: z.enum(WAIVER_TEMPLATE_DELETE_OUTCOME_KEYS),\n })\n .strict();\nexport type AdminDeleteWaiverTemplateResult = z.infer<typeof AdminDeleteWaiverTemplateResultSchema>;\n"]}
|
|
@@ -32,16 +32,9 @@ export interface SignedContribution {
|
|
|
32
32
|
readonly sign: 1 | -1;
|
|
33
33
|
}
|
|
34
34
|
export declare function sumGameContributions(deriveLine: ContributionSpec['deriveLine'], signed: readonly SignedContribution[]): GameContribution;
|
|
35
|
-
export type StatLineChange = {
|
|
36
|
-
readonly ok: true;
|
|
37
|
-
readonly after: StatLineValues | null;
|
|
38
|
-
} | {
|
|
39
|
-
readonly ok: false;
|
|
40
|
-
readonly field: string;
|
|
41
|
-
};
|
|
42
35
|
/**
|
|
43
|
-
* A counter
|
|
44
|
-
*
|
|
36
|
+
* A counter a decrease would take below zero is written as zero, so a stored total never goes
|
|
37
|
+
* below zero (RULE-STD-BACKEND-119).
|
|
45
38
|
*/
|
|
46
|
-
export declare function applyStatLineDelta(deriveLine: ContributionSpec['deriveLine'], kind: StatLineKind, before: StatLineValues | undefined, delta: StatLineValues, sign: 1 | -1):
|
|
39
|
+
export declare function applyStatLineDelta(deriveLine: ContributionSpec['deriveLine'], kind: StatLineKind, before: StatLineValues | undefined, delta: StatLineValues, sign: 1 | -1): StatLineValues | null;
|
|
47
40
|
//# sourceMappingURL=contribution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contribution.d.ts","sourceRoot":"","sources":["../../src/sports/contribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAG9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,qBAAqB,EAAE,SAAS,MAAM,EAAE,CAAC;IAClD,QAAQ,CAAC,yBAAyB,EAAE,SAAS,MAAM,EAAE,CAAC;CACvD;AAED,MAAM,WAAW,gBAAgB;IAC/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AU,EAAE,gBAAgB,CAAC,YAAY,CAAC,EAC1C,MAAM,EAAE,SAAS,kBAAkB,EAAE,GACpC,gBAAgB,CAuBlB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,EAC1C,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,cAAc,GAAG,SAAS,EAClC,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,GACX,cAAc,GAAG,IAAI,CAQvB"}
|
|
@@ -113,16 +113,17 @@ export function sumGameContributions(deriveLine, signed) {
|
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
|
-
* A counter
|
|
117
|
-
*
|
|
116
|
+
* A counter a decrease would take below zero is written as zero, so a stored total never goes
|
|
117
|
+
* below zero (RULE-STD-BACKEND-119).
|
|
118
118
|
*/
|
|
119
119
|
export function applyStatLineDelta(deriveLine, kind, before, delta, sign) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
const moved = addStatLines(before ?? {}, delta, sign);
|
|
121
|
+
const floored = {};
|
|
122
|
+
for (const [field, value] of Object.entries(moved))
|
|
123
|
+
floored[field] = Math.max(0, value);
|
|
124
|
+
// A derived field is recomputed from the floored counters, never moved itself, so a stale stored
|
|
125
|
+
// FP can neither go below zero nor survive.
|
|
126
|
+
const after = deriveLine(kind, floored);
|
|
127
|
+
return isZeroStatLine(after) ? null : after;
|
|
127
128
|
}
|
|
128
129
|
//# sourceMappingURL=contribution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contribution.js","sourceRoot":"","sources":["../../src/sports/contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD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CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,cAAc,EAAE,eAAe,CAAC;QACpF,WAAW,EAAE,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,UAAU,CAAC;KAC1E,CAAC;AACJ,CAAC;AAMD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,UAA0C,EAC1C,IAAkB,EAClB,MAAkC,EAClC,KAAqB,EACrB,IAAY;IAEZ,kGAAkG;IAClG,yCAAyC;IACzC,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,YAAY,CAAC,MAAM,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IACxE,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;IAChG,IAAI,KAAK;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IACjD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;AACnE,CAAC","sourcesContent":["import type { GameStats } from '../doc-schemas/sport-game.js';\nimport { parseGameRosterPlayerId } from '../ids/compound-ids.js';\nimport { isGhostUserId } from '../ids/minted-ids.js';\nimport type { LeagueType } from '../types/sports.js';\nimport type { StatLineKind } from '../types/stats.js';\nimport { isAllZeroLine } from './scoring.js';\nimport type { StatLineValues } from './scoring.js';\n\nexport interface FinalizedGame {\n readonly leagueType: LeagueType;\n readonly teamIds: readonly string[];\n readonly stats: GameStats;\n readonly rosterPlayerIds: readonly string[];\n readonly absentRosterPlayerIds: readonly string[];\n readonly nonScoringRosterPlayerIds: readonly string[];\n}\n\nexport interface GameContribution {\n readonly teamLines: Readonly<Record<string, StatLineValues>>;\n readonly membershipRows: Readonly<Record<string, StatLineValues>>;\n readonly personLines: Readonly<Record<string, StatLineValues>>;\n}\n\nexport const EMPTY_GAME_CONTRIBUTION: GameContribution = {\n teamLines: {},\n membershipRows: {},\n personLines: {},\n};\n\nexport interface ContributionSpec {\n readonly playerStatKeys: readonly string[];\n readonly teamSeasonPlayerSums: readonly string[];\n readonly zeroLineIsNonScoring: boolean;\n readonly deriveLine: (kind: StatLineKind, line: StatLineValues) => StatLineValues;\n}\n\nfunction counter(line: StatLineValues | undefined, field: string): number {\n const value = line?.[field];\n return typeof value === 'number' ? value : 0;\n}\n\nexport function isZeroStatLine(line: StatLineValues): boolean {\n return Object.values(line).every((value) => typeof value !== 'number' || value === 0);\n}\n\nexport function decideParticipation(\n spec: Pick<ContributionSpec, 'playerStatKeys' | 'zeroLineIsNonScoring'>,\n stats: GameStats,\n rosterPlayerIds: readonly string[],\n absentRosterPlayerIds: readonly string[],\n): string[] {\n if (!spec.zeroLineIsNonScoring) return [];\n const absent = new Set(absentRosterPlayerIds);\n const playerStats = stats.playerStats as Readonly<Record<string, StatLineValues>>;\n return rosterPlayerIds.filter((entryId) => {\n if (absent.has(entryId)) return true;\n const line = playerStats[entryId];\n return line === undefined || isAllZeroLine(line, spec.playerStatKeys);\n });\n}\n\nexport function isCreditedGamePlayed(\n game: Pick<FinalizedGame, 'absentRosterPlayerIds' | 'nonScoringRosterPlayerIds'>,\n entryId: string,\n): boolean {\n return (\n !game.absentRosterPlayerIds.includes(entryId) &&\n !game.nonScoringRosterPlayerIds.includes(entryId)\n );\n}\n\nexport function addStatLines(\n left: StatLineValues,\n right: StatLineValues,\n sign: 1 | -1 = 1,\n): Record<string, number> {\n const sum: Record<string, number> = {};\n for (const field of new Set([...Object.keys(left), ...Object.keys(right)])) {\n const [a, b] = [left[field], right[field]];\n if ((a !== undefined && typeof a !== 'number') || (b !== undefined && typeof b !== 'number'))\n continue;\n sum[field] = (a ?? 0) + sign * (b ?? 0);\n }\n return sum;\n}\n\nexport function buildGameContribution(\n spec: ContributionSpec,\n game: FinalizedGame,\n): GameContribution {\n const teamStats = game.stats.teamStats as Readonly<Record<string, StatLineValues>>;\n const playerStats = game.stats.playerStats as Readonly<Record<string, StatLineValues>>;\n const opponentOf = (teamId: string): string | undefined =>\n game.teamIds.find((other) => other !== teamId);\n const counted = new Set(game.teamIds.filter((teamId) => opponentOf(teamId) !== undefined));\n\n const teamLines: Record<string, StatLineValues> = {};\n for (const teamId of counted) {\n const scored = counter(teamStats[teamId], 'score');\n const allowed = counter(teamStats[opponentOf(teamId) as string], 'score');\n const line: Record<string, number> = {\n gamesPlayed: 1,\n wins: scored > allowed ? 1 : 0,\n losses: scored < allowed ? 1 : 0,\n ties: scored === allowed ? 1 : 0,\n pointsFor: scored,\n pointsAgainst: allowed,\n };\n for (const field of spec.teamSeasonPlayerSums) line[field] = 0;\n for (const [entryId, playerLine] of Object.entries(playerStats)) {\n if (parseGameRosterPlayerId(entryId)?.teamId !== teamId) continue;\n for (const field of spec.teamSeasonPlayerSums)\n line[field] = (line[field] ?? 0) + counter(playerLine, field);\n }\n teamLines[teamId] = spec.deriveLine('teamSeason', line);\n }\n\n const membershipRows: Record<string, StatLineValues> = {};\n const personTotals = new Map<string, Record<string, number>>();\n const entryIds = [...new Set([...game.rosterPlayerIds, ...Object.keys(playerStats)])].sort();\n for (const entryId of entryIds) {\n const entry = parseGameRosterPlayerId(entryId);\n if (entry === null || !counted.has(entry.teamId)) continue;\n const row: Record<string, number> = {\n gamesPlayed: isCreditedGamePlayed(game, entryId) ? 1 : 0,\n };\n for (const field of spec.playerStatKeys) row[field] = counter(playerStats[entryId], field);\n if (isZeroStatLine(row)) continue;\n membershipRows[entryId] = spec.deriveLine('membershipRow', row);\n if (isGhostUserId(entry.userId)) continue;\n personTotals.set(entry.userId, addStatLines(personTotals.get(entry.userId) ?? {}, row));\n }\n\n const personLines: Record<string, StatLineValues> = {};\n for (const [userId, line] of personTotals)\n personLines[userId] = spec.deriveLine('lifetime', line);\n return { teamLines, membershipRows, personLines };\n}\n\nexport interface SignedContribution {\n readonly contribution: GameContribution;\n readonly sign: 1 | -1;\n}\n\nexport function sumGameContributions(\n deriveLine: ContributionSpec['deriveLine'],\n signed: readonly SignedContribution[],\n): GameContribution {\n const fold = (\n pick: (contribution: GameContribution) => Readonly<Record<string, StatLineValues>>,\n kind: StatLineKind,\n ) => {\n const totals = new Map<string, Record<string, number>>();\n for (const { contribution, sign } of signed) {\n for (const [key, line] of Object.entries(pick(contribution))) {\n totals.set(key, addStatLines(totals.get(key) ?? {}, line, sign));\n }\n }\n const lines: Record<string, StatLineValues> = {};\n for (const [key, line] of totals) {\n const derived = deriveLine(kind, line);\n if (!isZeroStatLine(derived)) lines[key] = derived;\n }\n return lines;\n };\n return {\n teamLines: fold((contribution) => contribution.teamLines, 'teamSeason'),\n membershipRows: fold((contribution) => contribution.membershipRows, 'membershipRow'),\n personLines: fold((contribution) => contribution.personLines, 'lifetime'),\n };\n}\n\nexport type StatLineChange =\n | { readonly ok: true; readonly after: StatLineValues | null }\n | { readonly ok: false; readonly field: string };\n\n/**\n * A counter that would go below zero is refused, never clamped: it means the stored line no longer\n * holds what the games put there.\n */\nexport function applyStatLineDelta(\n deriveLine: ContributionSpec['deriveLine'],\n kind: StatLineKind,\n before: StatLineValues | undefined,\n delta: StatLineValues,\n sign: 1 | -1,\n): StatLineChange {\n // A derived field is recomputed from the moved counters, never moved itself, so a stale stored FP\n // can neither go below zero nor survive.\n const after = deriveLine(kind, addStatLines(before ?? {}, delta, sign));\n const below = Object.entries(after).find(([, value]) => typeof value === 'number' && value < 0);\n if (below) return { ok: false, field: below[0] };\n return { ok: true, after: isZeroStatLine(after) ? null : after };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"contribution.js","sourceRoot":"","sources":["../../src/sports/contribution.ts"],"names":[],"mappings":"AACA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I,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC;QACvE,cAAc,EAAE,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,cAAc,EAAE,eAAe,CAAC;QACpF,WAAW,EAAE,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,UAAU,CAAC;KAC1E,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,UAA0C,EAC1C,IAAkB,EAClB,MAAkC,EAClC,KAAqB,EACrB,IAAY;IAEZ,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IACtD,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACxF,iGAAiG;IACjG,4CAA4C;IAC5C,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACxC,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AAC9C,CAAC","sourcesContent":["import type { GameStats } from '../doc-schemas/sport-game.js';\nimport { parseGameRosterPlayerId } from '../ids/compound-ids.js';\nimport { isGhostUserId } from '../ids/minted-ids.js';\nimport type { LeagueType } from '../types/sports.js';\nimport type { StatLineKind } from '../types/stats.js';\nimport { isAllZeroLine } from './scoring.js';\nimport type { StatLineValues } from './scoring.js';\n\nexport interface FinalizedGame {\n readonly leagueType: LeagueType;\n readonly teamIds: readonly string[];\n readonly stats: GameStats;\n readonly rosterPlayerIds: readonly string[];\n readonly absentRosterPlayerIds: readonly string[];\n readonly nonScoringRosterPlayerIds: readonly string[];\n}\n\nexport interface GameContribution {\n readonly teamLines: Readonly<Record<string, StatLineValues>>;\n readonly membershipRows: Readonly<Record<string, StatLineValues>>;\n readonly personLines: Readonly<Record<string, StatLineValues>>;\n}\n\nexport const EMPTY_GAME_CONTRIBUTION: GameContribution = {\n teamLines: {},\n membershipRows: {},\n personLines: {},\n};\n\nexport interface ContributionSpec {\n readonly playerStatKeys: readonly string[];\n readonly teamSeasonPlayerSums: readonly string[];\n readonly zeroLineIsNonScoring: boolean;\n readonly deriveLine: (kind: StatLineKind, line: StatLineValues) => StatLineValues;\n}\n\nfunction counter(line: StatLineValues | undefined, field: string): number {\n const value = line?.[field];\n return typeof value === 'number' ? value : 0;\n}\n\nexport function isZeroStatLine(line: StatLineValues): boolean {\n return Object.values(line).every((value) => typeof value !== 'number' || value === 0);\n}\n\nexport function decideParticipation(\n spec: Pick<ContributionSpec, 'playerStatKeys' | 'zeroLineIsNonScoring'>,\n stats: GameStats,\n rosterPlayerIds: readonly string[],\n absentRosterPlayerIds: readonly string[],\n): string[] {\n if (!spec.zeroLineIsNonScoring) return [];\n const absent = new Set(absentRosterPlayerIds);\n const playerStats = stats.playerStats as Readonly<Record<string, StatLineValues>>;\n return rosterPlayerIds.filter((entryId) => {\n if (absent.has(entryId)) return true;\n const line = playerStats[entryId];\n return line === undefined || isAllZeroLine(line, spec.playerStatKeys);\n });\n}\n\nexport function isCreditedGamePlayed(\n game: Pick<FinalizedGame, 'absentRosterPlayerIds' | 'nonScoringRosterPlayerIds'>,\n entryId: string,\n): boolean {\n return (\n !game.absentRosterPlayerIds.includes(entryId) &&\n !game.nonScoringRosterPlayerIds.includes(entryId)\n );\n}\n\nexport function addStatLines(\n left: StatLineValues,\n right: StatLineValues,\n sign: 1 | -1 = 1,\n): Record<string, number> {\n const sum: Record<string, number> = {};\n for (const field of new Set([...Object.keys(left), ...Object.keys(right)])) {\n const [a, b] = [left[field], right[field]];\n if ((a !== undefined && typeof a !== 'number') || (b !== undefined && typeof b !== 'number'))\n continue;\n sum[field] = (a ?? 0) + sign * (b ?? 0);\n }\n return sum;\n}\n\nexport function buildGameContribution(\n spec: ContributionSpec,\n game: FinalizedGame,\n): GameContribution {\n const teamStats = game.stats.teamStats as Readonly<Record<string, StatLineValues>>;\n const playerStats = game.stats.playerStats as Readonly<Record<string, StatLineValues>>;\n const opponentOf = (teamId: string): string | undefined =>\n game.teamIds.find((other) => other !== teamId);\n const counted = new Set(game.teamIds.filter((teamId) => opponentOf(teamId) !== undefined));\n\n const teamLines: Record<string, StatLineValues> = {};\n for (const teamId of counted) {\n const scored = counter(teamStats[teamId], 'score');\n const allowed = counter(teamStats[opponentOf(teamId) as string], 'score');\n const line: Record<string, number> = {\n gamesPlayed: 1,\n wins: scored > allowed ? 1 : 0,\n losses: scored < allowed ? 1 : 0,\n ties: scored === allowed ? 1 : 0,\n pointsFor: scored,\n pointsAgainst: allowed,\n };\n for (const field of spec.teamSeasonPlayerSums) line[field] = 0;\n for (const [entryId, playerLine] of Object.entries(playerStats)) {\n if (parseGameRosterPlayerId(entryId)?.teamId !== teamId) continue;\n for (const field of spec.teamSeasonPlayerSums)\n line[field] = (line[field] ?? 0) + counter(playerLine, field);\n }\n teamLines[teamId] = spec.deriveLine('teamSeason', line);\n }\n\n const membershipRows: Record<string, StatLineValues> = {};\n const personTotals = new Map<string, Record<string, number>>();\n const entryIds = [...new Set([...game.rosterPlayerIds, ...Object.keys(playerStats)])].sort();\n for (const entryId of entryIds) {\n const entry = parseGameRosterPlayerId(entryId);\n if (entry === null || !counted.has(entry.teamId)) continue;\n const row: Record<string, number> = {\n gamesPlayed: isCreditedGamePlayed(game, entryId) ? 1 : 0,\n };\n for (const field of spec.playerStatKeys) row[field] = counter(playerStats[entryId], field);\n if (isZeroStatLine(row)) continue;\n membershipRows[entryId] = spec.deriveLine('membershipRow', row);\n if (isGhostUserId(entry.userId)) continue;\n personTotals.set(entry.userId, addStatLines(personTotals.get(entry.userId) ?? {}, row));\n }\n\n const personLines: Record<string, StatLineValues> = {};\n for (const [userId, line] of personTotals)\n personLines[userId] = spec.deriveLine('lifetime', line);\n return { teamLines, membershipRows, personLines };\n}\n\nexport interface SignedContribution {\n readonly contribution: GameContribution;\n readonly sign: 1 | -1;\n}\n\nexport function sumGameContributions(\n deriveLine: ContributionSpec['deriveLine'],\n signed: readonly SignedContribution[],\n): GameContribution {\n const fold = (\n pick: (contribution: GameContribution) => Readonly<Record<string, StatLineValues>>,\n kind: StatLineKind,\n ) => {\n const totals = new Map<string, Record<string, number>>();\n for (const { contribution, sign } of signed) {\n for (const [key, line] of Object.entries(pick(contribution))) {\n totals.set(key, addStatLines(totals.get(key) ?? {}, line, sign));\n }\n }\n const lines: Record<string, StatLineValues> = {};\n for (const [key, line] of totals) {\n const derived = deriveLine(kind, line);\n if (!isZeroStatLine(derived)) lines[key] = derived;\n }\n return lines;\n };\n return {\n teamLines: fold((contribution) => contribution.teamLines, 'teamSeason'),\n membershipRows: fold((contribution) => contribution.membershipRows, 'membershipRow'),\n personLines: fold((contribution) => contribution.personLines, 'lifetime'),\n };\n}\n\n/**\n * A counter a decrease would take below zero is written as zero, so a stored total never goes\n * below zero (RULE-STD-BACKEND-119).\n */\nexport function applyStatLineDelta(\n deriveLine: ContributionSpec['deriveLine'],\n kind: StatLineKind,\n before: StatLineValues | undefined,\n delta: StatLineValues,\n sign: 1 | -1,\n): StatLineValues | null {\n const moved = addStatLines(before ?? {}, delta, sign);\n const floored: Record<string, number> = {};\n for (const [field, value] of Object.entries(moved)) floored[field] = Math.max(0, value);\n // A derived field is recomputed from the floored counters, never moved itself, so a stale stored\n // FP can neither go below zero nor survive.\n const after = deriveLine(kind, floored);\n return isZeroStatLine(after) ? null : after;\n}\n"]}
|
package/dist/types/audit.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SystemRole } from './unions.js';
|
|
2
2
|
import { CAPTAIN_TEAM_ROLES } from './unions.js';
|
|
3
|
-
export declare const AUDIT_EVENT_TYPE_KEYS: readonly ["user.accountRegistered", "user.displayNameChanged", "user.abandonedRegistrationDeleted", "user.signedIn", "user.passwordResetCompleted", "user.accountBanned", "user.accountUnbanned", "admin.systemRoleGranted", "admin.systemRoleRevoked", "admin.systemRoleClaimSynced", "appConfig.updated", "landingPage.updated", "league.created", "league.updated", "league.statusChanged", "league.modeSwitched", "waiverTemplate.created", "waiverTemplate.versionPublished", "waiverTemplate.retired", "waiverTemplate.deleted", "gameLocation.created", "gameLocation.updated", "gameLocation.deleted", "picture.added", "picture.replaced", "picture.moved", "picture.featuredChanged", "picture.removed", "award.created", "award.badgeReplaced", "award.deleted", "award.granted", "award.revoked", "award.groupDecisionOpened", "hardwareLoanContract.created", "hardwareLoanContract.signed", "hardwareLoanContract.returned", "hardwareLoanContract.deleted", "leagueTeam.created", "ghostPlayer.created", "teamRoster.syncRetried", "teamMembership.roleChanged", "leagueTeam.captainChanged", "leagueTeam.updated", "leagueTeamContact.updated", "teamMembership.removed", "ghostPlayer.removed", "ghostPlayer.linked", "ghostPlayer.closedLeagueLinked", "leagueTeam.deleted", "
|
|
3
|
+
export declare const AUDIT_EVENT_TYPE_KEYS: readonly ["user.accountRegistered", "user.displayNameChanged", "user.abandonedRegistrationDeleted", "user.signedIn", "user.passwordResetCompleted", "user.accountBanned", "user.accountUnbanned", "admin.systemRoleGranted", "admin.systemRoleRevoked", "admin.systemRoleClaimSynced", "appConfig.updated", "landingPage.updated", "league.created", "league.updated", "league.statusChanged", "league.modeSwitched", "waiverTemplate.created", "waiverTemplate.versionPublished", "waiverTemplate.retired", "waiverTemplate.deleted", "gameLocation.created", "gameLocation.updated", "gameLocation.deleted", "picture.added", "picture.replaced", "picture.moved", "picture.featuredChanged", "picture.removed", "award.created", "award.badgeReplaced", "award.deleted", "award.granted", "award.revoked", "award.groupDecisionOpened", "hardwareLoanContract.created", "hardwareLoanContract.signed", "hardwareLoanContract.returned", "hardwareLoanContract.deleted", "leagueTeam.created", "ghostPlayer.created", "teamRoster.syncRetried", "teamMembership.roleChanged", "leagueTeam.captainChanged", "leagueTeam.updated", "leagueTeamContact.updated", "teamMembership.removed", "ghostPlayer.removed", "ghostPlayer.linked", "ghostPlayer.closedLeagueLinked", "leagueTeam.deleted", "teamInvitation.created", "teamInvitation.cancelled", "teamInvitation.accepted", "teamInvitation.rejected", "teamJoinRequest.created", "teamJoinRequest.cancelled", "teamJoinRequest.accepted", "teamJoinRequest.rejected", "leagueFreeAgent.created", "leagueFreeAgent.deleted", "leagueFreeAgent.assigned", "signedWaiver.created", "scheduleWeek.created", "scheduleWeek.updated", "sportGame.created", "sportGame.updated", "sportGame.deleted", "sportGame.statEventsRejected", "sportGame.absenceChanged", "sportGame.memoUpdated", "sportGame.jumpBallChanged", "sportGame.finalized", "sportGame.reopened", "sportGame.statsCorrected", "sportGame.statsRecalculated", "stats.aggregateRecalculated", "stats.historicalStatsUpdated", "stats.validationRun", "stats.validationReportDeleted", "stats.unrosteredStatLineResolved", "adminNotification.archived", "adminNotification.archiveAllRequested", "system.manualIntervention", "migrationAction.pageRun", "migrationAction.writesCommitted", "migrationAction.controlRecorded", "migrationAction.checkpointRecorded", "migrationConsole.cutoverRecorded"];
|
|
4
4
|
export type AuditEventType = (typeof AUDIT_EVENT_TYPE_KEYS)[number];
|
|
5
5
|
export declare const GHOST_LINK_AUDIT_EVENT_TYPE_KEYS: readonly ["ghostPlayer.linked", "ghostPlayer.closedLeagueLinked"];
|
|
6
6
|
export type GhostLinkAuditEventType = (typeof GHOST_LINK_AUDIT_EVENT_TYPE_KEYS)[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/types/audit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,qBAAqB,
|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AC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,mBAAmB,CAAC;IAC/B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEN,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAED,eAAO,MAAM,iBAAiB,iCAAkC,CAAC;AACjE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/types/audit.js
CHANGED
package/dist/types/audit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/types/audit.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,wBAAwB;IACxB,yBAAyB;IACzB,mCAAmC;IACnC,eAAe;IACf,6BAA6B;IAC7B,oBAAoB;IACpB,sBAAsB;IACtB,yBAAyB;IACzB,yBAAyB;IACzB,6BAA6B;IAC7B,mBAAmB;IACnB,qBAAqB;IACrB,gBAAgB;IAChB,gBAAgB;IAChB,sBAAsB;IACtB,qBAAqB;IACrB,wBAAwB;IACxB,iCAAiC;IACjC,wBAAwB;IACxB,wBAAwB;IACxB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,eAAe;IACf,kBAAkB;IAClB,eAAe;IACf,yBAAyB;IACzB,iBAAiB;IACjB,eAAe;IACf,qBAAqB;IACrB,eAAe;IACf,eAAe;IACf,eAAe;IACf,2BAA2B;IAC3B,8BAA8B;IAC9B,6BAA6B;IAC7B,+BAA+B;IAC/B,8BAA8B;IAC9B,oBAAoB;IACpB,qBAAqB;IACrB,wBAAwB;IACxB,4BAA4B;IAC5B,2BAA2B;IAC3B,oBAAoB;IACpB,2BAA2B;IAC3B,wBAAwB;IACxB,qBAAqB;IACrB,oBAAoB;IACpB,gCAAgC;IAChC,oBAAoB;IACpB,
|
|
1
|
+
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/types/audit.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,wBAAwB;IACxB,yBAAyB;IACzB,mCAAmC;IACnC,eAAe;IACf,6BAA6B;IAC7B,oBAAoB;IACpB,sBAAsB;IACtB,yBAAyB;IACzB,yBAAyB;IACzB,6BAA6B;IAC7B,mBAAmB;IACnB,qBAAqB;IACrB,gBAAgB;IAChB,gBAAgB;IAChB,sBAAsB;IACtB,qBAAqB;IACrB,wBAAwB;IACxB,iCAAiC;IACjC,wBAAwB;IACxB,wBAAwB;IACxB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,eAAe;IACf,kBAAkB;IAClB,eAAe;IACf,yBAAyB;IACzB,iBAAiB;IACjB,eAAe;IACf,qBAAqB;IACrB,eAAe;IACf,eAAe;IACf,eAAe;IACf,2BAA2B;IAC3B,8BAA8B;IAC9B,6BAA6B;IAC7B,+BAA+B;IAC/B,8BAA8B;IAC9B,oBAAoB;IACpB,qBAAqB;IACrB,wBAAwB;IACxB,4BAA4B;IAC5B,2BAA2B;IAC3B,oBAAoB;IACpB,2BAA2B;IAC3B,wBAAwB;IACxB,qBAAqB;IACrB,oBAAoB;IACpB,gCAAgC;IAChC,oBAAoB;IACpB,wBAAwB;IACxB,0BAA0B;IAC1B,yBAAyB;IACzB,yBAAyB;IACzB,yBAAyB;IACzB,2BAA2B;IAC3B,0BAA0B;IAC1B,0BAA0B;IAC1B,yBAAyB;IACzB,yBAAyB;IACzB,0BAA0B;IAC1B,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,8BAA8B;IAC9B,0BAA0B;IAC1B,uBAAuB;IACvB,2BAA2B;IAC3B,qBAAqB;IACrB,oBAAoB;IACpB,0BAA0B;IAC1B,6BAA6B;IAC7B,6BAA6B;IAC7B,8BAA8B;IAC9B,qBAAqB;IACrB,+BAA+B;IAC/B,kCAAkC;IAClC,4BAA4B;IAC5B,uCAAuC;IACvC,2BAA2B;IAC3B,yBAAyB;IACzB,iCAAiC;IACjC,iCAAiC;IACjC,oCAAoC;IACpC,kCAAkC;CAC1B,CAAC;AAGX,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,oBAAoB;IACpB,gCAAgC;CACY,CAAC;AAG/C,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,MAAM;IACN,cAAc;IACd,aAAa;IACb,eAAe;IACf,QAAQ;CACA,CAAC;AAGX,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,aAAa;IACb,eAAe;CAC6B,CAAC;AAG/C,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,MAAM;IACN,cAAc;IACd,QAAQ;CACoC,CAAC;AAG/C,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,SAAS,EAAE,cAAc,EAAE,WAAW,CAAU,CAAC;AAmB1F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,SAAS,CAAU,CAAC","sourcesContent":["import type { SystemRole } from './unions.js';\nimport { CAPTAIN_TEAM_ROLES } from './unions.js';\n\nexport const AUDIT_EVENT_TYPE_KEYS = [\n 'user.accountRegistered',\n 'user.displayNameChanged',\n 'user.abandonedRegistrationDeleted',\n 'user.signedIn',\n 'user.passwordResetCompleted',\n 'user.accountBanned',\n 'user.accountUnbanned',\n 'admin.systemRoleGranted',\n 'admin.systemRoleRevoked',\n 'admin.systemRoleClaimSynced',\n 'appConfig.updated',\n 'landingPage.updated',\n 'league.created',\n 'league.updated',\n 'league.statusChanged',\n 'league.modeSwitched',\n 'waiverTemplate.created',\n 'waiverTemplate.versionPublished',\n 'waiverTemplate.retired',\n 'waiverTemplate.deleted',\n 'gameLocation.created',\n 'gameLocation.updated',\n 'gameLocation.deleted',\n 'picture.added',\n 'picture.replaced',\n 'picture.moved',\n 'picture.featuredChanged',\n 'picture.removed',\n 'award.created',\n 'award.badgeReplaced',\n 'award.deleted',\n 'award.granted',\n 'award.revoked',\n 'award.groupDecisionOpened',\n 'hardwareLoanContract.created',\n 'hardwareLoanContract.signed',\n 'hardwareLoanContract.returned',\n 'hardwareLoanContract.deleted',\n 'leagueTeam.created',\n 'ghostPlayer.created',\n 'teamRoster.syncRetried',\n 'teamMembership.roleChanged',\n 'leagueTeam.captainChanged',\n 'leagueTeam.updated',\n 'leagueTeamContact.updated',\n 'teamMembership.removed',\n 'ghostPlayer.removed',\n 'ghostPlayer.linked',\n 'ghostPlayer.closedLeagueLinked',\n 'leagueTeam.deleted',\n 'teamInvitation.created',\n 'teamInvitation.cancelled',\n 'teamInvitation.accepted',\n 'teamInvitation.rejected',\n 'teamJoinRequest.created',\n 'teamJoinRequest.cancelled',\n 'teamJoinRequest.accepted',\n 'teamJoinRequest.rejected',\n 'leagueFreeAgent.created',\n 'leagueFreeAgent.deleted',\n 'leagueFreeAgent.assigned',\n 'signedWaiver.created',\n 'scheduleWeek.created',\n 'scheduleWeek.updated',\n 'sportGame.created',\n 'sportGame.updated',\n 'sportGame.deleted',\n 'sportGame.statEventsRejected',\n 'sportGame.absenceChanged',\n 'sportGame.memoUpdated',\n 'sportGame.jumpBallChanged',\n 'sportGame.finalized',\n 'sportGame.reopened',\n 'sportGame.statsCorrected',\n 'sportGame.statsRecalculated',\n 'stats.aggregateRecalculated',\n 'stats.historicalStatsUpdated',\n 'stats.validationRun',\n 'stats.validationReportDeleted',\n 'stats.unrosteredStatLineResolved',\n 'adminNotification.archived',\n 'adminNotification.archiveAllRequested',\n 'system.manualIntervention',\n 'migrationAction.pageRun',\n 'migrationAction.writesCommitted',\n 'migrationAction.controlRecorded',\n 'migrationAction.checkpointRecorded',\n 'migrationConsole.cutoverRecorded',\n] as const;\nexport type AuditEventType = (typeof AUDIT_EVENT_TYPE_KEYS)[number];\n\nexport const GHOST_LINK_AUDIT_EVENT_TYPE_KEYS = [\n 'ghostPlayer.linked',\n 'ghostPlayer.closedLeagueLinked',\n] as const satisfies readonly AuditEventType[];\nexport type GhostLinkAuditEventType = (typeof GHOST_LINK_AUDIT_EVENT_TYPE_KEYS)[number];\n\nexport const AUDIT_ACTOR_MODE_KEYS = [\n 'user',\n 'teammateUser',\n 'adminReview',\n 'adminOverride',\n 'system',\n] as const;\nexport type AuditActorMode = (typeof AUDIT_ACTOR_MODE_KEYS)[number];\n\nexport const AUDIT_ADMIN_ACTOR_MODE_KEYS = [\n 'adminReview',\n 'adminOverride',\n] as const satisfies readonly AuditActorMode[];\nexport type AuditAdminActorMode = (typeof AUDIT_ADMIN_ACTOR_MODE_KEYS)[number];\n\nexport const AUDIT_NON_ADMIN_ACTOR_MODE_KEYS = [\n 'user',\n 'teammateUser',\n 'system',\n] as const satisfies readonly AuditActorMode[];\nexport type AuditNonAdminActorMode = (typeof AUDIT_NON_ADMIN_ACTOR_MODE_KEYS)[number];\n\nexport const AUDIT_SYSTEM_REASON_KEYS = ['trigger', 'scheduledJob', 'migration'] as const;\nexport type AuditSystemReason = (typeof AUDIT_SYSTEM_REASON_KEYS)[number];\n\nexport type CaptainTeamRole = (typeof CAPTAIN_TEAM_ROLES)[number];\n\nexport type AuditActor =\n | { uid: string | null; isAdmin: boolean; actorMode: AuditNonAdminActorMode; systemRole?: never }\n | {\n uid: string | null;\n isAdmin: boolean;\n actorMode: AuditAdminActorMode;\n systemRole: SystemRole;\n };\n\nexport interface AuditTarget {\n uid: string | null;\n ref: string | null;\n}\n\nexport const AUDIT_RESULT_KEYS = ['success', 'failure'] as const;\nexport type AuditResult = (typeof AUDIT_RESULT_KEYS)[number];\n"]}
|
|
@@ -8,6 +8,6 @@ export declare const SPORT_GAME_SCHEDULE_FIELD_KEYS: readonly ["weekId", "teams"
|
|
|
8
8
|
export type SportGameScheduleField = (typeof SPORT_GAME_SCHEDULE_FIELD_KEYS)[number];
|
|
9
9
|
export declare const SCHEDULE_WEEK_FIELD_KEYS: readonly ["weekTitle", "weekStartDate", "weekLocation"];
|
|
10
10
|
export type ScheduleWeekField = (typeof SCHEDULE_WEEK_FIELD_KEYS)[number];
|
|
11
|
-
export declare const SCHEDULE_REFUSAL_REASON_KEYS: readonly ["gameCompleted", "
|
|
11
|
+
export declare const SCHEDULE_REFUSAL_REASON_KEYS: readonly ["gameCompleted", "weekHasRecordedStats", "teamHasRecordedStats", "gameHasRecordedPlay"];
|
|
12
12
|
export type ScheduleRefusalReason = (typeof SCHEDULE_REFUSAL_REASON_KEYS)[number];
|
|
13
13
|
//# sourceMappingURL=schedules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../../src/types/schedules.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,iDAAkD,CAAC;AAC3F,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAChF,eAAO,MAAM,wBAAwB,kBAA2D,CAAC;AACjG,eAAO,MAAM,2BAA2B,oBACoB,CAAC;AAE7D,eAAO,MAAM,8BAA8B,mCAAoC,CAAC;AAChF,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,eAAO,MAAM,8BAA8B,6FAOjC,CAAC;AACX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,eAAO,MAAM,wBAAwB,yDAA0D,CAAC;AAChG,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,eAAO,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../../src/types/schedules.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,iDAAkD,CAAC;AAC3F,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAChF,eAAO,MAAM,wBAAwB,kBAA2D,CAAC;AACjG,eAAO,MAAM,2BAA2B,oBACoB,CAAC;AAE7D,eAAO,MAAM,8BAA8B,mCAAoC,CAAC;AAChF,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,eAAO,MAAM,8BAA8B,6FAOjC,CAAC;AACX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,eAAO,MAAM,wBAAwB,yDAA0D,CAAC;AAChG,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,eAAO,MAAM,4BAA4B,mGAK/B,CAAC;AACX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/types/schedules.js
CHANGED
|
@@ -13,8 +13,7 @@ export const SPORT_GAME_SCHEDULE_FIELD_KEYS = [
|
|
|
13
13
|
export const SCHEDULE_WEEK_FIELD_KEYS = ['weekTitle', 'weekStartDate', 'weekLocation'];
|
|
14
14
|
export const SCHEDULE_REFUSAL_REASON_KEYS = [
|
|
15
15
|
'gameCompleted',
|
|
16
|
-
'
|
|
17
|
-
'weekHasCompletedGames',
|
|
16
|
+
'weekHasRecordedStats',
|
|
18
17
|
'teamHasRecordedStats',
|
|
19
18
|
'gameHasRecordedPlay',
|
|
20
19
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedules.js","sourceRoot":"","sources":["../../src/types/schedules.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,gBAAgB,EAAE,kBAAkB,CAAU,CAAC;AAE3F,MAAM,CAAC,MAAM,wBAAwB,GAAG,gBAAwD,CAAC;AACjG,MAAM,CAAC,MAAM,2BAA2B,GACtC,kBAA0D,CAAC;AAE7D,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAGhF,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,QAAQ;IACR,OAAO;IACP,WAAW;IACX,gBAAgB;IAChB,aAAa;IACb,eAAe;CACP,CAAC;AAGX,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,WAAW,EAAE,eAAe,EAAE,cAAc,CAAU,CAAC;AAGhG,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,eAAe;IACf,
|
|
1
|
+
{"version":3,"file":"schedules.js","sourceRoot":"","sources":["../../src/types/schedules.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,gBAAgB,EAAE,kBAAkB,CAAU,CAAC;AAE3F,MAAM,CAAC,MAAM,wBAAwB,GAAG,gBAAwD,CAAC;AACjG,MAAM,CAAC,MAAM,2BAA2B,GACtC,kBAA0D,CAAC;AAE7D,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAGhF,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,QAAQ;IACR,OAAO;IACP,WAAW;IACX,gBAAgB;IAChB,aAAa;IACb,eAAe;CACP,CAAC;AAGX,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,WAAW,EAAE,eAAe,EAAE,cAAc,CAAU,CAAC;AAGhG,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,eAAe;IACf,sBAAsB;IACtB,sBAAsB;IACtB,qBAAqB;CACb,CAAC","sourcesContent":["export const SCHEDULE_CONFLICT_KIND_KEYS = ['sharedLocation', 'teamDoubleBooked'] as const;\nexport type ScheduleConflictKind = (typeof SCHEDULE_CONFLICT_KIND_KEYS)[number];\nexport const SHARED_LOCATION_CONFLICT = 'sharedLocation' as const satisfies ScheduleConflictKind;\nexport const TEAM_DOUBLE_BOOKED_CONFLICT =\n 'teamDoubleBooked' as const satisfies ScheduleConflictKind;\n\nexport const SPORT_GAME_DELETION_SCOPE_KEYS = ['game', 'week', 'team'] as const;\nexport type SportGameDeletionScope = (typeof SPORT_GAME_DELETION_SCOPE_KEYS)[number];\n\nexport const SPORT_GAME_SCHEDULE_FIELD_KEYS = [\n 'weekId',\n 'teams',\n 'startTime',\n 'gameLocationId',\n 'subLocation',\n 'locationLabel',\n] as const;\nexport type SportGameScheduleField = (typeof SPORT_GAME_SCHEDULE_FIELD_KEYS)[number];\n\nexport const SCHEDULE_WEEK_FIELD_KEYS = ['weekTitle', 'weekStartDate', 'weekLocation'] as const;\nexport type ScheduleWeekField = (typeof SCHEDULE_WEEK_FIELD_KEYS)[number];\n\nexport const SCHEDULE_REFUSAL_REASON_KEYS = [\n 'gameCompleted',\n 'weekHasRecordedStats',\n 'teamHasRecordedStats',\n 'gameHasRecordedPlay',\n] as const;\nexport type ScheduleRefusalReason = (typeof SCHEDULE_REFUSAL_REASON_KEYS)[number];\n"]}
|
package/dist/types/stats.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const TEAM_STAT_LINE_KIND_KEYS: readonly ["gameTeam", "teamSeason
|
|
|
15
15
|
export declare const STAT_LINE_KIND_KEYS: readonly ["gamePlayer", "membershipRow", "lifetime", "hallOfFame", "gameTeam", "teamSeason"];
|
|
16
16
|
export type StatLineKind = (typeof STAT_LINE_KIND_KEYS)[number];
|
|
17
17
|
export type PlayerStatLineKind = (typeof PLAYER_STAT_LINE_KIND_KEYS)[number];
|
|
18
|
-
export declare const STATS_OPERATION_KIND_KEYS: readonly ["leagueStatsRebuild", "lifetimeStatsRebuild", "hallOfFameRebuild", "statsValidation", "gameStatsCorrection", "gameStatsRecalculation", "historicalStatsUpdate"
|
|
18
|
+
export declare const STATS_OPERATION_KIND_KEYS: readonly ["leagueStatsRebuild", "lifetimeStatsRebuild", "hallOfFameRebuild", "statsValidation", "gameStatsCorrection", "gameStatsRecalculation", "historicalStatsUpdate"];
|
|
19
19
|
export type StatsOperationKind = (typeof STATS_OPERATION_KIND_KEYS)[number];
|
|
20
20
|
export declare const STATS_REBUILD_OPERATION_KIND_KEYS: readonly ["leagueStatsRebuild", "lifetimeStatsRebuild", "hallOfFameRebuild"];
|
|
21
21
|
export type StatsRebuildOperationKind = (typeof STATS_REBUILD_OPERATION_KIND_KEYS)[number];
|
|
@@ -23,8 +23,6 @@ export declare const STATS_OPERATION_STATUS_KEYS: readonly ["running", "complete
|
|
|
23
23
|
export type StatsOperationStatus = (typeof STATS_OPERATION_STATUS_KEYS)[number];
|
|
24
24
|
export declare const STATS_VALIDATION_PHASE_KEYS: readonly ["games", "destinations"];
|
|
25
25
|
export type StatsValidationPhase = (typeof STATS_VALIDATION_PHASE_KEYS)[number];
|
|
26
|
-
export declare const GHOST_STATS_OPERATION_ACTION_KEYS: readonly ["link", "removal"];
|
|
27
|
-
export type GhostStatsOperationAction = (typeof GHOST_STATS_OPERATION_ACTION_KEYS)[number];
|
|
28
26
|
export declare const STAT_EVENT_REFUSAL_KEYS: readonly ["eventTypeNotInSport", "teamNotInGame", "playerNotRostered", "assisterNotRostered", "assistNotAllowed", "playerNotAllowed", "roundNotNext", "roundsComplete", "bulkValueInvalid", "bulkStale", "eventIdConflict", "voidTargetNotSportEvent", "correctionNotAccepted", "undoBelowZero"];
|
|
29
27
|
export type StatEventRefusalCode = (typeof STAT_EVENT_REFUSAL_KEYS)[number];
|
|
30
28
|
export declare const FINALIZATION_NOT_READY_KEYS: readonly ["roundsIncomplete"];
|
|
@@ -39,16 +37,14 @@ export declare const GAME_FINALIZE_OUTCOME_KEYS: readonly ["finalized", "already
|
|
|
39
37
|
export type GameFinalizeOutcome = (typeof GAME_FINALIZE_OUTCOME_KEYS)[number];
|
|
40
38
|
export declare const GAME_REOPEN_OUTCOME_KEYS: readonly ["reopened", "alreadyOpen"];
|
|
41
39
|
export type GameReopenOutcome = (typeof GAME_REOPEN_OUTCOME_KEYS)[number];
|
|
42
|
-
export declare const STATS_INTEGRITY_REFUSAL_KEYS: readonly ["statsOutOfBand", "finalRecordMissing", "aggregateBelowZero"];
|
|
43
|
-
export type StatsIntegrityRefusal = (typeof STATS_INTEGRITY_REFUSAL_KEYS)[number];
|
|
44
40
|
export declare const GAME_STATS_REPAIR_OUTCOME_KEYS: readonly ["reconciled", "unchanged", "alreadyApplied"];
|
|
45
41
|
export type GameStatsRepairOutcome = (typeof GAME_STATS_REPAIR_OUTCOME_KEYS)[number];
|
|
46
|
-
export declare const GAME_REPAIR_REFUSAL_KEYS: readonly ["eventUnreadable", "eventSequenceGap", "sourcesDisagree", "scoreAmbiguous", "fieldNotCorrectable", "lineNotRostered", "teamNotInGame"
|
|
42
|
+
export declare const GAME_REPAIR_REFUSAL_KEYS: readonly ["eventUnreadable", "eventSequenceGap", "sourcesDisagree", "scoreAmbiguous", "fieldNotCorrectable", "lineNotRostered", "teamNotInGame"];
|
|
47
43
|
export type GameRepairRefusal = (typeof GAME_REPAIR_REFUSAL_KEYS)[number];
|
|
48
44
|
export declare const GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS: readonly ["handedOver", "created", "merged", "kept"];
|
|
49
45
|
export type GhostLinkMembershipOutcome = (typeof GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS)[number];
|
|
50
46
|
export declare const UNROSTERED_STAT_LINE_RESOLUTION_OUTCOME_KEYS: readonly ["resolved", "alreadyResolved"];
|
|
51
47
|
export type UnrosteredStatLineResolutionOutcome = (typeof UNROSTERED_STAT_LINE_RESOLUTION_OUTCOME_KEYS)[number];
|
|
52
|
-
export declare const GHOST_REMOVAL_REFUSAL_KEYS: readonly ["ghostHasPlayed", "
|
|
48
|
+
export declare const GHOST_REMOVAL_REFUSAL_KEYS: readonly ["ghostHasPlayed", "captainNotRemovable"];
|
|
53
49
|
export type GhostRemovalRefusal = (typeof GHOST_REMOVAL_REFUSAL_KEYS)[number];
|
|
54
50
|
//# sourceMappingURL=stats.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../src/types/stats.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,cAAc,CAAC;AAChD,eAAO,MAAM,0BAA0B,oBAAoB,CAAC;AAC5D,eAAO,MAAM,0BAA0B,2CAG7B,CAAC;AACX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7E,eAAO,MAAM,8BAA8B,oGAMjC,CAAC;AACX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,eAAO,MAAM,8BAA8B,mEAGjC,CAAC;AACX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,eAAO,MAAM,2BAA2B,iCAAkC,CAAC;AAC3E,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhF,eAAO,MAAM,yBAAyB,uDAAwD,CAAC;AAC/F,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,eAAO,MAAM,0BAA0B,oEAK7B,CAAC;AACX,eAAO,MAAM,wBAAwB,qCAAsC,CAAC;AAC5E,eAAO,MAAM,mBAAmB,8FAGtB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7E,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../src/types/stats.ts"],"names":[],"mappings":"AAEA,e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AAC,CAAC;AAErF,eAAO,MAAM,wBAAwB,kJAQ3B,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,eAAO,MAAM,kCAAkC,sDAKrC,CAAC;AACX,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,kCAAkC,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7F,eAAO,MAAM,4CAA4C,0CAG/C,CAAC;AACX,MAAM,MAAM,mCAAmC,GAC7C,CAAC,OAAO,4CAA4C,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,eAAO,MAAM,0BAA0B,oDAAqD,CAAC;AAC7F,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/types/stats.js
CHANGED
|
@@ -37,8 +37,6 @@ export const STATS_OPERATION_KIND_KEYS = [
|
|
|
37
37
|
'gameStatsCorrection',
|
|
38
38
|
'gameStatsRecalculation',
|
|
39
39
|
'historicalStatsUpdate',
|
|
40
|
-
'ghostPlayerStats',
|
|
41
|
-
'gameDeletion',
|
|
42
40
|
];
|
|
43
41
|
export const STATS_REBUILD_OPERATION_KIND_KEYS = [
|
|
44
42
|
'leagueStatsRebuild',
|
|
@@ -47,7 +45,6 @@ export const STATS_REBUILD_OPERATION_KIND_KEYS = [
|
|
|
47
45
|
];
|
|
48
46
|
export const STATS_OPERATION_STATUS_KEYS = ['running', 'complete', 'stopped'];
|
|
49
47
|
export const STATS_VALIDATION_PHASE_KEYS = ['games', 'destinations'];
|
|
50
|
-
export const GHOST_STATS_OPERATION_ACTION_KEYS = ['link', 'removal'];
|
|
51
48
|
export const STAT_EVENT_REFUSAL_KEYS = [
|
|
52
49
|
'eventTypeNotInSport',
|
|
53
50
|
'teamNotInGame',
|
|
@@ -70,11 +67,6 @@ export const BULK_ENTRY_KIND_KEYS = ['playerLines', 'teamScores', 'rounds'];
|
|
|
70
67
|
export const RECORDED_STAT_EVENT_OUTCOME_KEYS = ['recorded', 'alreadyRecorded'];
|
|
71
68
|
export const GAME_FINALIZE_OUTCOME_KEYS = ['finalized', 'alreadyFinalized'];
|
|
72
69
|
export const GAME_REOPEN_OUTCOME_KEYS = ['reopened', 'alreadyOpen'];
|
|
73
|
-
export const STATS_INTEGRITY_REFUSAL_KEYS = [
|
|
74
|
-
'statsOutOfBand',
|
|
75
|
-
'finalRecordMissing',
|
|
76
|
-
'aggregateBelowZero',
|
|
77
|
-
];
|
|
78
70
|
export const GAME_STATS_REPAIR_OUTCOME_KEYS = [
|
|
79
71
|
'reconciled',
|
|
80
72
|
'unchanged',
|
|
@@ -88,7 +80,6 @@ export const GAME_REPAIR_REFUSAL_KEYS = [
|
|
|
88
80
|
'fieldNotCorrectable',
|
|
89
81
|
'lineNotRostered',
|
|
90
82
|
'teamNotInGame',
|
|
91
|
-
'gameTooLarge',
|
|
92
83
|
];
|
|
93
84
|
export const GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS = [
|
|
94
85
|
'handedOver',
|
|
@@ -100,11 +91,5 @@ export const UNROSTERED_STAT_LINE_RESOLUTION_OUTCOME_KEYS = [
|
|
|
100
91
|
'resolved',
|
|
101
92
|
'alreadyResolved',
|
|
102
93
|
];
|
|
103
|
-
export const GHOST_REMOVAL_REFUSAL_KEYS = [
|
|
104
|
-
'ghostHasPlayed',
|
|
105
|
-
'removalStopped',
|
|
106
|
-
'gameHeld',
|
|
107
|
-
'ghostBeingLinked',
|
|
108
|
-
'captainNotRemovable',
|
|
109
|
-
];
|
|
94
|
+
export const GHOST_REMOVAL_REFUSAL_KEYS = ['ghostHasPlayed', 'captainNotRemovable'];
|
|
110
95
|
//# sourceMappingURL=stats.js.map
|