@ttt-productions/q-core 0.1.39 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/sports.d.ts +0 -6
- package/dist/constants/sports.d.ts.map +1 -1
- package/dist/constants/sports.js +0 -6
- package/dist/constants/sports.js.map +1 -1
- package/dist/constants/text-fields.d.ts +147 -0
- package/dist/constants/text-fields.d.ts.map +1 -0
- package/dist/{input-formats/input-formats.js → constants/text-fields.js} +50 -26
- package/dist/constants/text-fields.js.map +1 -0
- package/dist/doc-schemas/atoms.d.ts +0 -13
- package/dist/doc-schemas/atoms.d.ts.map +1 -1
- package/dist/doc-schemas/atoms.js +3 -28
- package/dist/doc-schemas/atoms.js.map +1 -1
- package/dist/doc-schemas/audit-event.d.ts +0 -2
- package/dist/doc-schemas/audit-event.d.ts.map +1 -1
- package/dist/doc-schemas/catalogs.d.ts.map +1 -1
- package/dist/doc-schemas/catalogs.js +4 -3
- package/dist/doc-schemas/catalogs.js.map +1 -1
- package/dist/doc-schemas/game-location.d.ts.map +1 -1
- package/dist/doc-schemas/game-location.js +7 -6
- package/dist/doc-schemas/game-location.js.map +1 -1
- package/dist/doc-schemas/league-team.d.ts.map +1 -1
- package/dist/doc-schemas/league-team.js +5 -4
- package/dist/doc-schemas/league-team.js.map +1 -1
- package/dist/doc-schemas/migration-console.d.ts.map +1 -1
- package/dist/doc-schemas/migration-console.js +4 -3
- package/dist/doc-schemas/migration-console.js.map +1 -1
- package/dist/doc-schemas/registry.d.ts +0 -75
- package/dist/doc-schemas/registry.d.ts.map +1 -1
- package/dist/doc-schemas/sport-game.d.ts +0 -6
- package/dist/doc-schemas/sport-game.d.ts.map +1 -1
- package/dist/doc-schemas/sport-game.js +5 -5
- package/dist/doc-schemas/sport-game.js.map +1 -1
- package/dist/doc-schemas/sport-league.d.ts.map +1 -1
- package/dist/doc-schemas/sport-league.js +5 -4
- package/dist/doc-schemas/sport-league.js.map +1 -1
- package/dist/doc-schemas/stats-operation.d.ts +0 -141
- package/dist/doc-schemas/stats-operation.d.ts.map +1 -1
- package/dist/doc-schemas/stats-operation.js +2 -41
- package/dist/doc-schemas/stats-operation.js.map +1 -1
- package/dist/doc-schemas/system.d.ts +0 -3
- package/dist/doc-schemas/system.d.ts.map +1 -1
- package/dist/doc-schemas/system.js +7 -6
- package/dist/doc-schemas/system.js.map +1 -1
- package/dist/doc-schemas/team-membership.js +5 -4
- package/dist/doc-schemas/team-membership.js.map +1 -1
- package/dist/doc-schemas/user-profile.d.ts.map +1 -1
- package/dist/doc-schemas/user-profile.js +5 -4
- package/dist/doc-schemas/user-profile.js.map +1 -1
- package/dist/doc-schemas/waiver-template.d.ts.map +1 -1
- package/dist/doc-schemas/waiver-template.js +5 -4
- package/dist/doc-schemas/waiver-template.js.map +1 -1
- package/dist/ids/index.d.ts +0 -1
- package/dist/ids/index.d.ts.map +1 -1
- package/dist/ids/index.js +0 -1
- package/dist/ids/index.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/schemas/app-config.d.ts.map +1 -1
- package/dist/schemas/app-config.js +8 -7
- package/dist/schemas/app-config.js.map +1 -1
- package/dist/schemas/atoms.d.ts.map +1 -1
- package/dist/schemas/atoms.js +8 -7
- package/dist/schemas/atoms.js.map +1 -1
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/leagues.d.ts.map +1 -1
- package/dist/schemas/leagues.js +5 -4
- package/dist/schemas/leagues.js.map +1 -1
- package/dist/schemas/schedules.d.ts +0 -4
- package/dist/schemas/schedules.d.ts.map +1 -1
- package/dist/schemas/schedules.js +5 -9
- package/dist/schemas/schedules.js.map +1 -1
- package/dist/schemas/scoring.d.ts +6 -6
- package/dist/schemas/scoring.d.ts.map +1 -1
- package/dist/schemas/scoring.js +4 -3
- package/dist/schemas/scoring.js.map +1 -1
- package/dist/schemas/stats.d.ts +0 -1
- package/dist/schemas/stats.d.ts.map +1 -1
- package/dist/schemas/teams.d.ts +4 -16
- package/dist/schemas/teams.d.ts.map +1 -1
- package/dist/schemas/teams.js +4 -16
- package/dist/schemas/teams.js.map +1 -1
- package/dist/schemas/text-field.d.ts +4 -0
- package/dist/schemas/text-field.d.ts.map +1 -0
- package/dist/schemas/text-field.js +12 -0
- package/dist/schemas/text-field.js.map +1 -0
- package/dist/schemas/waiver-templates.d.ts.map +1 -1
- package/dist/schemas/waiver-templates.js +4 -4
- package/dist/schemas/waiver-templates.js.map +1 -1
- package/dist/sports/contribution.d.ts +3 -10
- package/dist/sports/contribution.d.ts.map +1 -1
- package/dist/sports/contribution.js +10 -9
- package/dist/sports/contribution.js.map +1 -1
- package/dist/types/audit.d.ts +1 -1
- package/dist/types/audit.d.ts.map +1 -1
- package/dist/types/audit.js +0 -1
- package/dist/types/audit.js.map +1 -1
- package/dist/types/schedules.d.ts +1 -1
- package/dist/types/schedules.d.ts.map +1 -1
- package/dist/types/schedules.js +1 -2
- package/dist/types/schedules.js.map +1 -1
- package/dist/types/stats.d.ts +3 -7
- package/dist/types/stats.d.ts.map +1 -1
- package/dist/types/stats.js +1 -16
- package/dist/types/stats.js.map +1 -1
- package/dist/types/unions.d.ts +2 -2
- package/dist/types/unions.d.ts.map +1 -1
- package/dist/types/unions.js +0 -1
- package/dist/types/unions.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/text-field.d.ts +15 -0
- package/dist/utils/text-field.d.ts.map +1 -0
- package/dist/utils/text-field.js +32 -0
- package/dist/utils/text-field.js.map +1 -0
- package/package.json +1 -1
- package/dist/ids/stats-operation-ids.d.ts +0 -3
- package/dist/ids/stats-operation-ids.d.ts.map +0 -1
- package/dist/ids/stats-operation-ids.js +0 -10
- package/dist/ids/stats-operation-ids.js.map +0 -1
- package/dist/input-formats/input-formats.d.ts +0 -123
- package/dist/input-formats/input-formats.d.ts.map +0 -1
- package/dist/input-formats/input-formats.js.map +0 -1
|
@@ -190,78 +190,6 @@ export declare const StatsDestinationChangeSchema: z.ZodObject<{
|
|
|
190
190
|
after: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
191
191
|
}, z.core.$strict>;
|
|
192
192
|
export type StatsDestinationChange = z.infer<typeof StatsDestinationChangeSchema>;
|
|
193
|
-
export declare const GhostPlayerStatsOperationSchema: z.ZodObject<{
|
|
194
|
-
kind: z.ZodLiteral<"ghostPlayerStats">;
|
|
195
|
-
scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
196
|
-
action: z.ZodLiteral<"link">;
|
|
197
|
-
teamId: z.ZodString;
|
|
198
|
-
ghostUserId: z.ZodString;
|
|
199
|
-
userId: z.ZodString;
|
|
200
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
201
|
-
action: z.ZodLiteral<"removal">;
|
|
202
|
-
teamId: z.ZodString;
|
|
203
|
-
ghostUserId: z.ZodString;
|
|
204
|
-
}, z.core.$strict>], "action">;
|
|
205
|
-
reason: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
206
|
-
removedFinishedGameEntries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
207
|
-
gameId: z.ZodString;
|
|
208
|
-
wasAbsent: z.ZodBoolean;
|
|
209
|
-
wasNonScoring: z.ZodBoolean;
|
|
210
|
-
}, z.core.$strict>>>;
|
|
211
|
-
removedOpenGameIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
212
|
-
linkedGames: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
213
|
-
gameId: z.ZodString;
|
|
214
|
-
completed: z.ZodBoolean;
|
|
215
|
-
merged: z.ZodBoolean;
|
|
216
|
-
}, z.core.$strict>>>;
|
|
217
|
-
destinationChanges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
218
|
-
ref: z.ZodString;
|
|
219
|
-
field: z.ZodString;
|
|
220
|
-
before: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
221
|
-
after: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
222
|
-
}, z.core.$strict>>>;
|
|
223
|
-
membershipOutcome: z.ZodOptional<z.ZodEnum<{
|
|
224
|
-
handedOver: "handedOver";
|
|
225
|
-
created: "created";
|
|
226
|
-
merged: "merged";
|
|
227
|
-
kept: "kept";
|
|
228
|
-
}>>;
|
|
229
|
-
startedByUserId: z.ZodString;
|
|
230
|
-
startedAt: z.ZodNumber;
|
|
231
|
-
updatedAt: z.ZodNumber;
|
|
232
|
-
status: z.ZodEnum<{
|
|
233
|
-
running: "running";
|
|
234
|
-
complete: "complete";
|
|
235
|
-
stopped: "stopped";
|
|
236
|
-
}>;
|
|
237
|
-
resumeAfter: z.ZodOptional<z.ZodString>;
|
|
238
|
-
counts: z.ZodObject<{
|
|
239
|
-
read: z.ZodNumber;
|
|
240
|
-
changed: z.ZodNumber;
|
|
241
|
-
skipped: z.ZodNumber;
|
|
242
|
-
}, z.core.$strict>;
|
|
243
|
-
}, z.core.$strict>;
|
|
244
|
-
export type GhostPlayerStatsOperation = z.infer<typeof GhostPlayerStatsOperationSchema>;
|
|
245
|
-
export declare const GameDeletionOperationSchema: z.ZodObject<{
|
|
246
|
-
kind: z.ZodLiteral<"gameDeletion">;
|
|
247
|
-
scope: z.ZodObject<{
|
|
248
|
-
gameId: z.ZodString;
|
|
249
|
-
}, z.core.$strict>;
|
|
250
|
-
startedByUserId: z.ZodString;
|
|
251
|
-
startedAt: z.ZodNumber;
|
|
252
|
-
updatedAt: z.ZodNumber;
|
|
253
|
-
status: z.ZodEnum<{
|
|
254
|
-
running: "running";
|
|
255
|
-
complete: "complete";
|
|
256
|
-
stopped: "stopped";
|
|
257
|
-
}>;
|
|
258
|
-
resumeAfter: z.ZodOptional<z.ZodString>;
|
|
259
|
-
counts: z.ZodObject<{
|
|
260
|
-
read: z.ZodNumber;
|
|
261
|
-
changed: z.ZodNumber;
|
|
262
|
-
skipped: z.ZodNumber;
|
|
263
|
-
}, z.core.$strict>;
|
|
264
|
-
}, z.core.$strict>;
|
|
265
193
|
export declare const StatsOperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
266
194
|
kind: z.ZodLiteral<"leagueStatsRebuild">;
|
|
267
195
|
scope: z.ZodObject<{
|
|
@@ -421,75 +349,6 @@ export declare const StatsOperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
421
349
|
changed: z.ZodNumber;
|
|
422
350
|
skipped: z.ZodNumber;
|
|
423
351
|
}, z.core.$strict>;
|
|
424
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
425
|
-
kind: z.ZodLiteral<"ghostPlayerStats">;
|
|
426
|
-
scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
427
|
-
action: z.ZodLiteral<"link">;
|
|
428
|
-
teamId: z.ZodString;
|
|
429
|
-
ghostUserId: z.ZodString;
|
|
430
|
-
userId: z.ZodString;
|
|
431
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
432
|
-
action: z.ZodLiteral<"removal">;
|
|
433
|
-
teamId: z.ZodString;
|
|
434
|
-
ghostUserId: z.ZodString;
|
|
435
|
-
}, z.core.$strict>], "action">;
|
|
436
|
-
reason: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
437
|
-
removedFinishedGameEntries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
438
|
-
gameId: z.ZodString;
|
|
439
|
-
wasAbsent: z.ZodBoolean;
|
|
440
|
-
wasNonScoring: z.ZodBoolean;
|
|
441
|
-
}, z.core.$strict>>>;
|
|
442
|
-
removedOpenGameIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
443
|
-
linkedGames: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
444
|
-
gameId: z.ZodString;
|
|
445
|
-
completed: z.ZodBoolean;
|
|
446
|
-
merged: z.ZodBoolean;
|
|
447
|
-
}, z.core.$strict>>>;
|
|
448
|
-
destinationChanges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
449
|
-
ref: z.ZodString;
|
|
450
|
-
field: z.ZodString;
|
|
451
|
-
before: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
452
|
-
after: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
453
|
-
}, z.core.$strict>>>;
|
|
454
|
-
membershipOutcome: z.ZodOptional<z.ZodEnum<{
|
|
455
|
-
handedOver: "handedOver";
|
|
456
|
-
created: "created";
|
|
457
|
-
merged: "merged";
|
|
458
|
-
kept: "kept";
|
|
459
|
-
}>>;
|
|
460
|
-
startedByUserId: z.ZodString;
|
|
461
|
-
startedAt: z.ZodNumber;
|
|
462
|
-
updatedAt: z.ZodNumber;
|
|
463
|
-
status: z.ZodEnum<{
|
|
464
|
-
running: "running";
|
|
465
|
-
complete: "complete";
|
|
466
|
-
stopped: "stopped";
|
|
467
|
-
}>;
|
|
468
|
-
resumeAfter: z.ZodOptional<z.ZodString>;
|
|
469
|
-
counts: z.ZodObject<{
|
|
470
|
-
read: z.ZodNumber;
|
|
471
|
-
changed: z.ZodNumber;
|
|
472
|
-
skipped: z.ZodNumber;
|
|
473
|
-
}, z.core.$strict>;
|
|
474
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
475
|
-
kind: z.ZodLiteral<"gameDeletion">;
|
|
476
|
-
scope: z.ZodObject<{
|
|
477
|
-
gameId: z.ZodString;
|
|
478
|
-
}, z.core.$strict>;
|
|
479
|
-
startedByUserId: z.ZodString;
|
|
480
|
-
startedAt: z.ZodNumber;
|
|
481
|
-
updatedAt: z.ZodNumber;
|
|
482
|
-
status: z.ZodEnum<{
|
|
483
|
-
running: "running";
|
|
484
|
-
complete: "complete";
|
|
485
|
-
stopped: "stopped";
|
|
486
|
-
}>;
|
|
487
|
-
resumeAfter: z.ZodOptional<z.ZodString>;
|
|
488
|
-
counts: z.ZodObject<{
|
|
489
|
-
read: z.ZodNumber;
|
|
490
|
-
changed: z.ZodNumber;
|
|
491
|
-
skipped: z.ZodNumber;
|
|
492
|
-
}, z.core.$strict>;
|
|
493
352
|
}, z.core.$strict>], "kind">;
|
|
494
353
|
export type StatsOperation = z.infer<typeof StatsOperationSchema>;
|
|
495
354
|
//# sourceMappingURL=stats-operation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats-operation.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/stats-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"stats-operation.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/stats-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,0BAA0B;;;;kBAIrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAuB9E,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;kBAI5C,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;kBAI9C,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;kBAI3C,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;kBAKzC,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;kBAM7C,CAAC;AAEH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;kBAKhD,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;kBAM/C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;kBAI1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,eAAO,MAAM,qBAAqB;;;;kBAIhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,4BAA4B;;;;;kBAKvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAQ/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import { countSchema, epochMsSchema, gameIdSchema, leagueIdSchema, repairReasonSchema, sportKeySchema,
|
|
2
|
+
import { STATS_OPERATION_STATUS_KEYS, STATS_VALIDATION_PHASE_KEYS } from '../types/stats.js';
|
|
3
|
+
import { countSchema, epochMsSchema, gameIdSchema, leagueIdSchema, repairReasonSchema, sportKeySchema, userIdSchema, } from './atoms.js';
|
|
4
4
|
import { StatsValidationScopeSchema } from './system.js';
|
|
5
5
|
export const StatsOperationCountsSchema = z.strictObject({
|
|
6
6
|
read: countSchema,
|
|
@@ -81,43 +81,6 @@ export const StatsDestinationChangeSchema = z.strictObject({
|
|
|
81
81
|
before: z.record(z.string(), z.number()).nullable(),
|
|
82
82
|
after: z.record(z.string(), z.number()).nullable(),
|
|
83
83
|
});
|
|
84
|
-
export const GhostPlayerStatsOperationSchema = z
|
|
85
|
-
.strictObject({
|
|
86
|
-
...operationBase,
|
|
87
|
-
kind: z.literal('ghostPlayerStats'),
|
|
88
|
-
scope: z.discriminatedUnion('action', [
|
|
89
|
-
z.strictObject({
|
|
90
|
-
action: z.literal('link'),
|
|
91
|
-
teamId: teamIdSchema,
|
|
92
|
-
ghostUserId: userIdSchema,
|
|
93
|
-
userId: userIdSchema,
|
|
94
|
-
}),
|
|
95
|
-
z.strictObject({
|
|
96
|
-
action: z.literal('removal'),
|
|
97
|
-
teamId: teamIdSchema,
|
|
98
|
-
ghostUserId: userIdSchema,
|
|
99
|
-
}),
|
|
100
|
-
]),
|
|
101
|
-
// Present only on an operation stored with a reason. A removal's is dropped on read; a link's
|
|
102
|
-
// is kept, so its stored operation still resumes.
|
|
103
|
-
reason: repairReasonSchema.optional(),
|
|
104
|
-
removedFinishedGameEntries: z.array(GhostRemovedFinishedEntrySchema).optional(),
|
|
105
|
-
removedOpenGameIds: z.array(gameIdSchema).optional(),
|
|
106
|
-
linkedGames: z.array(GhostLinkedGameSchema).optional(),
|
|
107
|
-
destinationChanges: z.array(StatsDestinationChangeSchema).optional(),
|
|
108
|
-
membershipOutcome: z.enum(GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS).optional(),
|
|
109
|
-
})
|
|
110
|
-
.overwrite((operation) => {
|
|
111
|
-
if (operation.scope.action !== 'removal' || operation.reason === undefined)
|
|
112
|
-
return operation;
|
|
113
|
-
const { reason: _reason, ...withoutReason } = operation;
|
|
114
|
-
return withoutReason;
|
|
115
|
-
});
|
|
116
|
-
export const GameDeletionOperationSchema = z.strictObject({
|
|
117
|
-
...operationBase,
|
|
118
|
-
kind: z.literal('gameDeletion'),
|
|
119
|
-
scope: gameScope,
|
|
120
|
-
});
|
|
121
84
|
export const StatsOperationSchema = z.discriminatedUnion('kind', [
|
|
122
85
|
LeagueStatsRebuildOperationSchema,
|
|
123
86
|
LifetimeStatsRebuildOperationSchema,
|
|
@@ -126,7 +89,5 @@ export const StatsOperationSchema = z.discriminatedUnion('kind', [
|
|
|
126
89
|
GameStatsCorrectionOperationSchema,
|
|
127
90
|
GameStatsRecalculationOperationSchema,
|
|
128
91
|
HistoricalStatsUpdateOperationSchema,
|
|
129
|
-
GhostPlayerStatsOperationSchema,
|
|
130
|
-
GameDeletionOperationSchema,
|
|
131
92
|
]);
|
|
132
93
|
//# sourceMappingURL=stats-operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats-operation.js","sourceRoot":"","sources":["../../src/doc-schemas/stats-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,kCAAkC,EAClC,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,YAAY,CAAC;IACvD,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,WAAW;CACrB,CAAC,CAAC;AAGH,MAAM,aAAa,GAAG;IACpB,eAAe,EAAE,YAAY;IAC7B,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;IACxB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC;IAC3C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,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,KAAK,CAAC,+BAA+B,CAAC,CAAC,QAAQ,EAAE;IAC/E,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;IACpD,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,QAAQ,EAAE;IACtD,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,QAAQ,EAAE;IACpE,iBAAiB,EAAE,CAAC,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC,QAAQ,EAAE;CACzE,CAAC;KACD,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE;IACvB,IAAI,SAAS,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC7F,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,aAAa,EAAE,GAAG,SAAS,CAAC;IACxD,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC,CAAC;AAGL,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,YAAY,CAAC;IACxD,GAAG,aAAa;IAChB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,cAA2C,CAAC;IAC5D,KAAK,EAAE,SAAS;CACjB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC/D,iCAAiC;IACjC,mCAAmC;IACnC,gCAAgC;IAChC,8BAA8B;IAC9B,kCAAkC;IAClC,qCAAqC;IACrC,oCAAoC;IACpC,+BAA+B;IAC/B,2BAA2B;CAC5B,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS,\n STATS_OPERATION_STATUS_KEYS,\n STATS_VALIDATION_PHASE_KEYS,\n} from '../types/stats.js';\nimport type { GhostStatsOperationAction, StatsOperationKind } from '../types/stats.js';\nimport {\n countSchema,\n epochMsSchema,\n gameIdSchema,\n leagueIdSchema,\n repairReasonSchema,\n sportKeySchema,\n teamIdSchema,\n userIdSchema,\n} from './atoms.js';\nimport { StatsValidationScopeSchema } from './system.js';\n\nexport const StatsOperationCountsSchema = z.strictObject({\n read: countSchema,\n changed: countSchema,\n skipped: countSchema,\n});\nexport type StatsOperationCounts = z.infer<typeof StatsOperationCountsSchema>;\n\nconst operationBase = {\n startedByUserId: userIdSchema,\n startedAt: epochMsSchema,\n updatedAt: epochMsSchema,\n status: z.enum(STATS_OPERATION_STATUS_KEYS),\n resumeAfter: z.string().min(1).optional(),\n counts: StatsOperationCountsSchema,\n};\n\nconst rebuildFields = {\n ...operationBase,\n reason: repairReasonSchema,\n stoppedOnGameIds: z.array(gameIdSchema),\n};\n\nconst gameScope = z.strictObject({ gameId: gameIdSchema });\n\n// `hashStatsOperationRequest` of the values the operation was opened with. Optional: an operation\n// stored before it existed still resumes.\nconst requestHashSchema = z.string().regex(/^[0-9a-f]{64}$/);\n\nexport const LeagueStatsRebuildOperationSchema = z.strictObject({\n ...rebuildFields,\n kind: z.literal('leagueStatsRebuild' satisfies StatsOperationKind),\n scope: z.strictObject({ leagueId: leagueIdSchema.optional() }),\n});\n\nexport const LifetimeStatsRebuildOperationSchema = z.strictObject({\n ...rebuildFields,\n kind: z.literal('lifetimeStatsRebuild' satisfies StatsOperationKind),\n scope: z.strictObject({ userId: userIdSchema.optional() }),\n});\n\nexport const HallOfFameRebuildOperationSchema = z.strictObject({\n ...rebuildFields,\n kind: z.literal('hallOfFameRebuild' satisfies StatsOperationKind),\n scope: z.strictObject({ sportKey: sportKeySchema, userId: userIdSchema.optional() }),\n});\n\nexport const StatsValidationOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('statsValidation' satisfies StatsOperationKind),\n scope: StatsValidationScopeSchema,\n phase: z.enum(STATS_VALIDATION_PHASE_KEYS),\n});\n\nexport const GameStatsCorrectionOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('gameStatsCorrection' satisfies StatsOperationKind),\n scope: gameScope,\n reason: repairReasonSchema,\n requestHash: requestHashSchema.optional(),\n});\n\nexport const GameStatsRecalculationOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('gameStatsRecalculation' satisfies StatsOperationKind),\n scope: gameScope,\n reason: repairReasonSchema,\n});\n\nexport const HistoricalStatsUpdateOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('historicalStatsUpdate' satisfies StatsOperationKind),\n scope: z.strictObject({ userId: userIdSchema, sportKey: sportKeySchema }),\n reason: repairReasonSchema,\n requestHash: requestHashSchema.optional(),\n});\n\nexport const GhostRemovedFinishedEntrySchema = z.strictObject({\n gameId: gameIdSchema,\n wasAbsent: z.boolean(),\n wasNonScoring: z.boolean(),\n});\nexport type GhostRemovedFinishedEntry = z.infer<typeof GhostRemovedFinishedEntrySchema>;\n\nexport const GhostLinkedGameSchema = z.strictObject({\n gameId: gameIdSchema,\n completed: z.boolean(),\n merged: z.boolean(),\n});\nexport type GhostLinkedGame = z.infer<typeof GhostLinkedGameSchema>;\n\nexport const StatsDestinationChangeSchema = z.strictObject({\n ref: z.string().min(1),\n field: z.string().min(1),\n before: z.record(z.string(), z.number()).nullable(),\n after: z.record(z.string(), z.number()).nullable(),\n});\nexport type StatsDestinationChange = z.infer<typeof StatsDestinationChangeSchema>;\n\nexport const GhostPlayerStatsOperationSchema = z\n .strictObject({\n ...operationBase,\n kind: z.literal('ghostPlayerStats' satisfies StatsOperationKind),\n scope: z.discriminatedUnion('action', [\n z.strictObject({\n action: z.literal('link' satisfies GhostStatsOperationAction),\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n userId: userIdSchema,\n }),\n z.strictObject({\n action: z.literal('removal' satisfies GhostStatsOperationAction),\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n }),\n ]),\n // Present only on an operation stored with a reason. A removal's is dropped on read; a link's\n // is kept, so its stored operation still resumes.\n reason: repairReasonSchema.optional(),\n removedFinishedGameEntries: z.array(GhostRemovedFinishedEntrySchema).optional(),\n removedOpenGameIds: z.array(gameIdSchema).optional(),\n linkedGames: z.array(GhostLinkedGameSchema).optional(),\n destinationChanges: z.array(StatsDestinationChangeSchema).optional(),\n membershipOutcome: z.enum(GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS).optional(),\n })\n .overwrite((operation) => {\n if (operation.scope.action !== 'removal' || operation.reason === undefined) return operation;\n const { reason: _reason, ...withoutReason } = operation;\n return withoutReason;\n });\nexport type GhostPlayerStatsOperation = z.infer<typeof GhostPlayerStatsOperationSchema>;\n\nexport const GameDeletionOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('gameDeletion' satisfies StatsOperationKind),\n scope: gameScope,\n});\n\nexport const StatsOperationSchema = z.discriminatedUnion('kind', [\n LeagueStatsRebuildOperationSchema,\n LifetimeStatsRebuildOperationSchema,\n HallOfFameRebuildOperationSchema,\n StatsValidationOperationSchema,\n GameStatsCorrectionOperationSchema,\n GameStatsRecalculationOperationSchema,\n HistoricalStatsUpdateOperationSchema,\n GhostPlayerStatsOperationSchema,\n GameDeletionOperationSchema,\n]);\nexport type StatsOperation = z.infer<typeof StatsOperationSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"stats-operation.js","sourceRoot":"","sources":["../../src/doc-schemas/stats-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAE7F,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,YAAY,CAAC;IACvD,IAAI,EAAE,WAAW;IACjB,OAA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,EAAE,iBAAiB,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC5D,MAAM,EAAE,YAAY;IACpB,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE;CAC3B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,YAAY,CAAC;IAClD,MAAM,EAAE,YAAY;IACpB,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;CACpB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,YAAY,CAAC;IACzD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACnD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC/D,iCAAiC;IACjC,mCAAmC;IACnC,gCAAgC;IAChC,8BAA8B;IAC9B,kCAAkC;IAClC,qCAAqC;IACrC,oCAAoC;CACrC,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { STATS_OPERATION_STATUS_KEYS, STATS_VALIDATION_PHASE_KEYS } from '../types/stats.js';\nimport type { StatsOperationKind } from '../types/stats.js';\nimport {\n countSchema,\n epochMsSchema,\n gameIdSchema,\n leagueIdSchema,\n repairReasonSchema,\n sportKeySchema,\n userIdSchema,\n} from './atoms.js';\nimport { StatsValidationScopeSchema } from './system.js';\n\nexport const StatsOperationCountsSchema = z.strictObject({\n read: countSchema,\n changed: countSchema,\n skipped: countSchema,\n});\nexport type StatsOperationCounts = z.infer<typeof StatsOperationCountsSchema>;\n\nconst operationBase = {\n startedByUserId: userIdSchema,\n startedAt: epochMsSchema,\n updatedAt: epochMsSchema,\n status: z.enum(STATS_OPERATION_STATUS_KEYS),\n resumeAfter: z.string().min(1).optional(),\n counts: StatsOperationCountsSchema,\n};\n\nconst rebuildFields = {\n ...operationBase,\n reason: repairReasonSchema,\n stoppedOnGameIds: z.array(gameIdSchema),\n};\n\nconst gameScope = z.strictObject({ gameId: gameIdSchema });\n\n// `hashStatsOperationRequest` of the values the operation was opened with. Optional: an operation\n// stored before it existed still resumes.\nconst requestHashSchema = z.string().regex(/^[0-9a-f]{64}$/);\n\nexport const LeagueStatsRebuildOperationSchema = z.strictObject({\n ...rebuildFields,\n kind: z.literal('leagueStatsRebuild' satisfies StatsOperationKind),\n scope: z.strictObject({ leagueId: leagueIdSchema.optional() }),\n});\n\nexport const LifetimeStatsRebuildOperationSchema = z.strictObject({\n ...rebuildFields,\n kind: z.literal('lifetimeStatsRebuild' satisfies StatsOperationKind),\n scope: z.strictObject({ userId: userIdSchema.optional() }),\n});\n\nexport const HallOfFameRebuildOperationSchema = z.strictObject({\n ...rebuildFields,\n kind: z.literal('hallOfFameRebuild' satisfies StatsOperationKind),\n scope: z.strictObject({ sportKey: sportKeySchema, userId: userIdSchema.optional() }),\n});\n\nexport const StatsValidationOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('statsValidation' satisfies StatsOperationKind),\n scope: StatsValidationScopeSchema,\n phase: z.enum(STATS_VALIDATION_PHASE_KEYS),\n});\n\nexport const GameStatsCorrectionOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('gameStatsCorrection' satisfies StatsOperationKind),\n scope: gameScope,\n reason: repairReasonSchema,\n requestHash: requestHashSchema.optional(),\n});\n\nexport const GameStatsRecalculationOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('gameStatsRecalculation' satisfies StatsOperationKind),\n scope: gameScope,\n reason: repairReasonSchema,\n});\n\nexport const HistoricalStatsUpdateOperationSchema = z.strictObject({\n ...operationBase,\n kind: z.literal('historicalStatsUpdate' satisfies StatsOperationKind),\n scope: z.strictObject({ userId: userIdSchema, sportKey: sportKeySchema }),\n reason: repairReasonSchema,\n requestHash: requestHashSchema.optional(),\n});\n\nexport const GhostRemovedFinishedEntrySchema = z.strictObject({\n gameId: gameIdSchema,\n wasAbsent: z.boolean(),\n wasNonScoring: z.boolean(),\n});\nexport type GhostRemovedFinishedEntry = z.infer<typeof GhostRemovedFinishedEntrySchema>;\n\nexport const GhostLinkedGameSchema = z.strictObject({\n gameId: gameIdSchema,\n completed: z.boolean(),\n merged: z.boolean(),\n});\nexport type GhostLinkedGame = z.infer<typeof GhostLinkedGameSchema>;\n\nexport const StatsDestinationChangeSchema = z.strictObject({\n ref: z.string().min(1),\n field: z.string().min(1),\n before: z.record(z.string(), z.number()).nullable(),\n after: z.record(z.string(), z.number()).nullable(),\n});\nexport type StatsDestinationChange = z.infer<typeof StatsDestinationChangeSchema>;\n\nexport const StatsOperationSchema = z.discriminatedUnion('kind', [\n LeagueStatsRebuildOperationSchema,\n LifetimeStatsRebuildOperationSchema,\n HallOfFameRebuildOperationSchema,\n StatsValidationOperationSchema,\n GameStatsCorrectionOperationSchema,\n GameStatsRecalculationOperationSchema,\n HistoricalStatsUpdateOperationSchema,\n]);\nexport type StatsOperation = z.infer<typeof StatsOperationSchema>;\n"]}
|
|
@@ -53,7 +53,6 @@ export declare const StatsDiscrepancySchema: z.ZodObject<{
|
|
|
53
53
|
finalRecordMissing: "finalRecordMissing";
|
|
54
54
|
finalRecordMismatch: "finalRecordMismatch";
|
|
55
55
|
participationSnapshotMismatch: "participationSnapshotMismatch";
|
|
56
|
-
gameHeld: "gameHeld";
|
|
57
56
|
aggregateMismatch: "aggregateMismatch";
|
|
58
57
|
aggregateEntryStale: "aggregateEntryStale";
|
|
59
58
|
aggregateEntryMissing: "aggregateEntryMissing";
|
|
@@ -103,7 +102,6 @@ export declare const StatsValidationReportSchema: z.ZodObject<{
|
|
|
103
102
|
finalRecordMissing: "finalRecordMissing";
|
|
104
103
|
finalRecordMismatch: "finalRecordMismatch";
|
|
105
104
|
participationSnapshotMismatch: "participationSnapshotMismatch";
|
|
106
|
-
gameHeld: "gameHeld";
|
|
107
105
|
aggregateMismatch: "aggregateMismatch";
|
|
108
106
|
aggregateEntryStale: "aggregateEntryStale";
|
|
109
107
|
aggregateEntryMissing: "aggregateEntryMissing";
|
|
@@ -128,7 +126,6 @@ export declare const StatsValidationReportSchema: z.ZodObject<{
|
|
|
128
126
|
finalRecordMissing: "finalRecordMissing";
|
|
129
127
|
finalRecordMismatch: "finalRecordMismatch";
|
|
130
128
|
participationSnapshotMismatch: "participationSnapshotMismatch";
|
|
131
|
-
gameHeld: "gameHeld";
|
|
132
129
|
aggregateMismatch: "aggregateMismatch";
|
|
133
130
|
aggregateEntryStale: "aggregateEntryStale";
|
|
134
131
|
aggregateEntryMissing: "aggregateEntryMissing";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB,eAAO,MAAM,eAAe;;;;;;iBAO1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,uBAAuB;;;;;;;;;iBAKlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,iBA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C,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,4BAA4B;;;;;;kBAMvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAUtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -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,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,aAAa,EACb,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,YAAY,EACZ,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eA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iB,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,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,YAAY;IACpB,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,0BAA0B;IAClC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,SAAS,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC1C,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,qBAAqB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5C,QAAQ,EAAE,aAAa;IACvB,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,YAAY;IACpB,aAAa,EAAE,YAAY;IAC3B,eAAe,EAAE,YAAY;IAC7B,OAAO,EAAE,eAAe,CAAC,6BAA6B,CAAC;IACvD,MAAM,EAAE,0BAA0B;IAClC,SAAS,EAAE,aAAa;IACxB,WAAW,EAAE,aAAa,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,eAAe,CAAC,+BAA+B,CAAC;IACzD,MAAM,EAAE,2BAA2B;IACnC,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,YAAY;IACpB,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n TEAM_INVITATION_MESSAGE_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,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-profile.js","sourceRoot":"","sources":["../../src/doc-schemas/user-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,
|
|
1
|
+
{"version":3,"file":"user-profile.js","sourceRoot":"","sources":["../../src/doc-schemas/user-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtF,OAAO,EAAE,4BAA4B,EAAE,uBAAuB,EAAE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AE,CAAC,QAAQ,EAAE;IACrC,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AAGhG,MAAM,qBAAqB,GAAwC;IACjE,WAAW,EAAE,IAAI;IACjB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;CACd,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,IAAI,CAC7C,qBAAqB,CACgB,CAAC","sourcesContent":["import { z } from 'zod';\nimport { THEME_NAMES } from '@ttt-productions/theme-core';\nimport { EMAIL_MAX_LENGTH } from '../constants/business.js';\nimport { CONTACT_PHONE_INPUT, DISPLAY_NAME_INPUT } from '../constants/text-fields.js';\nimport { BasketballPlayerTotalsSchema, UserLifetimeStatsSchema } from './aggregate-stats.js';\nimport { epochMsSchema, userStatusSchema } from './atoms.js';\nimport { textFieldSchema } from '../schemas/text-field.js';\nimport { awardIdSchema } from './catalogs.js';\n\nexport const themeNameSchema = z.enum(THEME_NAMES);\n\nexport const GrantedAwardSchema = z.object({\n awardId: awardIdSchema,\n grantedAt: epochMsSchema,\n});\nexport type GrantedAward = z.infer<typeof GrantedAwardSchema>;\n\nexport const UserProfileSchema = z.object({\n displayName: textFieldSchema(DISPLAY_NAME_INPUT),\n displayName_lowercase: z.string(),\n userStatus: userStatusSchema,\n lifetimeStats: UserLifetimeStatsSchema.optional(),\n grantedAwards: z.array(GrantedAwardSchema).optional(),\n primaryAwardId: awardIdSchema.optional(),\n secondaryAwardId: awardIdSchema.optional(),\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n});\nexport type UserProfile = z.infer<typeof UserProfileSchema>;\n\nexport const UserPrivateDataSchema = z.object({\n email: z.string().max(EMAIL_MAX_LENGTH),\n registrationStartedAt: epochMsSchema.optional(),\n orphanDeletionClaimedAt: epochMsSchema.optional(),\n defaultContactPhone: textFieldSchema(CONTACT_PHONE_INPUT).optional(),\n theme: themeNameSchema.optional(),\n reducedMotion: z.boolean().optional(),\n updatedAt: epochMsSchema,\n});\nexport type UserPrivateData = z.infer<typeof UserPrivateDataSchema>;\n\nexport const HistoricalStatsSchema = BasketballPlayerTotalsSchema.omit({ fantasyPoints: true });\nexport type HistoricalStats = z.infer<typeof HistoricalStatsSchema>;\n\nconst HISTORICAL_STAT_ENTRY: Record<keyof HistoricalStats, true> = {\n gamesPlayed: true,\n points: true,\n rebounds: true,\n assists: true,\n};\n\nexport const HISTORICAL_STAT_KEYS = Object.keys(\n HISTORICAL_STAT_ENTRY,\n) as readonly (keyof HistoricalStats)[];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waiver-template.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/waiver-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"waiver-template.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/waiver-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,sBAAsB,aAA0B,CAAC;AAC9D,eAAO,MAAM,iCAAiC,aAA0B,CAAC;AAEzE,eAAO,MAAM,oBAAoB;;;;;;;;;iBAgB7B,CAAC;AACL,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAIlE,eAAO,MAAM,4BAA4B;;kBAEvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,2BAA2B;;;;;;iBAMtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import { countSchema, documentIdSegmentSchema, epochMsSchema,
|
|
4
|
-
|
|
5
|
-
const
|
|
2
|
+
import { WAIVER_TEMPLATE_TEXT_INPUT, WAIVER_TEMPLATE_TITLE_INPUT, } from '../constants/text-fields.js';
|
|
3
|
+
import { countSchema, documentIdSegmentSchema, epochMsSchema, userIdSchema } from './atoms.js';
|
|
4
|
+
import { textFieldSchema } from '../schemas/text-field.js';
|
|
5
|
+
const waiverTitleSchema = textFieldSchema(WAIVER_TEMPLATE_TITLE_INPUT);
|
|
6
|
+
const waiverTextSchema = textFieldSchema(WAIVER_TEMPLATE_TEXT_INPUT);
|
|
6
7
|
export const waiverTemplateIdSchema = documentIdSegmentSchema;
|
|
7
8
|
export const waiverTemplateVersionNumberSchema = z.number().int().min(1);
|
|
8
9
|
export const WaiverTemplateSchema = z
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waiver-template.js","sourceRoot":"","sources":["../../src/doc-schemas/waiver-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"waiver-template.js","sourceRoot":"","sources":["../../src/doc-schemas/waiver-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,iBAAiB,GAAG,eAAe,CAAC,2BAA2B,CAAC,CAAC;AACvE,MAAM,gBAAgB,GAAG,eAAe,CAAC,0BAA0B,CAAC,CAAC;AAErE,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dSegmentSchema, epochMsSchema, userIdSchema } from './atoms.js';\nimport { textFieldSchema } from '../schemas/text-field.js';\n\nconst waiverTitleSchema = textFieldSchema(WAIVER_TEMPLATE_TITLE_INPUT);\nconst waiverTextSchema = textFieldSchema(WAIVER_TEMPLATE_TEXT_INPUT);\n\nexport const waiverTemplateIdSchema = documentIdSegmentSchema;\nexport const waiverTemplateVersionNumberSchema = z.number().int().min(1);\n\nexport const WaiverTemplateSchema = z\n .object({\n title: waiverTitleSchema,\n waiverText: waiverTextSchema,\n version: waiverTemplateVersionNumberSchema,\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n retired: z.boolean(),\n retiredAt: epochMsSchema.optional(),\n // Its own field, so `updatedAt` keeps meaning the template itself changed; the league save\n // writes it so a delete's read of this document conflicts with that save.\n lastChosenAt: epochMsSchema.optional(),\n })\n .refine((template) => template.retired === (template.retiredAt !== undefined), {\n message: 'A template is retired exactly when it records when it was retired.',\n path: ['retired'],\n });\nexport type WaiverTemplate = z.infer<typeof WaiverTemplateSchema>;\n\n// `_serverData/waiverTemplateRegistry` — the write fence of the offered-template cap\n// (RULE-STD-BACKEND-116): only its changing matters.\nexport const WaiverTemplateRegistrySchema = z.strictObject({\n templateRevision: countSchema,\n});\nexport type WaiverTemplateRegistry = z.infer<typeof WaiverTemplateRegistrySchema>;\n\nexport const WaiverTemplateVersionSchema = z.object({\n version: waiverTemplateVersionNumberSchema,\n title: waiverTitleSchema,\n waiverText: waiverTextSchema,\n publishedByUserId: userIdSchema.optional(),\n publishedAt: epochMsSchema,\n});\nexport type WaiverTemplateVersion = z.infer<typeof WaiverTemplateVersionSchema>;\n"]}
|
package/dist/ids/index.d.ts
CHANGED
|
@@ -4,6 +4,5 @@ export * from './stat-event-ids.js';
|
|
|
4
4
|
export * from './waiver-template-ids.js';
|
|
5
5
|
export * from './picture-ids.js';
|
|
6
6
|
export * from './notification-ids.js';
|
|
7
|
-
export * from './stats-operation-ids.js';
|
|
8
7
|
export * from './award-grant-ids.js';
|
|
9
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/ids/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ids/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ids/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
package/dist/ids/index.js
CHANGED
|
@@ -4,6 +4,5 @@ export * from './stat-event-ids.js';
|
|
|
4
4
|
export * from './waiver-template-ids.js';
|
|
5
5
|
export * from './picture-ids.js';
|
|
6
6
|
export * from './notification-ids.js';
|
|
7
|
-
export * from './stats-operation-ids.js';
|
|
8
7
|
export * from './award-grant-ids.js';
|
|
9
8
|
//# sourceMappingURL=index.js.map
|
package/dist/ids/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ids/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ids/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC","sourcesContent":["export * from './compound-ids.js';\nexport * from './minted-ids.js';\nexport * from './stat-event-ids.js';\nexport * from './waiver-template-ids.js';\nexport * from './picture-ids.js';\nexport * from './notification-ids.js';\nexport * from './award-grant-ids.js';\n"]}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC","sourcesContent":["export * from './migration-console/action-ids.js';\nexport * from './migration-console/console-lock.js';\nexport * from './migration-console/consumed-source.js';\nexport * from './migration-console/manifest.js';\nexport * from './migration-console/run-state.js';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-config.d.ts","sourceRoot":"","sources":["../../src/schemas/app-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"app-config.d.ts","sourceRoot":"","sources":["../../src/schemas/app-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,0BAA0B;;;;;;kBAWnC,CAAC;AACL,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,2BAA2B;;;;;;;;kBAE7B,CAAC;AACZ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,iCAAiC;;;kBAQ1C,CAAC;AACL,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F,eAAO,MAAM,kCAAkC;;;;kBAMpC,CAAC;AACZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC"}
|