@ttt-productions/q-core 0.1.38 → 0.1.40
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 +2 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +2 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/pagination.d.ts +3 -0
- package/dist/constants/pagination.d.ts.map +1 -0
- package/dist/constants/pagination.js +3 -0
- package/dist/constants/pagination.js.map +1 -0
- 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 -12
- 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/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 +4 -12
- 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 +2 -6
- package/dist/doc-schemas/registry.d.ts.map +1 -1
- package/dist/doc-schemas/sport-game.d.ts.map +1 -1
- package/dist/doc-schemas/sport-game.js +5 -4
- 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/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/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/migration-console/action-ids.d.ts +1 -3
- package/dist/migration-console/action-ids.d.ts.map +1 -1
- package/dist/migration-console/action-ids.js +1 -3
- package/dist/migration-console/action-ids.js.map +1 -1
- package/dist/migration-console/manifest.d.ts.map +1 -1
- package/dist/migration-console/manifest.js +18 -34
- package/dist/migration-console/manifest.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/migration-console.d.ts +12 -36
- package/dist/schemas/migration-console.d.ts.map +1 -1
- package/dist/schemas/schedules.d.ts.map +1 -1
- package/dist/schemas/schedules.js +3 -3
- 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/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/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/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
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import { countSchema, epochMsSchema, leagueIdSchema, teamIconSchema, teamTypeSchema,
|
|
2
|
+
import { CONTACT_PHONE_INPUT, TEAM_NAME_INPUT } from '../constants/text-fields.js';
|
|
3
|
+
import { countSchema, epochMsSchema, leagueIdSchema, teamIconSchema, teamTypeSchema, userIdSchema, } from './atoms.js';
|
|
4
|
+
import { textFieldSchema } from '../schemas/text-field.js';
|
|
4
5
|
import { PlayerSeasonStatsSchema, TeamSeasonStatsSchema } from './aggregate-stats.js';
|
|
5
6
|
import { GallerySummarySchema } from './gallery.js';
|
|
6
7
|
export const LeagueTeamSchema = z.object({
|
|
7
|
-
name: textFieldSchema(
|
|
8
|
+
name: textFieldSchema(TEAM_NAME_INPUT),
|
|
8
9
|
icon: teamIconSchema,
|
|
9
10
|
leagueId: leagueIdSchema,
|
|
10
11
|
teamType: teamTypeSchema.optional(),
|
|
@@ -26,7 +27,7 @@ export const LeagueTeamSchema = z.object({
|
|
|
26
27
|
});
|
|
27
28
|
export const LeagueTeamContactSchema = z.object({
|
|
28
29
|
leagueId: leagueIdSchema,
|
|
29
|
-
contactPhone: textFieldSchema(
|
|
30
|
+
contactPhone: textFieldSchema(CONTACT_PHONE_INPUT),
|
|
30
31
|
updatedAt: epochMsSchema,
|
|
31
32
|
});
|
|
32
33
|
//# sourceMappingURL=league-team.js.map
|
|
@@ -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,
|
|
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;AAC3D,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,eAAe,CAAC,eAAe,CAAC;IACtC,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,cAAc;IACxB,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE;IACnC,eAAe,EAAE,YAAY;IAC7B,WAAW,EAAE,qBAAqB,CAAC,QAAQ,EAAE;IAC7C,iBAAiB,EAAE,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAC,QAAQ,EAAE;IAC7E,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IACzC,2FAA2F;IAC3F,0BAA0B;IAC1B,kBAAkB,EAAE,WAAW,CAAC,QAAQ,EAAE;IAC1C,+FAA+F;IAC/F,2CAA2C;IAC3C,YAAY,EAAE,WAAW,CAAC,QAAQ,EAAE;IACpC,2FAA2F;IAC3F,0BAA0B;IAC1B,gBAAgB,EAAE,WAAW,CAAC,QAAQ,EAAE;IACxC,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,QAAQ,EAAE,cAAc;IACxB,YAAY,EAAE,eAAe,CAAC,mBAAmB,CAAC;IAClD,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 { PlayerSeasonStatsSchema, TeamSeasonStatsSchema } from './aggregate-stats.js';\nimport { GallerySummarySchema } from './gallery.js';\n\nexport const LeagueTeamSchema = z.object({\n name: textFieldSchema(TEAM_NAME_INPUT),\n icon: teamIconSchema,\n leagueId: leagueIdSchema,\n teamType: teamTypeSchema.optional(),\n createdByUserId: userIdSchema,\n seasonStats: TeamSeasonStatsSchema.optional(),\n playerSeasonStats: z.record(userIdSchema, PlayerSeasonStatsSchema).optional(),\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});\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"]}
|
|
@@ -12,7 +12,6 @@ export declare const migrationActionIdSchema: z.ZodEnum<{
|
|
|
12
12
|
"verify.adminList": "verify.adminList";
|
|
13
13
|
"cleanup.orphanGhostPublicUsers": "cleanup.orphanGhostPublicUsers";
|
|
14
14
|
"delete.v1Users": "delete.v1Users";
|
|
15
|
-
"delete.v1AdminRoles": "delete.v1AdminRoles";
|
|
16
15
|
"verify.teamMemberships": "verify.teamMemberships";
|
|
17
16
|
"verify.gameRosterPlayers": "verify.gameRosterPlayers";
|
|
18
17
|
"copy.leagueTeams": "copy.leagueTeams";
|
|
@@ -59,15 +58,14 @@ export declare const migrationActionIdSchema: z.ZodEnum<{
|
|
|
59
58
|
"verify.landingPageConfig": "verify.landingPageConfig";
|
|
60
59
|
"verify.statsBeacon": "verify.statsBeacon";
|
|
61
60
|
"delete.v1LandingBase": "delete.v1LandingBase";
|
|
61
|
+
"delete.v1LandingAdmin": "delete.v1LandingAdmin";
|
|
62
62
|
"copy.waiverTemplates": "copy.waiverTemplates";
|
|
63
63
|
"verify.waiverTemplates": "verify.waiverTemplates";
|
|
64
64
|
"delete.v1Waivers": "delete.v1Waivers";
|
|
65
65
|
"copy.awardDefinitions": "copy.awardDefinitions";
|
|
66
66
|
"verify.awardDefinitions": "verify.awardDefinitions";
|
|
67
|
-
"delete.v1AwardCatalog": "delete.v1AwardCatalog";
|
|
68
67
|
"copy.gameLocations": "copy.gameLocations";
|
|
69
68
|
"verify.gameLocations": "verify.gameLocations";
|
|
70
|
-
"delete.v1GameLocations": "delete.v1GameLocations";
|
|
71
69
|
"delete.v1AdminStats": "delete.v1AdminStats";
|
|
72
70
|
"verify.v1CommerceDiscardable": "verify.v1CommerceDiscardable";
|
|
73
71
|
"verify.v1DisplayNamesUnique": "verify.v1DisplayNamesUnique";
|
|
@@ -168,7 +166,6 @@ export declare const MigrationActionRunSchema: z.ZodObject<{
|
|
|
168
166
|
"verify.adminList": "verify.adminList";
|
|
169
167
|
"cleanup.orphanGhostPublicUsers": "cleanup.orphanGhostPublicUsers";
|
|
170
168
|
"delete.v1Users": "delete.v1Users";
|
|
171
|
-
"delete.v1AdminRoles": "delete.v1AdminRoles";
|
|
172
169
|
"verify.teamMemberships": "verify.teamMemberships";
|
|
173
170
|
"verify.gameRosterPlayers": "verify.gameRosterPlayers";
|
|
174
171
|
"copy.leagueTeams": "copy.leagueTeams";
|
|
@@ -215,15 +212,14 @@ export declare const MigrationActionRunSchema: z.ZodObject<{
|
|
|
215
212
|
"verify.landingPageConfig": "verify.landingPageConfig";
|
|
216
213
|
"verify.statsBeacon": "verify.statsBeacon";
|
|
217
214
|
"delete.v1LandingBase": "delete.v1LandingBase";
|
|
215
|
+
"delete.v1LandingAdmin": "delete.v1LandingAdmin";
|
|
218
216
|
"copy.waiverTemplates": "copy.waiverTemplates";
|
|
219
217
|
"verify.waiverTemplates": "verify.waiverTemplates";
|
|
220
218
|
"delete.v1Waivers": "delete.v1Waivers";
|
|
221
219
|
"copy.awardDefinitions": "copy.awardDefinitions";
|
|
222
220
|
"verify.awardDefinitions": "verify.awardDefinitions";
|
|
223
|
-
"delete.v1AwardCatalog": "delete.v1AwardCatalog";
|
|
224
221
|
"copy.gameLocations": "copy.gameLocations";
|
|
225
222
|
"verify.gameLocations": "verify.gameLocations";
|
|
226
|
-
"delete.v1GameLocations": "delete.v1GameLocations";
|
|
227
223
|
"delete.v1AdminStats": "delete.v1AdminStats";
|
|
228
224
|
"verify.v1CommerceDiscardable": "verify.v1CommerceDiscardable";
|
|
229
225
|
"verify.v1DisplayNamesUnique": "verify.v1DisplayNamesUnique";
|
|
@@ -337,7 +333,6 @@ export declare const MigrationConsoleLockSchema: z.ZodObject<{
|
|
|
337
333
|
"verify.adminList": "verify.adminList";
|
|
338
334
|
"cleanup.orphanGhostPublicUsers": "cleanup.orphanGhostPublicUsers";
|
|
339
335
|
"delete.v1Users": "delete.v1Users";
|
|
340
|
-
"delete.v1AdminRoles": "delete.v1AdminRoles";
|
|
341
336
|
"verify.teamMemberships": "verify.teamMemberships";
|
|
342
337
|
"verify.gameRosterPlayers": "verify.gameRosterPlayers";
|
|
343
338
|
"copy.leagueTeams": "copy.leagueTeams";
|
|
@@ -384,15 +379,14 @@ export declare const MigrationConsoleLockSchema: z.ZodObject<{
|
|
|
384
379
|
"verify.landingPageConfig": "verify.landingPageConfig";
|
|
385
380
|
"verify.statsBeacon": "verify.statsBeacon";
|
|
386
381
|
"delete.v1LandingBase": "delete.v1LandingBase";
|
|
382
|
+
"delete.v1LandingAdmin": "delete.v1LandingAdmin";
|
|
387
383
|
"copy.waiverTemplates": "copy.waiverTemplates";
|
|
388
384
|
"verify.waiverTemplates": "verify.waiverTemplates";
|
|
389
385
|
"delete.v1Waivers": "delete.v1Waivers";
|
|
390
386
|
"copy.awardDefinitions": "copy.awardDefinitions";
|
|
391
387
|
"verify.awardDefinitions": "verify.awardDefinitions";
|
|
392
|
-
"delete.v1AwardCatalog": "delete.v1AwardCatalog";
|
|
393
388
|
"copy.gameLocations": "copy.gameLocations";
|
|
394
389
|
"verify.gameLocations": "verify.gameLocations";
|
|
395
|
-
"delete.v1GameLocations": "delete.v1GameLocations";
|
|
396
390
|
"delete.v1AdminStats": "delete.v1AdminStats";
|
|
397
391
|
"verify.v1CommerceDiscardable": "verify.v1CommerceDiscardable";
|
|
398
392
|
"verify.v1DisplayNamesUnique": "verify.v1DisplayNamesUnique";
|
|
@@ -441,7 +435,6 @@ export declare const MigrationConsoleSchema: z.ZodObject<{
|
|
|
441
435
|
"verify.adminList": "verify.adminList";
|
|
442
436
|
"cleanup.orphanGhostPublicUsers": "cleanup.orphanGhostPublicUsers";
|
|
443
437
|
"delete.v1Users": "delete.v1Users";
|
|
444
|
-
"delete.v1AdminRoles": "delete.v1AdminRoles";
|
|
445
438
|
"verify.teamMemberships": "verify.teamMemberships";
|
|
446
439
|
"verify.gameRosterPlayers": "verify.gameRosterPlayers";
|
|
447
440
|
"copy.leagueTeams": "copy.leagueTeams";
|
|
@@ -488,15 +481,14 @@ export declare const MigrationConsoleSchema: z.ZodObject<{
|
|
|
488
481
|
"verify.landingPageConfig": "verify.landingPageConfig";
|
|
489
482
|
"verify.statsBeacon": "verify.statsBeacon";
|
|
490
483
|
"delete.v1LandingBase": "delete.v1LandingBase";
|
|
484
|
+
"delete.v1LandingAdmin": "delete.v1LandingAdmin";
|
|
491
485
|
"copy.waiverTemplates": "copy.waiverTemplates";
|
|
492
486
|
"verify.waiverTemplates": "verify.waiverTemplates";
|
|
493
487
|
"delete.v1Waivers": "delete.v1Waivers";
|
|
494
488
|
"copy.awardDefinitions": "copy.awardDefinitions";
|
|
495
489
|
"verify.awardDefinitions": "verify.awardDefinitions";
|
|
496
|
-
"delete.v1AwardCatalog": "delete.v1AwardCatalog";
|
|
497
490
|
"copy.gameLocations": "copy.gameLocations";
|
|
498
491
|
"verify.gameLocations": "verify.gameLocations";
|
|
499
|
-
"delete.v1GameLocations": "delete.v1GameLocations";
|
|
500
492
|
"delete.v1AdminStats": "delete.v1AdminStats";
|
|
501
493
|
"verify.v1CommerceDiscardable": "verify.v1CommerceDiscardable";
|
|
502
494
|
"verify.v1DisplayNamesUnique": "verify.v1DisplayNamesUnique";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-console.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/migration-console.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"migration-console.d.ts","sourceRoot":"","sources":["../../src/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AAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAMrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAMjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { MIGRATION_EVIDENCE_INPUT } from '../constants/text-fields.js';
|
|
3
3
|
import { MIGRATION_ACTION_ID_KEYS } from '../migration-console/action-ids.js';
|
|
4
4
|
import { MAX_MIGRATION_FINDING_TEXT_LENGTH, MAX_MIGRATION_RUN_FINDINGS, MIGRATION_DESTINATION_STATE_KEYS, MIGRATION_RUN_STATUS_KEYS, } from '../migration-console/run-state.js';
|
|
5
|
-
import { countSchema, documentIdSegmentSchema, epochMsSchema, repairReasonSchema, statsOperationIdSchema,
|
|
5
|
+
import { countSchema, documentIdSegmentSchema, epochMsSchema, repairReasonSchema, statsOperationIdSchema, userIdSchema, } from './atoms.js';
|
|
6
|
+
import { textFieldSchema } from '../schemas/text-field.js';
|
|
6
7
|
export const migrationActionIdSchema = z.enum(MIGRATION_ACTION_ID_KEYS);
|
|
7
8
|
export const migrationDestinationStateSchema = z.enum(MIGRATION_DESTINATION_STATE_KEYS);
|
|
8
9
|
export const migrationOperationIdSchema = documentIdSegmentSchema;
|
|
9
|
-
export const migrationEvidenceSchema = textFieldSchema(
|
|
10
|
+
export const migrationEvidenceSchema = textFieldSchema(MIGRATION_EVIDENCE_INPUT);
|
|
10
11
|
const findingText = z.string().max(MAX_MIGRATION_FINDING_TEXT_LENGTH);
|
|
11
12
|
export const MigrationFindingSchema = z.strictObject({
|
|
12
13
|
category: z.string().min(1).max(64),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-console.js","sourceRoot":"","sources":["../../src/doc-schemas/migration-console.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"migration-console.js","sourceRoot":"","sources":["../../src/doc-schemas/migration-console.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EACL,iCAAiC,EACjC,0BAA0B,EAC1B,gCAAgC,EAChC,yBAAyB,GAC1B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;AACxE,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;AACxF,MAAM,CAAC,MAAM,0BAA0B,GAAG,uBAAuB,CAAC;AAClE,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC,wBAAwB,CAAC,CAAC;AAEjF,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;AAEtE,MAAM,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,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpD,aAAa,EAAE,WAAW,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,YAAY,CAAC;IACtD,UAAU,EAAE,aAAa;IACzB,gBAAgB,EAAE,YAAY;IAC9B,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,QAAQ,EAAE;IACxD,QAAQ,EAAE,uBAAuB;CAClC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,YAAY,CAAC;IACrD,QAAQ,EAAE,uBAAuB;IACjC,GAAG,EAAE,wBAAwB,CAAC,QAAQ,EAAE;IACxC,OAAO,EAAE,wBAAwB,CAAC,QAAQ,EAAE;IAC5C,QAAQ,EAAE,yBAAyB,CAAC,QAAQ,EAAE;CAC/C,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,YAAY,CAAC;IACvD,QAAQ,EAAE,uBAAuB;IACjC,WAAW,EAAE,0BAA0B;IACvC,YAAY,EAAE,YAAY;IAC1B,SAAS,EAAE,aAAa;IACxB,aAAa,EAAE,aAAa,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAAC;IACnD,gBAAgB,EAAE,+BAA+B;IACjD,iBAAiB,EAAE,aAAa,CAAC,QAAQ,EAAE;IAC3C,uBAAuB,EAAE,YAAY,CAAC,QAAQ,EAAE;IAChD,IAAI,EAAE,0BAA0B,CAAC,QAAQ,EAAE;IAC3C,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { MIGRATION_EVIDENCE_INPUT } from '../constants/text-fields.js';\nimport { MIGRATION_ACTION_ID_KEYS } from '../migration-console/action-ids.js';\nimport {\n MAX_MIGRATION_FINDING_TEXT_LENGTH,\n MAX_MIGRATION_RUN_FINDINGS,\n MIGRATION_DESTINATION_STATE_KEYS,\n MIGRATION_RUN_STATUS_KEYS,\n} from '../migration-console/run-state.js';\nimport {\n countSchema,\n documentIdSegmentSchema,\n epochMsSchema,\n repairReasonSchema,\n statsOperationIdSchema,\n userIdSchema,\n} from './atoms.js';\nimport { textFieldSchema } from '../schemas/text-field.js';\n\nexport const migrationActionIdSchema = z.enum(MIGRATION_ACTION_ID_KEYS);\nexport const migrationDestinationStateSchema = z.enum(MIGRATION_DESTINATION_STATE_KEYS);\nexport const migrationOperationIdSchema = documentIdSegmentSchema;\nexport const migrationEvidenceSchema = textFieldSchema(MIGRATION_EVIDENCE_INPUT);\n\nconst findingText = z.string().max(MAX_MIGRATION_FINDING_TEXT_LENGTH);\n\nexport const MigrationFindingSchema = z.strictObject({\n category: z.string().min(1).max(64),\n id: findingText,\n field: findingText,\n reason: findingText,\n});\nexport type MigrationFinding = z.infer<typeof MigrationFindingSchema>;\n\nexport const MigrationRunCountsSchema = z.strictObject({\n read: countSchema,\n written: countSchema,\n skipped: countSchema,\n checked: countSchema,\n missing: countSchema,\n mismatched: countSchema,\n});\nexport type MigrationRunCounts = z.infer<typeof MigrationRunCountsSchema>;\n\nexport const MigrationRunRecordSchema = z.strictObject({\n operationId: migrationOperationIdSchema,\n dryRun: z.boolean(),\n reason: repairReasonSchema,\n startedByUserId: userIdSchema,\n startedAt: epochMsSchema,\n updatedAt: epochMsSchema,\n completedAt: epochMsSchema.optional(),\n status: z.enum(MIGRATION_RUN_STATUS_KEYS),\n pages: countSchema,\n nextResumeAfter: z.string().min(1).nullable(),\n counts: MigrationRunCountsSchema,\n details: z.record(z.string().min(1), countSchema),\n findings: z.array(MigrationFindingSchema).max(MAX_MIGRATION_RUN_FINDINGS),\n findingsNotKept: countSchema,\n expectEmptySource: z.boolean(),\n acknowledgeUnexaminedSources: z.boolean().optional(),\n stoppedReason: findingText.optional(),\n});\nexport type MigrationRunRecord = z.infer<typeof MigrationRunRecordSchema>;\n\nexport const MigrationStepRecordSchema = z.strictObject({\n recordedAt: epochMsSchema,\n recordedByUserId: userIdSchema,\n operationIds: z.array(statsOperationIdSchema).optional(),\n evidence: migrationEvidenceSchema,\n});\nexport type MigrationStepRecord = z.infer<typeof MigrationStepRecordSchema>;\n\nexport const MigrationActionRunSchema = z.strictObject({\n actionId: migrationActionIdSchema,\n run: MigrationRunRecordSchema.optional(),\n preview: MigrationRunRecordSchema.optional(),\n recorded: MigrationStepRecordSchema.optional(),\n});\nexport type MigrationActionRun = z.infer<typeof MigrationActionRunSchema>;\n\nexport const MigrationConsoleLockSchema = z.strictObject({\n actionId: migrationActionIdSchema,\n operationId: migrationOperationIdSchema,\n heldByUserId: userIdSchema,\n expiresAt: epochMsSchema,\n pageClaimedAt: epochMsSchema.optional(),\n});\nexport type MigrationConsoleLock = z.infer<typeof MigrationConsoleLockSchema>;\n\nexport const MigrationConsoleSchema = z.strictObject({\n destinationState: migrationDestinationStateSchema,\n cutoverRecordedAt: epochMsSchema.optional(),\n cutoverRecordedByUserId: userIdSchema.optional(),\n lock: MigrationConsoleLockSchema.nullable(),\n updatedAt: epochMsSchema,\n});\nexport type MigrationConsole = z.infer<typeof MigrationConsoleSchema>;\n"]}
|
|
@@ -2851,7 +2851,6 @@ export declare const COLLECTION_SCHEMAS: {
|
|
|
2851
2851
|
"verify.adminList": "verify.adminList";
|
|
2852
2852
|
"cleanup.orphanGhostPublicUsers": "cleanup.orphanGhostPublicUsers";
|
|
2853
2853
|
"delete.v1Users": "delete.v1Users";
|
|
2854
|
-
"delete.v1AdminRoles": "delete.v1AdminRoles";
|
|
2855
2854
|
"verify.teamMemberships": "verify.teamMemberships";
|
|
2856
2855
|
"verify.gameRosterPlayers": "verify.gameRosterPlayers";
|
|
2857
2856
|
"copy.leagueTeams": "copy.leagueTeams";
|
|
@@ -2898,15 +2897,14 @@ export declare const COLLECTION_SCHEMAS: {
|
|
|
2898
2897
|
"verify.landingPageConfig": "verify.landingPageConfig";
|
|
2899
2898
|
"verify.statsBeacon": "verify.statsBeacon";
|
|
2900
2899
|
"delete.v1LandingBase": "delete.v1LandingBase";
|
|
2900
|
+
"delete.v1LandingAdmin": "delete.v1LandingAdmin";
|
|
2901
2901
|
"copy.waiverTemplates": "copy.waiverTemplates";
|
|
2902
2902
|
"verify.waiverTemplates": "verify.waiverTemplates";
|
|
2903
2903
|
"delete.v1Waivers": "delete.v1Waivers";
|
|
2904
2904
|
"copy.awardDefinitions": "copy.awardDefinitions";
|
|
2905
2905
|
"verify.awardDefinitions": "verify.awardDefinitions";
|
|
2906
|
-
"delete.v1AwardCatalog": "delete.v1AwardCatalog";
|
|
2907
2906
|
"copy.gameLocations": "copy.gameLocations";
|
|
2908
2907
|
"verify.gameLocations": "verify.gameLocations";
|
|
2909
|
-
"delete.v1GameLocations": "delete.v1GameLocations";
|
|
2910
2908
|
"delete.v1AdminStats": "delete.v1AdminStats";
|
|
2911
2909
|
"verify.v1CommerceDiscardable": "verify.v1CommerceDiscardable";
|
|
2912
2910
|
"verify.v1DisplayNamesUnique": "verify.v1DisplayNamesUnique";
|
|
@@ -2955,7 +2953,6 @@ export declare const COLLECTION_SCHEMAS: {
|
|
|
2955
2953
|
"verify.adminList": "verify.adminList";
|
|
2956
2954
|
"cleanup.orphanGhostPublicUsers": "cleanup.orphanGhostPublicUsers";
|
|
2957
2955
|
"delete.v1Users": "delete.v1Users";
|
|
2958
|
-
"delete.v1AdminRoles": "delete.v1AdminRoles";
|
|
2959
2956
|
"verify.teamMemberships": "verify.teamMemberships";
|
|
2960
2957
|
"verify.gameRosterPlayers": "verify.gameRosterPlayers";
|
|
2961
2958
|
"copy.leagueTeams": "copy.leagueTeams";
|
|
@@ -3002,15 +2999,14 @@ export declare const COLLECTION_SCHEMAS: {
|
|
|
3002
2999
|
"verify.landingPageConfig": "verify.landingPageConfig";
|
|
3003
3000
|
"verify.statsBeacon": "verify.statsBeacon";
|
|
3004
3001
|
"delete.v1LandingBase": "delete.v1LandingBase";
|
|
3002
|
+
"delete.v1LandingAdmin": "delete.v1LandingAdmin";
|
|
3005
3003
|
"copy.waiverTemplates": "copy.waiverTemplates";
|
|
3006
3004
|
"verify.waiverTemplates": "verify.waiverTemplates";
|
|
3007
3005
|
"delete.v1Waivers": "delete.v1Waivers";
|
|
3008
3006
|
"copy.awardDefinitions": "copy.awardDefinitions";
|
|
3009
3007
|
"verify.awardDefinitions": "verify.awardDefinitions";
|
|
3010
|
-
"delete.v1AwardCatalog": "delete.v1AwardCatalog";
|
|
3011
3008
|
"copy.gameLocations": "copy.gameLocations";
|
|
3012
3009
|
"verify.gameLocations": "verify.gameLocations";
|
|
3013
|
-
"delete.v1GameLocations": "delete.v1GameLocations";
|
|
3014
3010
|
"delete.v1AdminStats": "delete.v1AdminStats";
|
|
3015
3011
|
"verify.v1CommerceDiscardable": "verify.v1CommerceDiscardable";
|
|
3016
3012
|
"verify.v1DisplayNamesUnique": "verify.v1DisplayNamesUnique";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkD7B,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkD7B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sport-game.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/sport-game.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"sport-game.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/sport-game.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAmBrD,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;CAaa,CAAC;AAEnD,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,UAAU,CAAC,CAAC;AACtF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,OAAO,CAAC,CAAC;AAChF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,QAAQ,CAAC,CAAC;AAElF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,wBAAwB,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AAE/E,eAAO,MAAM,cAAc;;iBAEzB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AA8CtD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOa,CAAC;AAC/C,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMgB,CAAC;AAC/C,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMe,CAAC;AAC/C,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAI1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,sBAAsB;;;;;iBAKjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { parseGameRosterPlayerId } from '../ids/compound-ids.js';
|
|
3
|
-
import {
|
|
3
|
+
import { GAME_MEMO_INPUT, SCHEDULE_WEEK_TITLE_INPUT } from '../constants/text-fields.js';
|
|
4
4
|
import { SPORT_LINE_SCHEMAS } from './aggregate-stats.js';
|
|
5
5
|
import { gameStatsSchema } from './game-stats.js';
|
|
6
|
-
import { calendarDateSchema, countSchema, epochMsSchema, gameRosterPlayerIdSchema, gameStatusSchema, leagueIdSchema, scheduleWeekIdSchema, statsOperationIdSchema, teamIdSchema,
|
|
6
|
+
import { calendarDateSchema, countSchema, epochMsSchema, gameRosterPlayerIdSchema, gameStatusSchema, leagueIdSchema, scheduleWeekIdSchema, statsOperationIdSchema, teamIdSchema, userIdSchema, } from './atoms.js';
|
|
7
|
+
import { textFieldSchema } from '../schemas/text-field.js';
|
|
7
8
|
import { gameLocationIdSchema, gameLocationSubLocationSchema } from './game-location.js';
|
|
8
9
|
// Spelled per sport so each payload keeps its exact type.
|
|
9
10
|
export const SPORT_GAME_STATS_SCHEMAS = {
|
|
@@ -17,7 +18,7 @@ export const GameTeamSchema = z.object({
|
|
|
17
18
|
const sportGameBase = {
|
|
18
19
|
leagueId: leagueIdSchema,
|
|
19
20
|
weekId: scheduleWeekIdSchema,
|
|
20
|
-
weekTitle: textFieldSchema(
|
|
21
|
+
weekTitle: textFieldSchema(SCHEDULE_WEEK_TITLE_INPUT),
|
|
21
22
|
weekLocation: z.string(),
|
|
22
23
|
weekStartDate: epochMsSchema,
|
|
23
24
|
startTime: epochMsSchema,
|
|
@@ -30,7 +31,7 @@ const sportGameBase = {
|
|
|
30
31
|
teamIds: z.array(teamIdSchema).min(1).max(2),
|
|
31
32
|
score: z.record(teamIdSchema, countSchema),
|
|
32
33
|
statEventSequence: countSchema,
|
|
33
|
-
memos: z.record(z.string(), textFieldSchema(
|
|
34
|
+
memos: z.record(z.string(), textFieldSchema(GAME_MEMO_INPUT)).optional(),
|
|
34
35
|
absentRosterPlayerIds: z.array(gameRosterPlayerIdSchema),
|
|
35
36
|
nonScoringRosterPlayerIds: z.array(gameRosterPlayerIdSchema).optional(),
|
|
36
37
|
statsOperationId: statsOperationIdSchema.optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sport-game.js","sourceRoot":"","sources":["../../src/doc-schemas/sport-game.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"sport-game.js","sourceRoot":"","sources":["../../src/doc-schemas/sport-game.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE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AAC,CAAC;AAGH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,QAAQ,EAAE,aAAa;CACxB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { parseGameRosterPlayerId } from '../ids/compound-ids.js';\nimport { GAME_MEMO_INPUT, SCHEDULE_WEEK_TITLE_INPUT } from '../constants/text-fields.js';\nimport type { LeagueType } from '../types/sports.js';\nimport { SPORT_LINE_SCHEMAS } from './aggregate-stats.js';\nimport { gameStatsSchema } from './game-stats.js';\nimport {\n calendarDateSchema,\n countSchema,\n epochMsSchema,\n gameRosterPlayerIdSchema,\n gameStatusSchema,\n leagueIdSchema,\n scheduleWeekIdSchema,\n statsOperationIdSchema,\n teamIdSchema,\n userIdSchema,\n} from './atoms.js';\nimport { textFieldSchema } from '../schemas/text-field.js';\nimport { gameLocationIdSchema, gameLocationSubLocationSchema } from './game-location.js';\n\n// Spelled per sport so each payload keeps its exact type.\nexport const SPORT_GAME_STATS_SCHEMAS = {\n Basketball: gameStatsSchema(\n SPORT_LINE_SCHEMAS.Basketball.gameTeam,\n SPORT_LINE_SCHEMAS.Basketball.gamePlayer,\n ),\n Curling: gameStatsSchema(\n SPORT_LINE_SCHEMAS.Curling.gameTeam,\n SPORT_LINE_SCHEMAS.Curling.gamePlayer,\n ),\n Football: gameStatsSchema(\n SPORT_LINE_SCHEMAS.Football.gameTeam,\n SPORT_LINE_SCHEMAS.Football.gamePlayer,\n ),\n} as const satisfies Record<LeagueType, z.ZodType>;\n\nexport type BasketballGameStats = z.infer<typeof SPORT_GAME_STATS_SCHEMAS.Basketball>;\nexport type CurlingGameStats = z.infer<typeof SPORT_GAME_STATS_SCHEMAS.Curling>;\nexport type FootballGameStats = z.infer<typeof SPORT_GAME_STATS_SCHEMAS.Football>;\n\nexport type GameStats = z.infer<(typeof SPORT_GAME_STATS_SCHEMAS)[LeagueType]>;\n\nexport const GameTeamSchema = z.object({\n teamId: teamIdSchema,\n});\nexport type GameTeam = z.infer<typeof GameTeamSchema>;\n\nconst sportGameBase = {\n leagueId: leagueIdSchema,\n weekId: scheduleWeekIdSchema,\n weekTitle: textFieldSchema(SCHEDULE_WEEK_TITLE_INPUT),\n weekLocation: z.string(),\n weekStartDate: epochMsSchema,\n startTime: epochMsSchema,\n dayKey: calendarDateSchema,\n locationLabel: z.string(),\n gameLocationId: gameLocationIdSchema.optional(),\n subLocation: gameLocationSubLocationSchema.optional(),\n status: gameStatusSchema,\n teams: z.tuple([GameTeamSchema, GameTeamSchema]),\n teamIds: z.array(teamIdSchema).min(1).max(2),\n score: z.record(teamIdSchema, countSchema),\n statEventSequence: countSchema,\n memos: z.record(z.string(), textFieldSchema(GAME_MEMO_INPUT)).optional(),\n absentRosterPlayerIds: z.array(gameRosterPlayerIdSchema),\n nonScoringRosterPlayerIds: z.array(gameRosterPlayerIdSchema).optional(),\n statsOperationId: statsOperationIdSchema.optional(),\n finalizedAt: epochMsSchema.optional(),\n reopenedAt: epochMsSchema.optional(),\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n};\n\nfunction rollupMatchesTeams(game: {\n teamIds: string[];\n score: Record<string, number>;\n stats: { teamStats: Record<string, unknown>; playerStats: Record<string, unknown> };\n}): boolean {\n const teams = new Set(game.teamIds);\n const namesEveryTeam = (keys: string[]) =>\n keys.length === teams.size && keys.every((key) => teams.has(key));\n return (\n namesEveryTeam(Object.keys(game.stats.teamStats)) &&\n namesEveryTeam(Object.keys(game.score)) &&\n Object.keys(game.stats.playerStats).every((key) =>\n teams.has(parseGameRosterPlayerId(key)?.teamId ?? ''),\n )\n );\n}\nconst ROLLUP_MISMATCH = \"The stats rollup and score mirror hold exactly the game's teams.\";\n\nexport const BasketballGameSchema = z\n .object({\n ...sportGameBase,\n leagueType: z.literal('Basketball' satisfies LeagueType),\n stats: SPORT_GAME_STATS_SCHEMAS.Basketball,\n jumpBallTeamId: teamIdSchema.optional(),\n })\n .refine(rollupMatchesTeams, ROLLUP_MISMATCH);\nexport type BasketballGame = z.infer<typeof BasketballGameSchema>;\n\nexport const CurlingGameSchema = z\n .object({\n ...sportGameBase,\n leagueType: z.literal('Curling' satisfies LeagueType),\n stats: SPORT_GAME_STATS_SCHEMAS.Curling,\n })\n .refine(rollupMatchesTeams, ROLLUP_MISMATCH);\nexport type CurlingGame = z.infer<typeof CurlingGameSchema>;\n\nexport const FootballGameSchema = z\n .object({\n ...sportGameBase,\n leagueType: z.literal('Football' satisfies LeagueType),\n stats: SPORT_GAME_STATS_SCHEMAS.Football,\n })\n .refine(rollupMatchesTeams, ROLLUP_MISMATCH);\nexport type FootballGame = z.infer<typeof FootballGameSchema>;\n\nexport const SportGameSchema = z.discriminatedUnion('leagueType', [\n BasketballGameSchema,\n CurlingGameSchema,\n FootballGameSchema,\n]);\nexport type SportGame = z.infer<typeof SportGameSchema>;\n\nexport const GameRosterPlayerSchema = z.object({\n userId: userIdSchema,\n teamId: teamIdSchema,\n isGhost: z.boolean(),\n syncedAt: epochMsSchema,\n});\nexport type GameRosterPlayer = z.infer<typeof GameRosterPlayerSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sport-league.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/sport-league.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"sport-league.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/sport-league.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,eAAO,MAAM,iCAAiC,4CAA4C,CAAC;AAC3F,eAAO,MAAM,mCAAmC,2FAC0C,CAAC;AAE3F,wBAAgB,8BAA8B,CAAC,MAAM,EAAE;IACrD,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC,GAAG,OAAO,CAEV;AAED,wBAAgB,oBAAoB,CAClC,CAAC,SAAS;IACR,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC,EACD,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAehD;AAED,eAAO,MAAM,mBAAmB,aAAsC,CAAC;AAEvE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwBM,CAAC;AACrC,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { MAX_PLAYOFF_CUTOFF } from '../constants/business.js';
|
|
3
|
-
import {
|
|
4
|
-
import { calendarDateSchema, countSchema, epochMsSchema, leagueModeSchema, leagueStatusSchema, leagueTypeSchema,
|
|
3
|
+
import { LEAGUE_DESCRIPTION_INPUT, LEAGUE_TITLE_INPUT } from '../constants/text-fields.js';
|
|
4
|
+
import { calendarDateSchema, countSchema, epochMsSchema, leagueModeSchema, leagueStatusSchema, leagueTypeSchema, } from './atoms.js';
|
|
5
|
+
import { textFieldSchema } from '../schemas/text-field.js';
|
|
5
6
|
import { GallerySummarySchema } from './gallery.js';
|
|
6
7
|
import { waiverTemplateIdSchema } from './waiver-template.js';
|
|
7
8
|
export const LEAGUE_DATES_OUT_OF_ORDER_MESSAGE = 'The league cannot end before it starts.';
|
|
@@ -28,8 +29,8 @@ export function refineLeagueSettings(league, ctx) {
|
|
|
28
29
|
export const playoffCutoffSchema = countSchema.max(MAX_PLAYOFF_CUTOFF);
|
|
29
30
|
export const SportLeagueSchema = z
|
|
30
31
|
.object({
|
|
31
|
-
leagueTitle: textFieldSchema(
|
|
32
|
-
description: textFieldSchema(
|
|
32
|
+
leagueTitle: textFieldSchema(LEAGUE_TITLE_INPUT),
|
|
33
|
+
description: textFieldSchema(LEAGUE_DESCRIPTION_INPUT),
|
|
33
34
|
leagueType: leagueTypeSchema,
|
|
34
35
|
leagueMode: leagueModeSchema,
|
|
35
36
|
leagueStartDate: calendarDateSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sport-league.js","sourceRoot":"","sources":["../../src/doc-schemas/sport-league.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,
|
|
1
|
+
{"version":3,"file":"sport-league.js","sourceRoot":"","sources":["../../src/doc-schemas/sport-league.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,CAAC,MAAM,iCAAiC,GAAG,yCAAyC,CAAC;AAC3F,MAAM,CAAC,MAAM,mCAAmC,GAC9C,wFAAwF,CAAC;AAE3F,MAAM,UAAU,8BAA8B,CAAC,MAG9C;IACC,OAAO,MAAM,CAAC,cAAc,KAAK,CAAC,MAAM,C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AC1B,YAAY,EAAE,WAAW,CAAC,QAAQ,EAAE;IACpC,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;CACzB,CAAC;KACD,WAAW,CAAC,oBAAoB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { MAX_PLAYOFF_CUTOFF } from '../constants/business.js';\nimport { LEAGUE_DESCRIPTION_INPUT, LEAGUE_TITLE_INPUT } from '../constants/text-fields.js';\nimport {\n calendarDateSchema,\n countSchema,\n epochMsSchema,\n leagueModeSchema,\n leagueStatusSchema,\n leagueTypeSchema,\n} from './atoms.js';\nimport { textFieldSchema } from '../schemas/text-field.js';\nimport { GallerySummarySchema } from './gallery.js';\nimport { waiverTemplateIdSchema } from './waiver-template.js';\n\nexport const LEAGUE_DATES_OUT_OF_ORDER_MESSAGE = 'The league cannot end before it starts.';\nexport const WAIVER_REQUIREMENT_MISMATCH_MESSAGE =\n 'Choose a waiver template when the league requires a waiver, and none when it does not.';\n\nexport function hasConsistentWaiverRequirement(league: {\n requiresWaiver: boolean;\n waiverTemplateId?: string | undefined;\n}): boolean {\n return league.requiresWaiver === (league.waiverTemplateId !== undefined);\n}\n\nexport function refineLeagueSettings<\n T extends {\n leagueStartDate: string;\n leagueEndDate: string;\n requiresWaiver: boolean;\n waiverTemplateId?: string | undefined;\n },\n>(league: T, ctx: z.core.$RefinementCtx<T>): void {\n if (league.leagueEndDate < league.leagueStartDate) {\n ctx.addIssue({\n code: 'custom',\n path: ['leagueEndDate'],\n message: LEAGUE_DATES_OUT_OF_ORDER_MESSAGE,\n });\n }\n if (!hasConsistentWaiverRequirement(league)) {\n ctx.addIssue({\n code: 'custom',\n path: ['waiverTemplateId'],\n message: WAIVER_REQUIREMENT_MISMATCH_MESSAGE,\n });\n }\n}\n\nexport const playoffCutoffSchema = countSchema.max(MAX_PLAYOFF_CUTOFF);\n\nexport const SportLeagueSchema = z\n .object({\n leagueTitle: textFieldSchema(LEAGUE_TITLE_INPUT),\n description: textFieldSchema(LEAGUE_DESCRIPTION_INPUT),\n leagueType: leagueTypeSchema,\n leagueMode: leagueModeSchema,\n leagueStartDate: calendarDateSchema,\n leagueEndDate: calendarDateSchema,\n status: leagueStatusSchema,\n playoffCutoff: playoffCutoffSchema,\n playoffCutoffComp: playoffCutoffSchema,\n playoffCutoffRec: playoffCutoffSchema,\n requiresWaiver: z.boolean(),\n waiverTemplateId: waiverTemplateIdSchema.optional(),\n pictures: GallerySummarySchema.optional(),\n // Only its changing matters: the write fence of the MAX_TEAMS_PER_LEAGUE cap\n // (RULE-STD-BACKEND-116).\n teamRevision: countSchema.optional(),\n // Only its changing matters: the write fence of the MAX_GAMES_PER_LEAGUE cap\n // (RULE-STD-BACKEND-116).\n gameRevision: countSchema.optional(),\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n })\n .superRefine(refineLeagueSettings);\nexport type SportLeague = z.infer<typeof SportLeagueSchema>;\n"]}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { MAX_APP_VERSION_LENGTH } from '../constants/business.js';
|
|
3
|
-
import {
|
|
3
|
+
import { ANNOUNCEMENT_MESSAGE_INPUT, LANDING_ABOUT_TEXT_INPUT, LANDING_HERO_TITLE_INPUT, MAINTENANCE_MESSAGE_INPUT, } from '../constants/text-fields.js';
|
|
4
4
|
import { MAX_STATS_VALIDATION_DISCREPANCIES } from '../constants/sports.js';
|
|
5
5
|
import { GallerySummarySchema } from './gallery.js';
|
|
6
|
-
import { countSchema, documentIdSegmentSchema, epochMsSchema, gameIdSchema, leagueIdSchema, statsBeaconActionSchema, statsDiscrepancyKindSchema, statsOperationIdSchema, teamIdSchema,
|
|
6
|
+
import { countSchema, documentIdSegmentSchema, epochMsSchema, gameIdSchema, leagueIdSchema, statsBeaconActionSchema, statsDiscrepancyKindSchema, statsOperationIdSchema, teamIdSchema, userIdSchema, } from './atoms.js';
|
|
7
|
+
import { textFieldSchema } from '../schemas/text-field.js';
|
|
7
8
|
export const AppConfigSchema = z.object({
|
|
8
9
|
// `''` is valid here — no version published yet; only the update input requires a value.
|
|
9
10
|
appVersion: z.string().max(MAX_APP_VERSION_LENGTH),
|
|
10
11
|
maintenanceMode: z.boolean(),
|
|
11
|
-
maintenanceMessage: textFieldSchema(
|
|
12
|
+
maintenanceMessage: textFieldSchema(MAINTENANCE_MESSAGE_INPUT).optional(),
|
|
12
13
|
registrationEnabled: z.boolean(),
|
|
13
|
-
announcementMessage: textFieldSchema(
|
|
14
|
+
announcementMessage: textFieldSchema(ANNOUNCEMENT_MESSAGE_INPUT).optional(),
|
|
14
15
|
});
|
|
15
16
|
export const LandingPageConfigSchema = z.object({
|
|
16
|
-
heroTitle: textFieldSchema(
|
|
17
|
-
aboutCompany: textFieldSchema(
|
|
17
|
+
heroTitle: textFieldSchema(LANDING_HERO_TITLE_INPUT),
|
|
18
|
+
aboutCompany: textFieldSchema(LANDING_ABOUT_TEXT_INPUT),
|
|
18
19
|
pictures: GallerySummarySchema.optional(),
|
|
19
20
|
updatedAt: epochMsSchema,
|
|
20
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kCAAkC,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,o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AAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,EACrE,mCAAmC,CACpC,CAAC;AAGJ,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,YAAY,CAAC;IACzD,iBAAiB,EAAE,WAAW;IAC9B,iBAAiB,EAAE,WAAW;IAC9B,iBAAiB,EAAE,WAAW;IAC9B,mBAAmB,EAAE,WAAW;IAChC,kBAAkB,EAAE,WAAW;CAChC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,YAAY,CAAC;IACxD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,WAAW,EAAE,sBAAsB;IACnC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,YAAY;IACzB,KAAK,EAAE,0BAA0B;IACjC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,GAAG,CAAC,kCAAkC,CAAC;IACtF,iBAAiB,EAAE,CAAC,CAAC,aAAa,CAAC,0BAA0B,EAAE,WAAW,CAAC;IAC3E,OAAO,EAAE,4BAA4B;CACtC,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { MAX_APP_VERSION_LENGTH } from '../constants/business.js';\nimport {\n ANNOUNCEMENT_MESSAGE_INPUT,\n LANDING_ABOUT_TEXT_INPUT,\n LANDING_HERO_TITLE_INPUT,\n MAINTENANCE_MESSAGE_INPUT,\n} from '../constants/text-fields.js';\nimport { MAX_STATS_VALIDATION_DISCREPANCIES } from '../constants/sports.js';\nimport { GallerySummarySchema } from './gallery.js';\nimport {\n countSchema,\n documentIdSegmentSchema,\n epochMsSchema,\n gameIdSchema,\n leagueIdSchema,\n statsBeaconActionSchema,\n statsDiscrepancyKindSchema,\n statsOperationIdSchema,\n teamIdSchema,\n userIdSchema,\n} from './atoms.js';\nimport { textFieldSchema } from '../schemas/text-field.js';\n\nexport const AppConfigSchema = z.object({\n // `''` is valid here — no version published yet; only the update input requires a value.\n appVersion: z.string().max(MAX_APP_VERSION_LENGTH),\n maintenanceMode: z.boolean(),\n maintenanceMessage: textFieldSchema(MAINTENANCE_MESSAGE_INPUT).optional(),\n registrationEnabled: z.boolean(),\n announcementMessage: textFieldSchema(ANNOUNCEMENT_MESSAGE_INPUT).optional(),\n});\nexport type AppConfig = z.infer<typeof AppConfigSchema>;\n\nexport const LandingPageConfigSchema = z.object({\n heroTitle: textFieldSchema(LANDING_HERO_TITLE_INPUT),\n aboutCompany: textFieldSchema(LANDING_ABOUT_TEXT_INPUT),\n pictures: GallerySummarySchema.optional(),\n updatedAt: epochMsSchema,\n});\nexport type LandingPageConfig = z.infer<typeof LandingPageConfigSchema>;\n\nexport const StatsBeaconSchema = z.object({\n updatedAt: epochMsSchema,\n // A fresh document id minted by every write, so two commits in the same millisecond still move\n // the beacon.\n changeId: documentIdSegmentSchema.optional(),\n action: statsBeaconActionSchema,\n leagueId: leagueIdSchema.optional(),\n gameId: gameIdSchema.optional(),\n teamIds: z.array(teamIdSchema).optional(),\n});\nexport type StatsBeacon = z.infer<typeof StatsBeaconSchema>;\n\nexport const AdminListSchema = z.object({\n admins: z.array(userIdSchema),\n referees: z.array(userIdSchema),\n});\nexport type AdminList = z.infer<typeof AdminListSchema>;\n\nexport const STATS_DISCREPANCY_VALUE_SCHEMA = z.union([\n z.number(),\n z.string(),\n z.array(z.number().nullable()),\n z.record(z.string(), z.number()),\n z.null(),\n]);\n\nexport const StatsDiscrepancySchema = z.strictObject({\n kind: statsDiscrepancyKindSchema,\n gameId: gameIdSchema.optional(),\n path: z.string().min(1),\n key: z.string().min(1).optional(),\n field: z.string().min(1).optional(),\n expected: STATS_DISCREPANCY_VALUE_SCHEMA.optional(),\n actual: STATS_DISCREPANCY_VALUE_SCHEMA.optional(),\n});\nexport type StatsDiscrepancy = z.infer<typeof StatsDiscrepancySchema>;\n\nexport const StatsValidationScopeSchema = z\n .strictObject({ gameId: gameIdSchema.optional(), leagueId: leagueIdSchema.optional() })\n .refine(\n (scope) => scope.gameId === undefined || scope.leagueId === undefined,\n 'One game or one league, not both.',\n );\nexport type StatsValidationScope = z.infer<typeof StatsValidationScopeSchema>;\n\nexport const StatsValidationSummarySchema = z.strictObject({\n totalGamesChecked: countSchema,\n totalUsersChecked: countSchema,\n totalTeamsChecked: countSchema,\n totalLeaguesChecked: countSchema,\n discrepanciesFound: countSchema,\n});\nexport type StatsValidationSummary = z.infer<typeof StatsValidationSummarySchema>;\n\nexport const StatsValidationReportSchema = z.strictObject({\n reportId: z.string().min(1),\n operationId: statsOperationIdSchema,\n ranAt: epochMsSchema,\n ranByUserId: userIdSchema,\n scope: StatsValidationScopeSchema,\n complete: z.boolean(),\n discrepancies: z.array(StatsDiscrepancySchema).max(MAX_STATS_VALIDATION_DISCREPANCIES),\n discrepancyCounts: z.partialRecord(statsDiscrepancyKindSchema, countSchema),\n summary: StatsValidationSummarySchema,\n});\nexport type StatsValidationReport = z.infer<typeof StatsValidationReportSchema>;\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import { epochMsSchema, teamJoinRequestStatusSchema, leagueIdSchema, teamIdSchema, teamInvitationStatusSchema, teamJoinMethodSchema, teamMembershipStatusSchema, teamRoleSchema,
|
|
2
|
+
import { TEAM_INVITATION_MESSAGE_INPUT, TEAM_JOIN_REQUEST_MESSAGE_INPUT, } from '../constants/text-fields.js';
|
|
3
|
+
import { epochMsSchema, teamJoinRequestStatusSchema, leagueIdSchema, teamIdSchema, teamInvitationStatusSchema, teamJoinMethodSchema, teamMembershipStatusSchema, teamRoleSchema, userIdSchema, } from './atoms.js';
|
|
4
|
+
import { textFieldSchema } from '../schemas/text-field.js';
|
|
4
5
|
export const TeamMembershipSchema = z.object({
|
|
5
6
|
leagueId: leagueIdSchema,
|
|
6
7
|
teamId: teamIdSchema,
|
|
@@ -19,7 +20,7 @@ export const TeamInvitationSchema = z.object({
|
|
|
19
20
|
teamId: teamIdSchema,
|
|
20
21
|
invitedUserId: userIdSchema,
|
|
21
22
|
invitedByUserId: userIdSchema,
|
|
22
|
-
message: textFieldSchema(
|
|
23
|
+
message: textFieldSchema(TEAM_INVITATION_MESSAGE_INPUT),
|
|
23
24
|
status: teamInvitationStatusSchema,
|
|
24
25
|
createdAt: epochMsSchema,
|
|
25
26
|
respondedAt: epochMsSchema.optional(),
|
|
@@ -28,7 +29,7 @@ export const TeamJoinRequestSchema = z.object({
|
|
|
28
29
|
leagueId: leagueIdSchema,
|
|
29
30
|
teamId: teamIdSchema,
|
|
30
31
|
userId: userIdSchema,
|
|
31
|
-
message: textFieldSchema(
|
|
32
|
+
message: textFieldSchema(TEAM_JOIN_REQUEST_MESSAGE_INPUT),
|
|
32
33
|
status: teamJoinRequestStatusSchema,
|
|
33
34
|
createdAt: epochMsSchema,
|
|
34
35
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team-membership.js","sourceRoot":"","sources":["../../src/doc-schemas/team-membership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"team-membership.js","sourceRoot":"","sources":["../../src/doc-schemas/team-membership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,GAChC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,cAAc,EACd,YAAY,EACZ,0BAA0B,EAC1B,oBAAoB,EACpB,0BAA0B,EAC1B,cAAc,EACd,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,CAA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E_INPUT,\n TEAM_JOIN_REQUEST_MESSAGE_INPUT,\n} from '../constants/text-fields.js';\nimport {\n epochMsSchema,\n teamJoinRequestStatusSchema,\n leagueIdSchema,\n teamIdSchema,\n teamInvitationStatusSchema,\n teamJoinMethodSchema,\n teamMembershipStatusSchema,\n teamRoleSchema,\n userIdSchema,\n} from './atoms.js';\nimport { textFieldSchema } from '../schemas/text-field.js';\n\nexport const TeamMembershipSchema = z.object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n role: teamRoleSchema,\n status: teamMembershipStatusSchema,\n isGhost: z.boolean(),\n joinedVia: teamJoinMethodSchema.optional(),\n teamInvitationId: z.string().optional(),\n linkedFromGhostUserId: z.string().optional(),\n joinedAt: epochMsSchema,\n updatedAt: epochMsSchema,\n});\nexport type TeamMembership = z.infer<typeof TeamMembershipSchema>;\n\nexport const TeamInvitationSchema = z.object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n invitedUserId: userIdSchema,\n invitedByUserId: userIdSchema,\n message: textFieldSchema(TEAM_INVITATION_MESSAGE_INPUT),\n status: teamInvitationStatusSchema,\n createdAt: epochMsSchema,\n respondedAt: epochMsSchema.optional(),\n});\nexport type TeamInvitation = z.infer<typeof TeamInvitationSchema>;\n\nexport const TeamJoinRequestSchema = z.object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n message: textFieldSchema(TEAM_JOIN_REQUEST_MESSAGE_INPUT),\n status: teamJoinRequestStatusSchema,\n createdAt: epochMsSchema,\n});\nexport type TeamJoinRequest = z.infer<typeof TeamJoinRequestSchema>;\n\nexport const LeagueFreeAgentSchema = z.object({\n leagueId: leagueIdSchema,\n userId: userIdSchema,\n createdAt: epochMsSchema,\n});\nexport type LeagueFreeAgent = z.infer<typeof LeagueFreeAgentSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-profile.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/user-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"user-profile.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/user-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,eAAe;;;;EAAsB,CAAC;AAEnD,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAU5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;iBAQhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,qBAAqB;;;;;kBAA6D,CAAC;AAChG,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AASpE,eAAO,MAAM,oBAAoB,EAE5B,SAAS,CAAC,MAAM,eAAe,CAAC,EAAE,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { THEME_NAMES } from '@ttt-productions/theme-core';
|
|
3
3
|
import { EMAIL_MAX_LENGTH } from '../constants/business.js';
|
|
4
|
-
import {
|
|
4
|
+
import { CONTACT_PHONE_INPUT, DISPLAY_NAME_INPUT } from '../constants/text-fields.js';
|
|
5
5
|
import { BasketballPlayerTotalsSchema, UserLifetimeStatsSchema } from './aggregate-stats.js';
|
|
6
|
-
import { epochMsSchema,
|
|
6
|
+
import { epochMsSchema, userStatusSchema } from './atoms.js';
|
|
7
|
+
import { textFieldSchema } from '../schemas/text-field.js';
|
|
7
8
|
import { awardIdSchema } from './catalogs.js';
|
|
8
9
|
export const themeNameSchema = z.enum(THEME_NAMES);
|
|
9
10
|
export const GrantedAwardSchema = z.object({
|
|
@@ -11,7 +12,7 @@ export const GrantedAwardSchema = z.object({
|
|
|
11
12
|
grantedAt: epochMsSchema,
|
|
12
13
|
});
|
|
13
14
|
export const UserProfileSchema = z.object({
|
|
14
|
-
displayName: textFieldSchema(
|
|
15
|
+
displayName: textFieldSchema(DISPLAY_NAME_INPUT),
|
|
15
16
|
displayName_lowercase: z.string(),
|
|
16
17
|
userStatus: userStatusSchema,
|
|
17
18
|
lifetimeStats: UserLifetimeStatsSchema.optional(),
|
|
@@ -25,7 +26,7 @@ export const UserPrivateDataSchema = z.object({
|
|
|
25
26
|
email: z.string().max(EMAIL_MAX_LENGTH),
|
|
26
27
|
registrationStartedAt: epochMsSchema.optional(),
|
|
27
28
|
orphanDeletionClaimedAt: epochMsSchema.optional(),
|
|
28
|
-
defaultContactPhone: textFieldSchema(
|
|
29
|
+
defaultContactPhone: textFieldSchema(CONTACT_PHONE_INPUT).optional(),
|
|
29
30
|
theme: themeNameSchema.optional(),
|
|
30
31
|
reducedMotion: z.boolean().optional(),
|
|
31
32
|
updatedAt: epochMsSchema,
|