@ttt-productions/q-core 0.1.47 → 0.1.49
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/doc-schemas/aggregate-stats.d.ts +6 -30
- package/dist/doc-schemas/aggregate-stats.d.ts.map +1 -1
- package/dist/doc-schemas/aggregate-stats.js +7 -5
- package/dist/doc-schemas/aggregate-stats.js.map +1 -1
- package/dist/doc-schemas/audit-event.d.ts +122 -118
- package/dist/doc-schemas/audit-event.d.ts.map +1 -1
- package/dist/doc-schemas/league-team.d.ts +4 -28
- package/dist/doc-schemas/league-team.d.ts.map +1 -1
- package/dist/doc-schemas/league-team.js +8 -8
- package/dist/doc-schemas/league-team.js.map +1 -1
- package/dist/doc-schemas/pending-media.d.ts +710 -130
- package/dist/doc-schemas/pending-media.d.ts.map +1 -1
- package/dist/doc-schemas/registry.d.ts +350 -140
- package/dist/doc-schemas/registry.d.ts.map +1 -1
- package/dist/domain-events/domain-events.d.ts +330 -76
- package/dist/domain-events/domain-events.d.ts.map +1 -1
- package/dist/domain-events/domain-events.js +185 -79
- package/dist/domain-events/domain-events.js.map +1 -1
- package/dist/migration-console/manifest.d.ts +4 -3
- package/dist/migration-console/manifest.d.ts.map +1 -1
- package/dist/migration-console/manifest.js +7 -6
- package/dist/migration-console/manifest.js.map +1 -1
- package/dist/paths/collections.d.ts +14 -0
- package/dist/paths/collections.d.ts.map +1 -1
- package/dist/paths/collections.js +28 -0
- package/dist/paths/collections.js.map +1 -1
- package/dist/schemas/account-settings.d.ts +4 -4
- package/dist/schemas/account-settings.d.ts.map +1 -1
- package/dist/schemas/account-settings.js +2 -2
- package/dist/schemas/account-settings.js.map +1 -1
- package/dist/schemas/admin-notifications.d.ts +12 -12
- package/dist/schemas/admin-notifications.d.ts.map +1 -1
- package/dist/schemas/admin-notifications.js +8 -6
- package/dist/schemas/admin-notifications.js.map +1 -1
- package/dist/schemas/admin-stats.d.ts +6 -6
- package/dist/schemas/admin-stats.d.ts.map +1 -1
- package/dist/schemas/admin-stats.js +3 -3
- package/dist/schemas/admin-stats.js.map +1 -1
- package/dist/schemas/app-config.d.ts +4 -4
- package/dist/schemas/app-config.d.ts.map +1 -1
- package/dist/schemas/app-config.js +2 -2
- package/dist/schemas/app-config.js.map +1 -1
- package/dist/schemas/awards.d.ts +8 -8
- package/dist/schemas/awards.d.ts.map +1 -1
- package/dist/schemas/awards.js +4 -4
- package/dist/schemas/awards.js.map +1 -1
- package/dist/schemas/dead-letters.d.ts +8 -8
- package/dist/schemas/dead-letters.d.ts.map +1 -1
- package/dist/schemas/dead-letters.js +4 -4
- package/dist/schemas/dead-letters.js.map +1 -1
- package/dist/schemas/hardware-loan-contracts.d.ts +8 -8
- package/dist/schemas/hardware-loan-contracts.d.ts.map +1 -1
- package/dist/schemas/hardware-loan-contracts.js +4 -4
- package/dist/schemas/hardware-loan-contracts.js.map +1 -1
- package/dist/schemas/leagues.d.ts +4 -4
- package/dist/schemas/leagues.d.ts.map +1 -1
- package/dist/schemas/leagues.js +2 -2
- package/dist/schemas/leagues.js.map +1 -1
- package/dist/schemas/migration-console.d.ts +6 -6
- package/dist/schemas/migration-console.d.ts.map +1 -1
- package/dist/schemas/migration-console.js +5 -3
- package/dist/schemas/migration-console.js.map +1 -1
- package/dist/schemas/pictures.d.ts +438 -90
- package/dist/schemas/pictures.d.ts.map +1 -1
- package/dist/schemas/pictures.js +6 -6
- package/dist/schemas/pictures.js.map +1 -1
- package/dist/schemas/scoring.d.ts +16 -16
- package/dist/schemas/scoring.d.ts.map +1 -1
- package/dist/schemas/scoring.js +8 -8
- package/dist/schemas/scoring.js.map +1 -1
- package/dist/schemas/stats.d.ts +26 -26
- package/dist/schemas/stats.d.ts.map +1 -1
- package/dist/schemas/stats.js +13 -13
- package/dist/schemas/stats.js.map +1 -1
- package/dist/schemas/team-joining.d.ts +4 -4
- package/dist/schemas/team-joining.d.ts.map +1 -1
- package/dist/schemas/team-joining.js +2 -2
- package/dist/schemas/team-joining.js.map +1 -1
- package/dist/schemas/teams.d.ts +16 -16
- package/dist/schemas/teams.d.ts.map +1 -1
- package/dist/schemas/teams.js +8 -8
- package/dist/schemas/teams.js.map +1 -1
- package/dist/schemas/uploads.d.ts +12 -12
- package/dist/schemas/uploads.d.ts.map +1 -1
- package/dist/schemas/uploads.js +8 -6
- package/dist/schemas/uploads.js.map +1 -1
- package/dist/schemas/users.d.ts +28 -28
- package/dist/schemas/users.d.ts.map +1 -1
- package/dist/schemas/users.js +14 -14
- package/dist/schemas/users.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 +37 -35
- package/dist/types/audit.js.map +1 -1
- package/package.json +1 -1
|
@@ -143,31 +143,19 @@ export declare const BasketballHallOfFameSchema: z.ZodObject<{
|
|
|
143
143
|
rebounds: z.ZodNumber;
|
|
144
144
|
assists: z.ZodNumber;
|
|
145
145
|
gamesPlayed: z.ZodNumber;
|
|
146
|
-
}, z.core.$strip
|
|
146
|
+
}, z.core.$strip>>;
|
|
147
147
|
updatedAt: z.ZodNumber;
|
|
148
148
|
}, z.core.$strip>;
|
|
149
149
|
export type BasketballHallOfFame = z.infer<typeof BasketballHallOfFameSchema>;
|
|
150
150
|
export declare const CurlingHallOfFameSchema: z.ZodObject<{
|
|
151
151
|
leagueType: z.ZodLiteral<"Curling">;
|
|
152
|
-
playerStats: z.ZodRecord<z.ZodString, z.
|
|
153
|
-
fantasyPoints: z.ZodNumber;
|
|
154
|
-
points: z.ZodNumber;
|
|
155
|
-
rebounds: z.ZodNumber;
|
|
156
|
-
assists: z.ZodNumber;
|
|
157
|
-
gamesPlayed: z.ZodNumber;
|
|
158
|
-
}, z.core.$strip> | z.ZodNever>;
|
|
152
|
+
playerStats: z.ZodRecord<z.ZodString, z.ZodNever>;
|
|
159
153
|
updatedAt: z.ZodNumber;
|
|
160
154
|
}, z.core.$strip>;
|
|
161
155
|
export type CurlingHallOfFame = z.infer<typeof CurlingHallOfFameSchema>;
|
|
162
156
|
export declare const FootballHallOfFameSchema: z.ZodObject<{
|
|
163
157
|
leagueType: z.ZodLiteral<"Football">;
|
|
164
|
-
playerStats: z.ZodRecord<z.ZodString, z.
|
|
165
|
-
fantasyPoints: z.ZodNumber;
|
|
166
|
-
points: z.ZodNumber;
|
|
167
|
-
rebounds: z.ZodNumber;
|
|
168
|
-
assists: z.ZodNumber;
|
|
169
|
-
gamesPlayed: z.ZodNumber;
|
|
170
|
-
}, z.core.$strip> | z.ZodNever>;
|
|
158
|
+
playerStats: z.ZodRecord<z.ZodString, z.ZodNever>;
|
|
171
159
|
updatedAt: z.ZodNumber;
|
|
172
160
|
}, z.core.$strip>;
|
|
173
161
|
export type FootballHallOfFame = z.infer<typeof FootballHallOfFameSchema>;
|
|
@@ -179,27 +167,15 @@ export declare const SportHallOfFameSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
179
167
|
rebounds: z.ZodNumber;
|
|
180
168
|
assists: z.ZodNumber;
|
|
181
169
|
gamesPlayed: z.ZodNumber;
|
|
182
|
-
}, z.core.$strip
|
|
170
|
+
}, z.core.$strip>>;
|
|
183
171
|
updatedAt: z.ZodNumber;
|
|
184
172
|
}, z.core.$strip>, z.ZodObject<{
|
|
185
173
|
leagueType: z.ZodLiteral<"Curling">;
|
|
186
|
-
playerStats: z.ZodRecord<z.ZodString, z.
|
|
187
|
-
fantasyPoints: z.ZodNumber;
|
|
188
|
-
points: z.ZodNumber;
|
|
189
|
-
rebounds: z.ZodNumber;
|
|
190
|
-
assists: z.ZodNumber;
|
|
191
|
-
gamesPlayed: z.ZodNumber;
|
|
192
|
-
}, z.core.$strip> | z.ZodNever>;
|
|
174
|
+
playerStats: z.ZodRecord<z.ZodString, z.ZodNever>;
|
|
193
175
|
updatedAt: z.ZodNumber;
|
|
194
176
|
}, z.core.$strip>, z.ZodObject<{
|
|
195
177
|
leagueType: z.ZodLiteral<"Football">;
|
|
196
|
-
playerStats: z.ZodRecord<z.ZodString, z.
|
|
197
|
-
fantasyPoints: z.ZodNumber;
|
|
198
|
-
points: z.ZodNumber;
|
|
199
|
-
rebounds: z.ZodNumber;
|
|
200
|
-
assists: z.ZodNumber;
|
|
201
|
-
gamesPlayed: z.ZodNumber;
|
|
202
|
-
}, z.core.$strip> | z.ZodNever>;
|
|
178
|
+
playerStats: z.ZodRecord<z.ZodString, z.ZodNever>;
|
|
203
179
|
updatedAt: z.ZodNumber;
|
|
204
180
|
}, z.core.$strip>], "leagueType">;
|
|
205
181
|
export type SportHallOfFame = z.infer<typeof SportHallOfFameSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate-stats.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/aggregate-stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,eAAO,MAAM,yBAAyB;;;;;;;iBAAgC,CAAC;AACvE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,+BAA+B;;;;;;;;;iBAI1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,eAAO,MAAM,sBAAsB;;iBAEjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,4BAA4B;;;;;;iBAEvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyByC,CAAC;AAQzE,eAAO,MAAM,uBAAuB;;;;;;;;;;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ChG,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,wBAAwB;;;;iBAA6D,CAAC;AACnG,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;iCAIhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -52,16 +52,18 @@ export const UserLifetimeStatsSchema = z.object(Object.fromEntries(LEAGUE_TYPE_K
|
|
|
52
52
|
SPORT_KEY_BY_LEAGUE_TYPE[leagueType],
|
|
53
53
|
SPORT_LINE_SCHEMAS[leagueType].lifetime.optional(),
|
|
54
54
|
])));
|
|
55
|
-
|
|
55
|
+
// The sport's hall-of-fame schema comes in as its own type parameter: indexing the line map by a
|
|
56
|
+
// generic sport would type every option's entries as the union of every sport's.
|
|
57
|
+
function sportHallOfFameOf(leagueType, lines) {
|
|
56
58
|
return z.object({
|
|
57
59
|
leagueType: z.literal(leagueType),
|
|
58
|
-
playerStats: z.record(userIdSchema,
|
|
60
|
+
playerStats: z.record(userIdSchema, lines.hallOfFame),
|
|
59
61
|
updatedAt: epochMsSchema,
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
|
-
export const BasketballHallOfFameSchema = sportHallOfFameOf('Basketball');
|
|
63
|
-
export const CurlingHallOfFameSchema = sportHallOfFameOf('Curling');
|
|
64
|
-
export const FootballHallOfFameSchema = sportHallOfFameOf('Football');
|
|
64
|
+
export const BasketballHallOfFameSchema = sportHallOfFameOf('Basketball', SPORT_LINE_SCHEMAS.Basketball);
|
|
65
|
+
export const CurlingHallOfFameSchema = sportHallOfFameOf('Curling', SPORT_LINE_SCHEMAS.Curling);
|
|
66
|
+
export const FootballHallOfFameSchema = sportHallOfFameOf('Football', SPORT_LINE_SCHEMAS.Football);
|
|
65
67
|
export const SportHallOfFameSchema = z.discriminatedUnion('leagueType', [
|
|
66
68
|
BasketballHallOfFameSchema,
|
|
67
69
|
CurlingHallOfFameSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate-stats.js","sourceRoot":"","sources":["../../src/doc-schemas/aggregate-stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAGhF,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,mBAAmB,GAAG;IAC1B,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,WAAW;IACnB,IAAI,EAAE,WAAW;IACjB,SAAS,EAAE,WAAW;IACtB,aAAa,EAAE,WAAW;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAGvE,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,GAAG,mBAAmB;IACtB,QAAQ,EAAE,WAAW;IACrB,OAAO,EAAE,WAAW;CACrB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,WAAW,EAAE,WAAW;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,4BAA4B,GAAG,2BAA2B,CAAC,MAAM,CAAC;IAC7E,WAAW,EAAE,WAAW;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,UAAU,EAAE;QACV,UAAU,E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AU,EAAE,CAAC,CAAC,KAAK,EAAE;QACrB,QAAQ,EAAE,uBAAuB;QACjC,UAAU,EAAE,yBAAyB;KACtC;CACqE,CAAC;AAQzE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAC7C,MAAM,CAAC,WAAW,CAChB,gBAAgB,CAAC,GAAG,CAClB,CAAC,UAAU,EAAE,EAAE,CACb;IACE,wBAAwB,CAAC,UAAU,CAAC;IACpC,kBAAkB,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE;CAC1C,CACb,CACoB,CACxB,CAAC;AAGF,iGAAiG;AACjG,iFAAiF;AACjF,SAAS,iBAAiB,CACxB,UAAa,EACb,KAAwB;IAExB,OAAO,CAAC,CAAC,MAAM,CAAC;QACd,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;QACjC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC;QACrD,SAAS,EAAE,aAAa;KACzB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CACzD,YAAY,EACZ,kBAAkB,CAAC,UAAU,CAC9B,CAAC;AAGF,MAAM,CAAC,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAGhG,MAAM,CAAC,MAAM,wBAAwB,GAAG,iBAAiB,CAAC,UAAU,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AAGnG,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,kBAAkB,CAAC,YAAY,EAAE;IACtE,0BAA0B;IAC1B,uBAAuB;IACvB,wBAAwB;CACzB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { LEAGUE_TYPE_KEYS, SPORT_KEY_BY_LEAGUE_TYPE } from '../types/sports.js';\nimport type { LeagueType } from '../types/sports.js';\nimport type { StatLineKind } from '../types/stats.js';\nimport { countSchema, epochMsSchema, userIdSchema } from './atoms.js';\nimport {\n BasketballPlayerStatsSchema,\n BasketballTeamStatsSchema,\n CurlingTeamStatsSchema,\n FootballTeamStatsSchema,\n} from './game-stats.js';\n\nconst teamSeasonBaseShape = {\n gamesPlayed: countSchema,\n wins: countSchema,\n losses: countSchema,\n ties: countSchema,\n pointsFor: countSchema,\n pointsAgainst: countSchema,\n};\n\nexport const TeamSeasonBaseStatsSchema = z.object(teamSeasonBaseShape);\nexport type TeamSeasonBaseStats = z.infer<typeof TeamSeasonBaseStatsSchema>;\n\nexport const BasketballTeamSeasonStatsSchema = z.object({\n ...teamSeasonBaseShape,\n rebounds: countSchema,\n assists: countSchema,\n});\nexport type BasketballTeamSeasonStats = z.infer<typeof BasketballTeamSeasonStatsSchema>;\n\nexport const GamesPlayedStatsSchema = z.object({\n gamesPlayed: countSchema,\n});\nexport type GamesPlayedStats = z.infer<typeof GamesPlayedStatsSchema>;\n\nexport const BasketballPlayerTotalsSchema = BasketballPlayerStatsSchema.extend({\n gamesPlayed: countSchema,\n});\nexport type BasketballPlayerTotals = z.infer<typeof BasketballPlayerTotalsSchema>;\n\nexport const SPORT_LINE_SCHEMAS = {\n Basketball: {\n gamePlayer: BasketballPlayerStatsSchema,\n membershipRow: BasketballPlayerTotalsSchema,\n lifetime: BasketballPlayerTotalsSchema,\n hallOfFame: BasketballPlayerTotalsSchema,\n gameTeam: BasketballTeamStatsSchema,\n teamSeason: BasketballTeamSeasonStatsSchema,\n },\n Curling: {\n gamePlayer: z.never(),\n membershipRow: GamesPlayedStatsSchema,\n lifetime: GamesPlayedStatsSchema,\n hallOfFame: z.never(),\n gameTeam: CurlingTeamStatsSchema,\n teamSeason: TeamSeasonBaseStatsSchema,\n },\n Football: {\n gamePlayer: z.never(),\n membershipRow: GamesPlayedStatsSchema,\n lifetime: GamesPlayedStatsSchema,\n hallOfFame: z.never(),\n gameTeam: FootballTeamStatsSchema,\n teamSeason: TeamSeasonBaseStatsSchema,\n },\n} as const satisfies Record<LeagueType, Record<StatLineKind, z.ZodType>>;\n\ntype LifetimeLinesShape = {\n [L in LeagueType as (typeof SPORT_KEY_BY_LEAGUE_TYPE)[L]]: z.ZodOptional<\n (typeof SPORT_LINE_SCHEMAS)[L]['lifetime']\n >;\n};\n\nexport const UserLifetimeStatsSchema = z.object(\n Object.fromEntries(\n LEAGUE_TYPE_KEYS.map(\n (leagueType) =>\n [\n SPORT_KEY_BY_LEAGUE_TYPE[leagueType],\n SPORT_LINE_SCHEMAS[leagueType].lifetime.optional(),\n ] as const,\n ),\n ) as LifetimeLinesShape,\n);\nexport type UserLifetimeStats = z.infer<typeof UserLifetimeStatsSchema>;\n\n// The sport's hall-of-fame schema comes in as its own type parameter: indexing the line map by a\n// generic sport would type every option's entries as the union of every sport's.\nfunction sportHallOfFameOf<L extends LeagueType, H extends z.ZodType>(\n leagueType: L,\n lines: { hallOfFame: H },\n) {\n return z.object({\n leagueType: z.literal(leagueType),\n playerStats: z.record(userIdSchema, lines.hallOfFame),\n updatedAt: epochMsSchema,\n });\n}\n\nexport const BasketballHallOfFameSchema = sportHallOfFameOf(\n 'Basketball',\n SPORT_LINE_SCHEMAS.Basketball,\n);\nexport type BasketballHallOfFame = z.infer<typeof BasketballHallOfFameSchema>;\n\nexport const CurlingHallOfFameSchema = sportHallOfFameOf('Curling', SPORT_LINE_SCHEMAS.Curling);\nexport type CurlingHallOfFame = z.infer<typeof CurlingHallOfFameSchema>;\n\nexport const FootballHallOfFameSchema = sportHallOfFameOf('Football', SPORT_LINE_SCHEMAS.Football);\nexport type FootballHallOfFame = z.infer<typeof FootballHallOfFameSchema>;\n\nexport const SportHallOfFameSchema = z.discriminatedUnion('leagueType', [\n BasketballHallOfFameSchema,\n CurlingHallOfFameSchema,\n FootballHallOfFameSchema,\n]);\nexport type SportHallOfFame = z.infer<typeof SportHallOfFameSchema>;\n"]}
|
|
@@ -1,92 +1,94 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const auditEventTypeSchema: z.ZodEnum<{
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"sportLeague.created": "sportLeague.created";
|
|
4
|
+
"sportLeague.updated": "sportLeague.updated";
|
|
5
|
+
"sportLeague.statusChanged": "sportLeague.statusChanged";
|
|
6
|
+
"sportLeague.modeSwitched": "sportLeague.modeSwitched";
|
|
6
7
|
"leagueTeam.created": "leagueTeam.created";
|
|
8
|
+
"teamMembership.roleChanged": "teamMembership.roleChanged";
|
|
9
|
+
"teamMembership.removed": "teamMembership.removed";
|
|
10
|
+
"ghostPlayer.created": "ghostPlayer.created";
|
|
7
11
|
"signedWaiver.created": "signedWaiver.created";
|
|
8
12
|
"ghostPlayer.linked": "ghostPlayer.linked";
|
|
13
|
+
"teamJoinRequest.created": "teamJoinRequest.created";
|
|
9
14
|
"teamJoinRequest.cancelled": "teamJoinRequest.cancelled";
|
|
15
|
+
"teamJoinRequest.accepted": "teamJoinRequest.accepted";
|
|
16
|
+
"teamJoinRequest.rejected": "teamJoinRequest.rejected";
|
|
17
|
+
"teamInvitation.created": "teamInvitation.created";
|
|
10
18
|
"teamInvitation.cancelled": "teamInvitation.cancelled";
|
|
19
|
+
"teamInvitation.accepted": "teamInvitation.accepted";
|
|
20
|
+
"teamInvitation.rejected": "teamInvitation.rejected";
|
|
21
|
+
"leagueFreeAgent.created": "leagueFreeAgent.created";
|
|
22
|
+
"leagueFreeAgent.deleted": "leagueFreeAgent.deleted";
|
|
23
|
+
"leagueFreeAgent.assigned": "leagueFreeAgent.assigned";
|
|
11
24
|
"sportGame.finalized": "sportGame.finalized";
|
|
12
25
|
"sportGame.reopened": "sportGame.reopened";
|
|
13
26
|
"sportGame.absenceChanged": "sportGame.absenceChanged";
|
|
14
27
|
"sportGame.memoUpdated": "sportGame.memoUpdated";
|
|
15
28
|
"sportGame.jumpBallChanged": "sportGame.jumpBallChanged";
|
|
29
|
+
"scheduleWeek.created": "scheduleWeek.created";
|
|
30
|
+
"scheduleWeek.updated": "scheduleWeek.updated";
|
|
31
|
+
"sportGame.created": "sportGame.created";
|
|
16
32
|
"sportGame.updated": "sportGame.updated";
|
|
17
33
|
"sportGame.deleted": "sportGame.deleted";
|
|
34
|
+
"sportLeague.statsRecalculated": "sportLeague.statsRecalculated";
|
|
35
|
+
"userProfile.statsRecalculated": "userProfile.statsRecalculated";
|
|
36
|
+
"sportHallOfFame.recalculated": "sportHallOfFame.recalculated";
|
|
18
37
|
"sportGame.statsCorrected": "sportGame.statsCorrected";
|
|
38
|
+
"statsValidationReport.created": "statsValidationReport.created";
|
|
39
|
+
"statsValidationReport.deleted": "statsValidationReport.deleted";
|
|
40
|
+
"historicalStat.updated": "historicalStat.updated";
|
|
41
|
+
"userProfile.banned": "userProfile.banned";
|
|
42
|
+
"userProfile.unbanned": "userProfile.unbanned";
|
|
43
|
+
"awardDefinition.created": "awardDefinition.created";
|
|
44
|
+
"awardDefinition.badgeReplaced": "awardDefinition.badgeReplaced";
|
|
45
|
+
"awardDefinition.deleted": "awardDefinition.deleted";
|
|
46
|
+
"awardDefinition.granted": "awardDefinition.granted";
|
|
47
|
+
"awardDefinition.revoked": "awardDefinition.revoked";
|
|
48
|
+
"hardwareLoanContract.created": "hardwareLoanContract.created";
|
|
49
|
+
"hardwareLoanContract.signed": "hardwareLoanContract.signed";
|
|
50
|
+
"hardwareLoanContract.returned": "hardwareLoanContract.returned";
|
|
51
|
+
"hardwareLoanContract.deleted": "hardwareLoanContract.deleted";
|
|
52
|
+
"userProfile.registered": "userProfile.registered";
|
|
53
|
+
"userProfile.displayNameChanged": "userProfile.displayNameChanged";
|
|
19
54
|
"waiverTemplate.created": "waiverTemplate.created";
|
|
55
|
+
"waiverTemplate.versionPublished": "waiverTemplate.versionPublished";
|
|
56
|
+
"waiverTemplate.retired": "waiverTemplate.retired";
|
|
20
57
|
"waiverTemplate.deleted": "waiverTemplate.deleted";
|
|
21
58
|
"gameLocation.created": "gameLocation.created";
|
|
22
59
|
"gameLocation.updated": "gameLocation.updated";
|
|
23
60
|
"gameLocation.deleted": "gameLocation.deleted";
|
|
24
61
|
"leagueTeam.updated": "leagueTeam.updated";
|
|
62
|
+
"leagueTeam.captainChanged": "leagueTeam.captainChanged";
|
|
25
63
|
"leagueTeam.deleted": "leagueTeam.deleted";
|
|
64
|
+
"ghostPlayer.removed": "ghostPlayer.removed";
|
|
26
65
|
"leagueTeamContact.updated": "leagueTeamContact.updated";
|
|
27
66
|
"landingPage.updated": "landingPage.updated";
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
67
|
+
"galleryPicture.added": "galleryPicture.added";
|
|
68
|
+
"deadLetter.replayed": "deadLetter.replayed";
|
|
69
|
+
"migrationActionRun.pageRun": "migrationActionRun.pageRun";
|
|
70
|
+
"migrationActionRun.controlRecorded": "migrationActionRun.controlRecorded";
|
|
71
|
+
"migrationActionRun.checkpointRecorded": "migrationActionRun.checkpointRecorded";
|
|
72
|
+
"migrationConsole.cutoverRecorded": "migrationConsole.cutoverRecorded";
|
|
73
|
+
"gameRosterPlayer.statLineResolved": "gameRosterPlayer.statLineResolved";
|
|
74
|
+
"registrationStart.deleted": "registrationStart.deleted";
|
|
75
|
+
"userProfile.signedIn": "userProfile.signedIn";
|
|
76
|
+
"userProfile.passwordReset": "userProfile.passwordReset";
|
|
77
|
+
"adminList.roleGranted": "adminList.roleGranted";
|
|
78
|
+
"adminList.roleRevoked": "adminList.roleRevoked";
|
|
79
|
+
"adminList.claimSynced": "adminList.claimSynced";
|
|
38
80
|
"appConfig.updated": "appConfig.updated";
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"picture.replaced": "picture.replaced";
|
|
44
|
-
"picture.moved": "picture.moved";
|
|
45
|
-
"picture.featuredChanged": "picture.featuredChanged";
|
|
46
|
-
"picture.removed": "picture.removed";
|
|
47
|
-
"award.created": "award.created";
|
|
48
|
-
"award.badgeReplaced": "award.badgeReplaced";
|
|
49
|
-
"award.deleted": "award.deleted";
|
|
50
|
-
"award.granted": "award.granted";
|
|
51
|
-
"award.revoked": "award.revoked";
|
|
81
|
+
"galleryPicture.replaced": "galleryPicture.replaced";
|
|
82
|
+
"galleryPicture.moved": "galleryPicture.moved";
|
|
83
|
+
"galleryPicture.featuredChanged": "galleryPicture.featuredChanged";
|
|
84
|
+
"galleryPicture.removed": "galleryPicture.removed";
|
|
52
85
|
"award.groupDecisionOpened": "award.groupDecisionOpened";
|
|
53
|
-
"hardwareLoanContract.created": "hardwareLoanContract.created";
|
|
54
|
-
"hardwareLoanContract.signed": "hardwareLoanContract.signed";
|
|
55
|
-
"hardwareLoanContract.returned": "hardwareLoanContract.returned";
|
|
56
|
-
"hardwareLoanContract.deleted": "hardwareLoanContract.deleted";
|
|
57
|
-
"ghostPlayer.created": "ghostPlayer.created";
|
|
58
|
-
"teamMembership.roleChanged": "teamMembership.roleChanged";
|
|
59
|
-
"leagueTeam.captainChanged": "leagueTeam.captainChanged";
|
|
60
|
-
"teamMembership.removed": "teamMembership.removed";
|
|
61
|
-
"ghostPlayer.removed": "ghostPlayer.removed";
|
|
62
86
|
"ghostPlayer.closedLeagueLinked": "ghostPlayer.closedLeagueLinked";
|
|
63
|
-
"teamInvitation.created": "teamInvitation.created";
|
|
64
|
-
"teamInvitation.accepted": "teamInvitation.accepted";
|
|
65
|
-
"teamInvitation.rejected": "teamInvitation.rejected";
|
|
66
|
-
"teamJoinRequest.created": "teamJoinRequest.created";
|
|
67
|
-
"teamJoinRequest.accepted": "teamJoinRequest.accepted";
|
|
68
|
-
"teamJoinRequest.rejected": "teamJoinRequest.rejected";
|
|
69
|
-
"leagueFreeAgent.created": "leagueFreeAgent.created";
|
|
70
|
-
"leagueFreeAgent.deleted": "leagueFreeAgent.deleted";
|
|
71
|
-
"leagueFreeAgent.assigned": "leagueFreeAgent.assigned";
|
|
72
|
-
"scheduleWeek.created": "scheduleWeek.created";
|
|
73
|
-
"scheduleWeek.updated": "scheduleWeek.updated";
|
|
74
|
-
"sportGame.created": "sportGame.created";
|
|
75
87
|
"sportGame.statEventsRejected": "sportGame.statEventsRejected";
|
|
76
88
|
"sportGame.statsRecalculated": "sportGame.statsRecalculated";
|
|
77
|
-
"stats.aggregateRecalculated": "stats.aggregateRecalculated";
|
|
78
|
-
"stats.historicalStatsUpdated": "stats.historicalStatsUpdated";
|
|
79
|
-
"stats.validationRun": "stats.validationRun";
|
|
80
|
-
"stats.validationReportDeleted": "stats.validationReportDeleted";
|
|
81
|
-
"stats.unrosteredStatLineResolved": "stats.unrosteredStatLineResolved";
|
|
82
89
|
"adminNotification.archived": "adminNotification.archived";
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"migrationAction.pageRun": "migrationAction.pageRun";
|
|
86
|
-
"migrationAction.writesCommitted": "migrationAction.writesCommitted";
|
|
87
|
-
"migrationAction.controlRecorded": "migrationAction.controlRecorded";
|
|
88
|
-
"migrationAction.checkpointRecorded": "migrationAction.checkpointRecorded";
|
|
89
|
-
"migrationConsole.cutoverRecorded": "migrationConsole.cutoverRecorded";
|
|
90
|
+
"notificationArchiveAllJob.created": "notificationArchiveAllJob.created";
|
|
91
|
+
"migrationActionRun.writesCommitted": "migrationActionRun.writesCommitted";
|
|
90
92
|
}>;
|
|
91
93
|
export declare const AuditActorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
92
94
|
uid: z.ZodNullable<z.ZodString>;
|
|
@@ -115,93 +117,95 @@ export declare const AuditTargetSchema: z.ZodObject<{
|
|
|
115
117
|
export declare const AuditEventSchema: z.ZodObject<{
|
|
116
118
|
id: z.ZodString;
|
|
117
119
|
type: z.ZodEnum<{
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
120
|
+
"sportLeague.created": "sportLeague.created";
|
|
121
|
+
"sportLeague.updated": "sportLeague.updated";
|
|
122
|
+
"sportLeague.statusChanged": "sportLeague.statusChanged";
|
|
123
|
+
"sportLeague.modeSwitched": "sportLeague.modeSwitched";
|
|
121
124
|
"leagueTeam.created": "leagueTeam.created";
|
|
125
|
+
"teamMembership.roleChanged": "teamMembership.roleChanged";
|
|
126
|
+
"teamMembership.removed": "teamMembership.removed";
|
|
127
|
+
"ghostPlayer.created": "ghostPlayer.created";
|
|
122
128
|
"signedWaiver.created": "signedWaiver.created";
|
|
123
129
|
"ghostPlayer.linked": "ghostPlayer.linked";
|
|
130
|
+
"teamJoinRequest.created": "teamJoinRequest.created";
|
|
124
131
|
"teamJoinRequest.cancelled": "teamJoinRequest.cancelled";
|
|
132
|
+
"teamJoinRequest.accepted": "teamJoinRequest.accepted";
|
|
133
|
+
"teamJoinRequest.rejected": "teamJoinRequest.rejected";
|
|
134
|
+
"teamInvitation.created": "teamInvitation.created";
|
|
125
135
|
"teamInvitation.cancelled": "teamInvitation.cancelled";
|
|
136
|
+
"teamInvitation.accepted": "teamInvitation.accepted";
|
|
137
|
+
"teamInvitation.rejected": "teamInvitation.rejected";
|
|
138
|
+
"leagueFreeAgent.created": "leagueFreeAgent.created";
|
|
139
|
+
"leagueFreeAgent.deleted": "leagueFreeAgent.deleted";
|
|
140
|
+
"leagueFreeAgent.assigned": "leagueFreeAgent.assigned";
|
|
126
141
|
"sportGame.finalized": "sportGame.finalized";
|
|
127
142
|
"sportGame.reopened": "sportGame.reopened";
|
|
128
143
|
"sportGame.absenceChanged": "sportGame.absenceChanged";
|
|
129
144
|
"sportGame.memoUpdated": "sportGame.memoUpdated";
|
|
130
145
|
"sportGame.jumpBallChanged": "sportGame.jumpBallChanged";
|
|
146
|
+
"scheduleWeek.created": "scheduleWeek.created";
|
|
147
|
+
"scheduleWeek.updated": "scheduleWeek.updated";
|
|
148
|
+
"sportGame.created": "sportGame.created";
|
|
131
149
|
"sportGame.updated": "sportGame.updated";
|
|
132
150
|
"sportGame.deleted": "sportGame.deleted";
|
|
151
|
+
"sportLeague.statsRecalculated": "sportLeague.statsRecalculated";
|
|
152
|
+
"userProfile.statsRecalculated": "userProfile.statsRecalculated";
|
|
153
|
+
"sportHallOfFame.recalculated": "sportHallOfFame.recalculated";
|
|
133
154
|
"sportGame.statsCorrected": "sportGame.statsCorrected";
|
|
155
|
+
"statsValidationReport.created": "statsValidationReport.created";
|
|
156
|
+
"statsValidationReport.deleted": "statsValidationReport.deleted";
|
|
157
|
+
"historicalStat.updated": "historicalStat.updated";
|
|
158
|
+
"userProfile.banned": "userProfile.banned";
|
|
159
|
+
"userProfile.unbanned": "userProfile.unbanned";
|
|
160
|
+
"awardDefinition.created": "awardDefinition.created";
|
|
161
|
+
"awardDefinition.badgeReplaced": "awardDefinition.badgeReplaced";
|
|
162
|
+
"awardDefinition.deleted": "awardDefinition.deleted";
|
|
163
|
+
"awardDefinition.granted": "awardDefinition.granted";
|
|
164
|
+
"awardDefinition.revoked": "awardDefinition.revoked";
|
|
165
|
+
"hardwareLoanContract.created": "hardwareLoanContract.created";
|
|
166
|
+
"hardwareLoanContract.signed": "hardwareLoanContract.signed";
|
|
167
|
+
"hardwareLoanContract.returned": "hardwareLoanContract.returned";
|
|
168
|
+
"hardwareLoanContract.deleted": "hardwareLoanContract.deleted";
|
|
169
|
+
"userProfile.registered": "userProfile.registered";
|
|
170
|
+
"userProfile.displayNameChanged": "userProfile.displayNameChanged";
|
|
134
171
|
"waiverTemplate.created": "waiverTemplate.created";
|
|
172
|
+
"waiverTemplate.versionPublished": "waiverTemplate.versionPublished";
|
|
173
|
+
"waiverTemplate.retired": "waiverTemplate.retired";
|
|
135
174
|
"waiverTemplate.deleted": "waiverTemplate.deleted";
|
|
136
175
|
"gameLocation.created": "gameLocation.created";
|
|
137
176
|
"gameLocation.updated": "gameLocation.updated";
|
|
138
177
|
"gameLocation.deleted": "gameLocation.deleted";
|
|
139
178
|
"leagueTeam.updated": "leagueTeam.updated";
|
|
179
|
+
"leagueTeam.captainChanged": "leagueTeam.captainChanged";
|
|
140
180
|
"leagueTeam.deleted": "leagueTeam.deleted";
|
|
181
|
+
"ghostPlayer.removed": "ghostPlayer.removed";
|
|
141
182
|
"leagueTeamContact.updated": "leagueTeamContact.updated";
|
|
142
183
|
"landingPage.updated": "landingPage.updated";
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
"
|
|
150
|
-
"
|
|
151
|
-
"
|
|
152
|
-
"
|
|
184
|
+
"galleryPicture.added": "galleryPicture.added";
|
|
185
|
+
"deadLetter.replayed": "deadLetter.replayed";
|
|
186
|
+
"migrationActionRun.pageRun": "migrationActionRun.pageRun";
|
|
187
|
+
"migrationActionRun.controlRecorded": "migrationActionRun.controlRecorded";
|
|
188
|
+
"migrationActionRun.checkpointRecorded": "migrationActionRun.checkpointRecorded";
|
|
189
|
+
"migrationConsole.cutoverRecorded": "migrationConsole.cutoverRecorded";
|
|
190
|
+
"gameRosterPlayer.statLineResolved": "gameRosterPlayer.statLineResolved";
|
|
191
|
+
"registrationStart.deleted": "registrationStart.deleted";
|
|
192
|
+
"userProfile.signedIn": "userProfile.signedIn";
|
|
193
|
+
"userProfile.passwordReset": "userProfile.passwordReset";
|
|
194
|
+
"adminList.roleGranted": "adminList.roleGranted";
|
|
195
|
+
"adminList.roleRevoked": "adminList.roleRevoked";
|
|
196
|
+
"adminList.claimSynced": "adminList.claimSynced";
|
|
153
197
|
"appConfig.updated": "appConfig.updated";
|
|
154
|
-
"
|
|
155
|
-
"
|
|
156
|
-
"
|
|
157
|
-
"
|
|
158
|
-
"picture.replaced": "picture.replaced";
|
|
159
|
-
"picture.moved": "picture.moved";
|
|
160
|
-
"picture.featuredChanged": "picture.featuredChanged";
|
|
161
|
-
"picture.removed": "picture.removed";
|
|
162
|
-
"award.created": "award.created";
|
|
163
|
-
"award.badgeReplaced": "award.badgeReplaced";
|
|
164
|
-
"award.deleted": "award.deleted";
|
|
165
|
-
"award.granted": "award.granted";
|
|
166
|
-
"award.revoked": "award.revoked";
|
|
198
|
+
"galleryPicture.replaced": "galleryPicture.replaced";
|
|
199
|
+
"galleryPicture.moved": "galleryPicture.moved";
|
|
200
|
+
"galleryPicture.featuredChanged": "galleryPicture.featuredChanged";
|
|
201
|
+
"galleryPicture.removed": "galleryPicture.removed";
|
|
167
202
|
"award.groupDecisionOpened": "award.groupDecisionOpened";
|
|
168
|
-
"hardwareLoanContract.created": "hardwareLoanContract.created";
|
|
169
|
-
"hardwareLoanContract.signed": "hardwareLoanContract.signed";
|
|
170
|
-
"hardwareLoanContract.returned": "hardwareLoanContract.returned";
|
|
171
|
-
"hardwareLoanContract.deleted": "hardwareLoanContract.deleted";
|
|
172
|
-
"ghostPlayer.created": "ghostPlayer.created";
|
|
173
|
-
"teamMembership.roleChanged": "teamMembership.roleChanged";
|
|
174
|
-
"leagueTeam.captainChanged": "leagueTeam.captainChanged";
|
|
175
|
-
"teamMembership.removed": "teamMembership.removed";
|
|
176
|
-
"ghostPlayer.removed": "ghostPlayer.removed";
|
|
177
203
|
"ghostPlayer.closedLeagueLinked": "ghostPlayer.closedLeagueLinked";
|
|
178
|
-
"teamInvitation.created": "teamInvitation.created";
|
|
179
|
-
"teamInvitation.accepted": "teamInvitation.accepted";
|
|
180
|
-
"teamInvitation.rejected": "teamInvitation.rejected";
|
|
181
|
-
"teamJoinRequest.created": "teamJoinRequest.created";
|
|
182
|
-
"teamJoinRequest.accepted": "teamJoinRequest.accepted";
|
|
183
|
-
"teamJoinRequest.rejected": "teamJoinRequest.rejected";
|
|
184
|
-
"leagueFreeAgent.created": "leagueFreeAgent.created";
|
|
185
|
-
"leagueFreeAgent.deleted": "leagueFreeAgent.deleted";
|
|
186
|
-
"leagueFreeAgent.assigned": "leagueFreeAgent.assigned";
|
|
187
|
-
"scheduleWeek.created": "scheduleWeek.created";
|
|
188
|
-
"scheduleWeek.updated": "scheduleWeek.updated";
|
|
189
|
-
"sportGame.created": "sportGame.created";
|
|
190
204
|
"sportGame.statEventsRejected": "sportGame.statEventsRejected";
|
|
191
205
|
"sportGame.statsRecalculated": "sportGame.statsRecalculated";
|
|
192
|
-
"stats.aggregateRecalculated": "stats.aggregateRecalculated";
|
|
193
|
-
"stats.historicalStatsUpdated": "stats.historicalStatsUpdated";
|
|
194
|
-
"stats.validationRun": "stats.validationRun";
|
|
195
|
-
"stats.validationReportDeleted": "stats.validationReportDeleted";
|
|
196
|
-
"stats.unrosteredStatLineResolved": "stats.unrosteredStatLineResolved";
|
|
197
206
|
"adminNotification.archived": "adminNotification.archived";
|
|
198
|
-
"
|
|
199
|
-
"
|
|
200
|
-
"migrationAction.pageRun": "migrationAction.pageRun";
|
|
201
|
-
"migrationAction.writesCommitted": "migrationAction.writesCommitted";
|
|
202
|
-
"migrationAction.controlRecorded": "migrationAction.controlRecorded";
|
|
203
|
-
"migrationAction.checkpointRecorded": "migrationAction.checkpointRecorded";
|
|
204
|
-
"migrationConsole.cutoverRecorded": "migrationConsole.cutoverRecorded";
|
|
207
|
+
"notificationArchiveAllJob.created": "notificationArchiveAllJob.created";
|
|
208
|
+
"migrationActionRun.writesCommitted": "migrationActionRun.writesCommitted";
|
|
205
209
|
}>;
|
|
206
210
|
schemaVersion: z.ZodNumber;
|
|
207
211
|
actor: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-event.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/audit-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"audit-event.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/audit-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAgC,CAAC;AAElE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;gCAY3B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAc3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -2,6 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const BasketballLeagueTeamSchema: z.ZodObject<{
|
|
3
3
|
leagueType: z.ZodLiteral<"Basketball">;
|
|
4
4
|
seasonStats: z.ZodOptional<z.ZodObject<{
|
|
5
|
+
rebounds: z.ZodNumber;
|
|
6
|
+
assists: z.ZodNumber;
|
|
5
7
|
gamesPlayed: z.ZodNumber;
|
|
6
8
|
wins: z.ZodNumber;
|
|
7
9
|
losses: z.ZodNumber;
|
|
@@ -10,8 +12,6 @@ export declare const BasketballLeagueTeamSchema: z.ZodObject<{
|
|
|
10
12
|
pointsAgainst: z.ZodNumber;
|
|
11
13
|
}, z.core.$strip>>;
|
|
12
14
|
playerSeasonStats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
13
|
-
gamesPlayed: z.ZodNumber;
|
|
14
|
-
}, z.core.$strip> | z.ZodObject<{
|
|
15
15
|
fantasyPoints: z.ZodNumber;
|
|
16
16
|
points: z.ZodNumber;
|
|
17
17
|
rebounds: z.ZodNumber;
|
|
@@ -164,12 +164,6 @@ export declare const CurlingLeagueTeamSchema: z.ZodObject<{
|
|
|
164
164
|
}, z.core.$strip>>;
|
|
165
165
|
playerSeasonStats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
166
166
|
gamesPlayed: z.ZodNumber;
|
|
167
|
-
}, z.core.$strip> | z.ZodObject<{
|
|
168
|
-
fantasyPoints: z.ZodNumber;
|
|
169
|
-
points: z.ZodNumber;
|
|
170
|
-
rebounds: z.ZodNumber;
|
|
171
|
-
assists: z.ZodNumber;
|
|
172
|
-
gamesPlayed: z.ZodNumber;
|
|
173
167
|
}, z.core.$strip>>>;
|
|
174
168
|
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
175
169
|
icon: z.ZodEnum<{
|
|
@@ -317,12 +311,6 @@ export declare const FootballLeagueTeamSchema: z.ZodObject<{
|
|
|
317
311
|
}, z.core.$strip>>;
|
|
318
312
|
playerSeasonStats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
319
313
|
gamesPlayed: z.ZodNumber;
|
|
320
|
-
}, z.core.$strip> | z.ZodObject<{
|
|
321
|
-
fantasyPoints: z.ZodNumber;
|
|
322
|
-
points: z.ZodNumber;
|
|
323
|
-
rebounds: z.ZodNumber;
|
|
324
|
-
assists: z.ZodNumber;
|
|
325
|
-
gamesPlayed: z.ZodNumber;
|
|
326
314
|
}, z.core.$strip>>>;
|
|
327
315
|
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
328
316
|
icon: z.ZodEnum<{
|
|
@@ -461,6 +449,8 @@ export type FootballLeagueTeam = z.infer<typeof FootballLeagueTeamSchema>;
|
|
|
461
449
|
export declare const LeagueTeamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
462
450
|
leagueType: z.ZodLiteral<"Basketball">;
|
|
463
451
|
seasonStats: z.ZodOptional<z.ZodObject<{
|
|
452
|
+
rebounds: z.ZodNumber;
|
|
453
|
+
assists: z.ZodNumber;
|
|
464
454
|
gamesPlayed: z.ZodNumber;
|
|
465
455
|
wins: z.ZodNumber;
|
|
466
456
|
losses: z.ZodNumber;
|
|
@@ -469,8 +459,6 @@ export declare const LeagueTeamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
469
459
|
pointsAgainst: z.ZodNumber;
|
|
470
460
|
}, z.core.$strip>>;
|
|
471
461
|
playerSeasonStats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
472
|
-
gamesPlayed: z.ZodNumber;
|
|
473
|
-
}, z.core.$strip> | z.ZodObject<{
|
|
474
462
|
fantasyPoints: z.ZodNumber;
|
|
475
463
|
points: z.ZodNumber;
|
|
476
464
|
rebounds: z.ZodNumber;
|
|
@@ -621,12 +609,6 @@ export declare const LeagueTeamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
621
609
|
}, z.core.$strip>>;
|
|
622
610
|
playerSeasonStats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
623
611
|
gamesPlayed: z.ZodNumber;
|
|
624
|
-
}, z.core.$strip> | z.ZodObject<{
|
|
625
|
-
fantasyPoints: z.ZodNumber;
|
|
626
|
-
points: z.ZodNumber;
|
|
627
|
-
rebounds: z.ZodNumber;
|
|
628
|
-
assists: z.ZodNumber;
|
|
629
|
-
gamesPlayed: z.ZodNumber;
|
|
630
612
|
}, z.core.$strip>>>;
|
|
631
613
|
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
632
614
|
icon: z.ZodEnum<{
|
|
@@ -772,12 +754,6 @@ export declare const LeagueTeamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
772
754
|
}, z.core.$strip>>;
|
|
773
755
|
playerSeasonStats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
774
756
|
gamesPlayed: z.ZodNumber;
|
|
775
|
-
}, z.core.$strip> | z.ZodObject<{
|
|
776
|
-
fantasyPoints: z.ZodNumber;
|
|
777
|
-
points: z.ZodNumber;
|
|
778
|
-
rebounds: z.ZodNumber;
|
|
779
|
-
assists: z.ZodNumber;
|
|
780
|
-
gamesPlayed: z.ZodNumber;
|
|
781
757
|
}, z.core.$strip>>>;
|
|
782
758
|
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
783
759
|
icon: z.ZodEnum<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"league-team.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/league-team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"league-team.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/league-team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiDxB,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA4D,CAAC;AACpG,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAsD,CAAC;AAC3F,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAwD,CAAC;AAC9F,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAI3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,uBAAuB;;;;iBAIlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -23,19 +23,19 @@ const leagueTeamBaseShape = {
|
|
|
23
23
|
createdAt: epochMsSchema,
|
|
24
24
|
updatedAt: epochMsSchema,
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
// The sport's line schemas come in as their own type parameters: indexing the line map by a generic
|
|
27
|
+
// sport would type every option's lines as the union of every sport's.
|
|
28
|
+
function leagueTeamOf(leagueType, lines) {
|
|
27
29
|
return z.object({
|
|
28
30
|
...leagueTeamBaseShape,
|
|
29
31
|
leagueType: z.literal(leagueType),
|
|
30
|
-
seasonStats:
|
|
31
|
-
playerSeasonStats: z
|
|
32
|
-
.record(userIdSchema, SPORT_LINE_SCHEMAS[leagueType].membershipRow)
|
|
33
|
-
.optional(),
|
|
32
|
+
seasonStats: z.optional(lines.teamSeason),
|
|
33
|
+
playerSeasonStats: z.optional(z.record(userIdSchema, lines.membershipRow)),
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
export const BasketballLeagueTeamSchema = leagueTeamOf('Basketball');
|
|
37
|
-
export const CurlingLeagueTeamSchema = leagueTeamOf('Curling');
|
|
38
|
-
export const FootballLeagueTeamSchema = leagueTeamOf('Football');
|
|
36
|
+
export const BasketballLeagueTeamSchema = leagueTeamOf('Basketball', SPORT_LINE_SCHEMAS.Basketball);
|
|
37
|
+
export const CurlingLeagueTeamSchema = leagueTeamOf('Curling', SPORT_LINE_SCHEMAS.Curling);
|
|
38
|
+
export const FootballLeagueTeamSchema = leagueTeamOf('Football', SPORT_LINE_SCHEMAS.Football);
|
|
39
39
|
export const LeagueTeamSchema = z.discriminatedUnion('leagueType', [
|
|
40
40
|
BasketballLeagueTeamSchema,
|
|
41
41
|
CurlingLeagueTeamSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"league-team.js","sourceRoot":"","sources":["../../src/doc-schemas/league-team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,mBAA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D,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { CONTACT_PHONE_INPUT, TEAM_NAME_INPUT } from '../constants/text-fields.js';\nimport {\n countSchema,\n epochMsSchema,\n leagueIdSchema,\n teamIconSchema,\n teamTypeSchema,\n userIdSchema,\n} from './atoms.js';\nimport { textFieldSchema } from '../schemas/text-field.js';\nimport type { LeagueType } from '../types/sports.js';\nimport { SPORT_LINE_SCHEMAS } from './aggregate-stats.js';\nimport { GallerySummarySchema } from './gallery.js';\n\nconst leagueTeamBaseShape = {\n name: textFieldSchema(TEAM_NAME_INPUT),\n icon: teamIconSchema,\n leagueId: leagueIdSchema,\n teamType: teamTypeSchema.optional(),\n createdByUserId: userIdSchema,\n pictures: GallerySummarySchema.optional(),\n // Only its changing matters: the write fence between membership changes and roster seeding\n // (RULE-STD-BACKEND-116).\n membershipRevision: countSchema.optional(),\n // Only its changing matters: the write fence between competing invitations, join requests, and\n // membership doors (RULE-STD-BACKEND-116).\n joinRevision: countSchema.optional(),\n // Only its changing matters: the write fence between game creation and the team's deletion\n // (RULE-STD-BACKEND-116).\n scheduleRevision: countSchema.optional(),\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n} as const;\n\n// The sport's line schemas come in as their own type parameters: indexing the line map by a generic\n// sport would type every option's lines as the union of every sport's.\nfunction leagueTeamOf<L extends LeagueType, S extends z.ZodType, R extends z.ZodType>(\n leagueType: L,\n lines: { teamSeason: S; membershipRow: R },\n) {\n return z.object({\n ...leagueTeamBaseShape,\n leagueType: z.literal(leagueType),\n seasonStats: z.optional(lines.teamSeason),\n playerSeasonStats: z.optional(z.record(userIdSchema, lines.membershipRow)),\n });\n}\n\nexport const BasketballLeagueTeamSchema = leagueTeamOf('Basketball', SPORT_LINE_SCHEMAS.Basketball);\nexport type BasketballLeagueTeam = z.infer<typeof BasketballLeagueTeamSchema>;\n\nexport const CurlingLeagueTeamSchema = leagueTeamOf('Curling', SPORT_LINE_SCHEMAS.Curling);\nexport type CurlingLeagueTeam = z.infer<typeof CurlingLeagueTeamSchema>;\n\nexport const FootballLeagueTeamSchema = leagueTeamOf('Football', SPORT_LINE_SCHEMAS.Football);\nexport type FootballLeagueTeam = z.infer<typeof FootballLeagueTeamSchema>;\n\nexport const LeagueTeamSchema = z.discriminatedUnion('leagueType', [\n BasketballLeagueTeamSchema,\n CurlingLeagueTeamSchema,\n FootballLeagueTeamSchema,\n]);\nexport type LeagueTeam = z.infer<typeof LeagueTeamSchema>;\n\nexport const LeagueTeamContactSchema = z.object({\n leagueId: leagueIdSchema,\n contactPhone: textFieldSchema(CONTACT_PHONE_INPUT),\n updatedAt: epochMsSchema,\n});\nexport type LeagueTeamContact = z.infer<typeof LeagueTeamContactSchema>;\n"]}
|