@ttt-productions/q-core 0.1.16 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/business.d.ts.map +1 -1
- package/dist/constants/business.js +25 -5
- package/dist/constants/business.js.map +1 -1
- package/dist/constants/sports.d.ts.map +1 -1
- package/dist/constants/sports.js +2 -2
- package/dist/constants/sports.js.map +1 -1
- package/dist/doc-schemas/admin-notifications.d.ts +1 -1
- package/dist/doc-schemas/admin-notifications.d.ts.map +1 -1
- package/dist/doc-schemas/admin-notifications.js +4 -1
- package/dist/doc-schemas/admin-notifications.js.map +1 -1
- package/dist/doc-schemas/aggregate-stats.d.ts.map +1 -1
- package/dist/doc-schemas/aggregate-stats.js +4 -1
- package/dist/doc-schemas/aggregate-stats.js.map +1 -1
- package/dist/doc-schemas/atoms.d.ts.map +1 -1
- package/dist/doc-schemas/atoms.js +2 -2
- package/dist/doc-schemas/atoms.js.map +1 -1
- package/dist/doc-schemas/audit-event.d.ts.map +1 -1
- package/dist/doc-schemas/audit-event.js +8 -4
- package/dist/doc-schemas/audit-event.js.map +1 -1
- package/dist/doc-schemas/award-group-grant.d.ts.map +1 -1
- package/dist/doc-schemas/award-group-grant.js +11 -3
- package/dist/doc-schemas/award-group-grant.js.map +1 -1
- package/dist/doc-schemas/catalogs.js +1 -1
- package/dist/doc-schemas/catalogs.js.map +1 -1
- package/dist/doc-schemas/gallery.js +1 -1
- package/dist/doc-schemas/gallery.js.map +1 -1
- package/dist/doc-schemas/game-stat-history.d.ts.map +1 -1
- package/dist/doc-schemas/game-stat-history.js.map +1 -1
- package/dist/doc-schemas/game-stats.d.ts.map +1 -1
- package/dist/doc-schemas/game-stats.js +10 -2
- package/dist/doc-schemas/game-stats.js.map +1 -1
- package/dist/doc-schemas/league-team.js +1 -1
- package/dist/doc-schemas/league-team.js.map +1 -1
- package/dist/doc-schemas/membership-roster-sync.d.ts.map +1 -1
- package/dist/doc-schemas/membership-roster-sync.js +2 -1
- package/dist/doc-schemas/membership-roster-sync.js.map +1 -1
- package/dist/doc-schemas/migration-console.js +1 -1
- package/dist/doc-schemas/migration-console.js.map +1 -1
- package/dist/doc-schemas/pending-media.d.ts.map +1 -1
- package/dist/doc-schemas/pending-media.js.map +1 -1
- package/dist/doc-schemas/picture-retirement.d.ts.map +1 -1
- package/dist/doc-schemas/picture-retirement.js +5 -1
- package/dist/doc-schemas/picture-retirement.js.map +1 -1
- package/dist/doc-schemas/registry.d.ts +1 -1
- package/dist/doc-schemas/registry.d.ts.map +1 -1
- package/dist/doc-schemas/registry.js +1 -1
- package/dist/doc-schemas/registry.js.map +1 -1
- package/dist/doc-schemas/sport-game.d.ts.map +1 -1
- package/dist/doc-schemas/sport-game.js.map +1 -1
- package/dist/doc-schemas/sport-league.d.ts.map +1 -1
- package/dist/doc-schemas/sport-league.js +10 -2
- package/dist/doc-schemas/sport-league.js.map +1 -1
- package/dist/doc-schemas/status-reconcile-queue.d.ts.map +1 -1
- package/dist/doc-schemas/status-reconcile-queue.js.map +1 -1
- package/dist/doc-schemas/sweep-state.d.ts.map +1 -1
- package/dist/doc-schemas/sweep-state.js +10 -2
- package/dist/doc-schemas/sweep-state.js.map +1 -1
- package/dist/doc-schemas/system.d.ts.map +1 -1
- package/dist/doc-schemas/system.js.map +1 -1
- package/dist/doc-schemas/user-profile.d.ts.map +1 -1
- package/dist/doc-schemas/user-profile.js +1 -1
- package/dist/doc-schemas/user-profile.js.map +1 -1
- package/dist/doc-schemas/waivers-and-hardware.d.ts.map +1 -1
- package/dist/doc-schemas/waivers-and-hardware.js +15 -3
- package/dist/doc-schemas/waivers-and-hardware.js.map +1 -1
- package/dist/domain-events/domain-events.d.ts.map +1 -1
- package/dist/domain-events/domain-events.js +88 -24
- package/dist/domain-events/domain-events.js.map +1 -1
- package/dist/ids/notification-ids.d.ts.map +1 -1
- package/dist/ids/notification-ids.js.map +1 -1
- package/dist/ids/picture-ids.d.ts.map +1 -1
- package/dist/ids/picture-ids.js.map +1 -1
- package/dist/ids/stat-event-ids.d.ts.map +1 -1
- package/dist/ids/stat-event-ids.js.map +1 -1
- package/dist/ids/waiver-template-ids.d.ts.map +1 -1
- package/dist/ids/waiver-template-ids.js.map +1 -1
- package/dist/index.d.ts +4 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -9
- package/dist/index.js.map +1 -1
- package/dist/input-formats/{index.d.ts → input-formats.d.ts} +1 -1
- package/dist/input-formats/input-formats.d.ts.map +1 -0
- package/dist/input-formats/{index.js → input-formats.js} +1 -1
- package/dist/input-formats/input-formats.js.map +1 -0
- package/dist/media/file-origins.d.ts.map +1 -1
- package/dist/media/file-origins.js +30 -6
- package/dist/media/file-origins.js.map +1 -1
- package/dist/migration-console/action-ids.d.ts.map +1 -1
- package/dist/migration-console/action-ids.js.map +1 -1
- package/dist/migration-console/manifest.d.ts.map +1 -1
- package/dist/migration-console/manifest.js +42 -7
- package/dist/migration-console/manifest.js.map +1 -1
- package/dist/migration-console/run-state.d.ts.map +1 -1
- package/dist/migration-console/run-state.js.map +1 -1
- package/dist/notifications/admin-notification-config.d.ts.map +1 -1
- package/dist/notifications/admin-notification-config.js +5 -3
- package/dist/notifications/admin-notification-config.js.map +1 -1
- package/dist/notifications/occurrences.d.ts.map +1 -1
- package/dist/notifications/occurrences.js.map +1 -1
- package/dist/paths/path-builders.d.ts.map +1 -1
- package/dist/paths/path-builders.js +60 -15
- package/dist/paths/path-builders.js.map +1 -1
- package/dist/paths/picture-owner-paths.d.ts.map +1 -1
- package/dist/paths/picture-owner-paths.js.map +1 -1
- package/dist/paths/storage-paths.d.ts.map +1 -1
- package/dist/paths/storage-paths.js.map +1 -1
- package/dist/schemas/admin-notifications.d.ts.map +1 -1
- package/dist/schemas/admin-notifications.js +8 -4
- package/dist/schemas/admin-notifications.js.map +1 -1
- package/dist/schemas/app-config.js +1 -1
- package/dist/schemas/app-config.js.map +1 -1
- package/dist/schemas/atoms.d.ts +0 -1
- package/dist/schemas/atoms.d.ts.map +1 -1
- package/dist/schemas/atoms.js +3 -5
- package/dist/schemas/atoms.js.map +1 -1
- package/dist/schemas/awards.d.ts.map +1 -1
- package/dist/schemas/awards.js +13 -5
- package/dist/schemas/awards.js.map +1 -1
- package/dist/schemas/dead-letters.d.ts.map +1 -1
- package/dist/schemas/dead-letters.js +6 -3
- package/dist/schemas/dead-letters.js.map +1 -1
- package/dist/schemas/game-locations.d.ts.map +1 -1
- package/dist/schemas/game-locations.js +1 -1
- package/dist/schemas/game-locations.js.map +1 -1
- package/dist/schemas/hardware-loan-contracts.d.ts.map +1 -1
- package/dist/schemas/hardware-loan-contracts.js +11 -4
- package/dist/schemas/hardware-loan-contracts.js.map +1 -1
- package/dist/schemas/leagues.d.ts +2 -2
- package/dist/schemas/leagues.d.ts.map +1 -1
- package/dist/schemas/leagues.js +12 -3
- package/dist/schemas/leagues.js.map +1 -1
- package/dist/schemas/migration-console.d.ts.map +1 -1
- package/dist/schemas/migration-console.js +3 -6
- package/dist/schemas/migration-console.js.map +1 -1
- package/dist/schemas/pictures.d.ts.map +1 -1
- package/dist/schemas/pictures.js +6 -2
- package/dist/schemas/pictures.js.map +1 -1
- package/dist/schemas/schedules.d.ts +8 -8
- package/dist/schemas/schedules.d.ts.map +1 -1
- package/dist/schemas/schedules.js +9 -3
- package/dist/schemas/schedules.js.map +1 -1
- package/dist/schemas/scoring.d.ts +12 -12
- package/dist/schemas/scoring.d.ts.map +1 -1
- package/dist/schemas/scoring.js +11 -4
- package/dist/schemas/scoring.js.map +1 -1
- package/dist/schemas/signed-waivers.d.ts.map +1 -1
- package/dist/schemas/signed-waivers.js +5 -3
- package/dist/schemas/signed-waivers.js.map +1 -1
- package/dist/schemas/stats.d.ts.map +1 -1
- package/dist/schemas/stats.js +27 -8
- package/dist/schemas/stats.js.map +1 -1
- package/dist/schemas/team-joining.d.ts.map +1 -1
- package/dist/schemas/team-joining.js +13 -5
- package/dist/schemas/team-joining.js.map +1 -1
- package/dist/schemas/teams.d.ts.map +1 -1
- package/dist/schemas/teams.js +19 -6
- package/dist/schemas/teams.js.map +1 -1
- package/dist/schemas/uploads.d.ts.map +1 -1
- package/dist/schemas/uploads.js +12 -5
- package/dist/schemas/uploads.js.map +1 -1
- package/dist/schemas/users.d.ts.map +1 -1
- package/dist/schemas/users.js +22 -8
- package/dist/schemas/users.js.map +1 -1
- package/dist/schemas/waiver-templates.js +1 -1
- package/dist/schemas/waiver-templates.js.map +1 -1
- package/dist/sports/basketball-scoring.d.ts.map +1 -1
- package/dist/sports/basketball-scoring.js +67 -16
- package/dist/sports/basketball-scoring.js.map +1 -1
- package/dist/sports/basketball.d.ts.map +1 -1
- package/dist/sports/basketball.js +34 -7
- package/dist/sports/basketball.js.map +1 -1
- package/dist/sports/column-catalog.d.ts.map +1 -1
- package/dist/sports/column-catalog.js +4 -1
- package/dist/sports/column-catalog.js.map +1 -1
- package/dist/sports/contribution.d.ts.map +1 -1
- package/dist/sports/contribution.js +10 -3
- package/dist/sports/contribution.js.map +1 -1
- package/dist/sports/curling-scoring.d.ts.map +1 -1
- package/dist/sports/curling-scoring.js +30 -8
- package/dist/sports/curling-scoring.js.map +1 -1
- package/dist/sports/curling.d.ts.map +1 -1
- package/dist/sports/curling.js +1 -1
- package/dist/sports/curling.js.map +1 -1
- package/dist/sports/finalized-record.d.ts.map +1 -1
- package/dist/sports/finalized-record.js.map +1 -1
- package/dist/sports/football-scoring.d.ts.map +1 -1
- package/dist/sports/football-scoring.js +28 -8
- package/dist/sports/football-scoring.js.map +1 -1
- package/dist/sports/football.d.ts.map +1 -1
- package/dist/sports/football.js +1 -1
- package/dist/sports/football.js.map +1 -1
- package/dist/sports/index.d.ts +2 -2
- package/dist/sports/index.d.ts.map +1 -1
- package/dist/sports/index.js +1 -1
- package/dist/sports/index.js.map +1 -1
- package/dist/sports/ledger-continuity.d.ts.map +1 -1
- package/dist/sports/ledger-continuity.js.map +1 -1
- package/dist/sports/rankings.d.ts.map +1 -1
- package/dist/sports/rankings.js +5 -1
- package/dist/sports/rankings.js.map +1 -1
- package/dist/sports/replay.d.ts.map +1 -1
- package/dist/sports/replay.js +4 -1
- package/dist/sports/replay.js.map +1 -1
- package/dist/sports/rollup-check.d.ts.map +1 -1
- package/dist/sports/rollup-check.js +15 -3
- package/dist/sports/rollup-check.js.map +1 -1
- package/dist/sports/score-mirror.d.ts.map +1 -1
- package/dist/sports/score-mirror.js.map +1 -1
- package/dist/sports/scoring-display.d.ts.map +1 -1
- package/dist/sports/scoring-display.js.map +1 -1
- package/dist/sports/scoring.d.ts.map +1 -1
- package/dist/sports/scoring.js.map +1 -1
- package/dist/sports/sport-adapter.d.ts.map +1 -1
- package/dist/sports/sport-adapter.js.map +1 -1
- package/dist/sports/store-driver.d.ts.map +1 -1
- package/dist/sports/store-driver.js +18 -7
- package/dist/sports/store-driver.js.map +1 -1
- package/dist/types/audit.d.ts.map +1 -1
- package/dist/types/audit.js +16 -3
- package/dist/types/audit.js.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/notifications.d.ts.map +1 -1
- package/dist/types/notifications.js +9 -13
- package/dist/types/notifications.js.map +1 -1
- package/dist/types/schedules.d.ts.map +1 -1
- package/dist/types/schedules.js.map +1 -1
- package/dist/types/sports.d.ts.map +1 -1
- package/dist/types/sports.js +9 -2
- package/dist/types/sports.js.map +1 -1
- package/dist/types/stats.d.ts.map +1 -1
- package/dist/types/stats.js +45 -9
- package/dist/types/stats.js.map +1 -1
- package/dist/types/unions.d.ts.map +1 -1
- package/dist/types/unions.js +32 -6
- package/dist/types/unions.js.map +1 -1
- package/dist/upload-variables/picture-upload-variables.d.ts.map +1 -1
- package/dist/upload-variables/picture-upload-variables.js +4 -2
- package/dist/upload-variables/picture-upload-variables.js.map +1 -1
- package/dist/upload-variables/sign-hardware-contract-variables.d.ts.map +1 -1
- package/dist/upload-variables/sign-hardware-contract-variables.js +4 -2
- package/dist/upload-variables/sign-hardware-contract-variables.js.map +1 -1
- package/dist/upload-variables/sign-waiver-variables.d.ts.map +1 -1
- package/dist/upload-variables/sign-waiver-variables.js +5 -3
- package/dist/upload-variables/sign-waiver-variables.js.map +1 -1
- package/dist/utils/app-config.d.ts.map +1 -1
- package/dist/utils/app-config.js +5 -1
- package/dist/utils/app-config.js.map +1 -1
- package/dist/utils/app-routes.d.ts.map +1 -1
- package/dist/utils/app-routes.js +6 -1
- package/dist/utils/app-routes.js.map +1 -1
- package/dist/utils/league-calendar.d.ts.map +1 -1
- package/dist/utils/league-calendar.js +4 -1
- package/dist/utils/league-calendar.js.map +1 -1
- package/dist/utils/league-join-warning.d.ts.map +1 -1
- package/dist/utils/league-join-warning.js +15 -5
- package/dist/utils/league-join-warning.js.map +1 -1
- package/dist/utils/schedules.d.ts.map +1 -1
- package/dist/utils/schedules.js +6 -2
- package/dist/utils/schedules.js.map +1 -1
- package/dist/utils/team-member-actions.d.ts.map +1 -1
- package/dist/utils/team-member-actions.js.map +1 -1
- package/package.json +5 -17
- package/dist/input-formats/index.d.ts.map +0 -1
- package/dist/input-formats/index.js.map +0 -1
- package/dist/migration-console/index.d.ts +0 -4
- package/dist/migration-console/index.d.ts.map +0 -1
- package/dist/migration-console/index.js +0 -5
- package/dist/migration-console/index.js.map +0 -1
- package/dist/types/documents.d.ts +0 -24
- package/dist/types/documents.d.ts.map +0 -1
- package/dist/types/documents.js +0 -5
- package/dist/types/documents.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"award-group-grant.js","sourceRoot":"","sources":["../../src/doc-schemas/award-group-grant.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,gGAAgG;AAChG,sGAAsG;AACtG,kFAAkF;AAClF,EAAE;AACF,sGAAsG;AACtG,wGAAwG;AACxG,wGAAwG;AACxG,oGAAoG;AACpG,6FAA6F;AAE7F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;A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CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;AACtF,CAAC;AAED,qGAAqG;AACrG,qGAAqG;AACrG,sGAAsG;AACtG,2CAA2C;AAC3C,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,YAAY,CAAC;IACxD,MAAM,EAAE,YAAY;IACpB,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE;IACvB,UAAU,EAAE,aAAa;IACzB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,SAAS,EAAE,aAAa,CAAC,QAAQ,EAAE;IACnC,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,QAAQ,EAAE;CAC/D,CAAC,CAAC","sourcesContent":["// `awardGroupGrants/{grantId}` — one decision on one award for one group (a team, or a whole league):\n// grant the award to the group's active members, or take back what the group's grants gave. The\n// people are reached a page at a time, after the decision opens in its own small transaction. Written\n// only by Cloud Functions; an admin reads a decision through the status callable.\n//\n// A grant records each person in `awardGroupGrantPeople` before it changes their profile, so a re-run\n// after any interruption finds every recorded person and finishes them, and its revoke reverses exactly\n// the people it gave the award to. Someone who already held the award is recorded as holding it before,\n// and a revoke leaves them holding it. `status` stays `pending` until every page is done; the retry\n// ledger lets a decision that keeps failing back off instead of holding the resume's window.\n\nimport { z } from 'zod';\nimport { buildAwardGroupGrantId, buildAwardGroupGrantTargetKey } from '../ids/award-grant-ids.js';\nimport {\n AWARD_GROUP_GRANT_ACTION_KEYS,\n AWARD_GROUP_GRANT_STATUS_KEYS,\n AWARD_GROUP_REVOKE_SKIP_KEYS,\n AWARD_GROUP_TYPE_KEYS,\n} from '../types/unions.js';\nimport {\n countSchema,\n documentIdSegmentSchema,\n epochMsSchema,\n revisionSchema,\n userIdSchema,\n} from './atoms.js';\nimport { awardIdSchema } from './catalogs.js';\n\nexport const awardGroupTypeSchema = z.enum(AWARD_GROUP_TYPE_KEYS);\nexport const awardGroupGrantActionSchema = z.enum(AWARD_GROUP_GRANT_ACTION_KEYS);\nexport const awardGroupGrantStatusSchema = z.enum(AWARD_GROUP_GRANT_STATUS_KEYS);\n\n// A decision's number among every decision on its award and group: the first is 1.\nexport const awardGroupGrantDecisionSchema = revisionSchema;\n\nexport const AwardGroupGrantSchema = z\n .strictObject({\n grantId: z.string().min(1),\n action: awardGroupGrantActionSchema,\n awardId: awardIdSchema,\n groupType: awardGroupTypeSchema,\n // The team id or the league id, as `groupType` says.\n groupId: documentIdSegmentSchema,\n targetKey: z.string().min(1),\n decision: awardGroupGrantDecisionSchema,\n // The admin who decided. Each person's audit event is recorded as their action.\n actorUid: userIdSchema,\n status: awardGroupGrantStatusSchema,\n createdAt: epochMsSchema,\n completedAt: epochMsSchema.optional(),\n attemptCount: countSchema,\n nextAttemptAt: epochMsSchema,\n lastError: z.string().optional(),\n })\n .superRefine((grant, ctx) => {\n // The key and the id are derived fields: a decision whose stored key or id disagrees with its\n // award, group, and number would sit outside that pair's decision sequence.\n const targetKey = buildAwardGroupGrantTargetKey(grant);\n if (grant.targetKey !== targetKey) {\n ctx.addIssue({\n code: 'custom',\n path: ['targetKey'],\n message: 'targetKey must be the award and group target key.',\n });\n }\n if (grant.grantId !== buildAwardGroupGrantId(targetKey, grant.decision)) {\n ctx.addIssue({\n code: 'custom',\n path: ['grantId'],\n message: 'grantId must be the target key and the decision.',\n });\n }\n });\nexport type AwardGroupGrant = z.infer<typeof AwardGroupGrantSchema>;\n\n/**\n * Whether a request opens a new decision on an award for a group, given the group's latest decision\n * (`null` when it has none): a grant opens unless the latest is a grant, and a take-back opens only\n * when it is. A request the latest decision already settles opens nothing. The server applies it in\n * the transaction that opens the decision; the admin surface offers only the request it opens.\n */\nexport function awardGroupGrantOpens(\n latest: Pick<AwardGroupGrant, 'action'> | null,\n action: AwardGroupGrant['action'],\n): boolean {\n return action === 'grant' ? latest?.action !== 'grant' : latest?.action === 'grant';\n}\n\n// `awardGroupGrants/{grantId}/awardGroupGrantPeople/{userId}` — one person a grant decision reached,\n// recorded before their profile changed. `heldBefore` says they already held the award, so the grant\n// gave them nothing. `revoked` turns true once a revoke has dealt with them; `revokeSkipped` says why\n// that revoke left them holding the award.\nexport const AwardGroupGrantPersonSchema = z.strictObject({\n userId: userIdSchema,\n heldBefore: z.boolean(),\n recordedAt: epochMsSchema,\n revoked: z.boolean(),\n revokedAt: epochMsSchema.optional(),\n revokeSkipped: z.enum(AWARD_GROUP_REVOKE_SKIP_KEYS).optional(),\n});\nexport type AwardGroupGrantPerson = z.infer<typeof AwardGroupGrantPersonSchema>;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The award catalog. Each award is its own document, keeping the id granted awards already
|
|
2
2
|
// reference. The venue catalog is ./game-location.ts.
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { AWARD_NAME_INPUT_FORMAT } from '../input-formats/
|
|
4
|
+
import { AWARD_NAME_INPUT_FORMAT } from '../input-formats/input-formats.js';
|
|
5
5
|
import { countSchema, documentIdSegmentSchema, epochMsSchema, textFieldSchema } from './atoms.js';
|
|
6
6
|
import { pictureIdSchema } from './gallery.js';
|
|
7
7
|
// An award's id, which every grant names and so never changes: an award created by its badge upload
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalogs.js","sourceRoot":"","sources":["../../src/doc-schemas/catalogs.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,sDAAsD;AAEtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"catalogs.js","sourceRoot":"","sources":["../../src/doc-schemas/catalogs.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,sDAAsD;AAEtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,oGAAoG;AACpG,kCAAkC;AAClC,MAAM,CAAC,MAAM,aAAa,GAAG,uBAAuB,CAAC;AAErD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC,uBAAuB,CAAC,CAAC;AAExE,mGAAmG;AACnG,qGAAqG;AACrG,sGAAsG;AACtG,EAAE;AACF,gGAAgG;AAChG,kGAAkG;AAClG,gFAAgF;AAChF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,YAAY,CAAC;IAClD,IAAI,EAAE,eAAe;IACrB,cAAc,EAAE,eAAe,CAAC,QAAQ,EAAE;IAC1C,WAAW,EAAE,WAAW;IACxB,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC","sourcesContent":["// The award catalog. Each award is its own document, keeping the id granted awards already\n// reference. The venue catalog is ./game-location.ts.\n\nimport { z } from 'zod';\nimport { AWARD_NAME_INPUT_FORMAT } from '../input-formats/input-formats.js';\nimport { countSchema, documentIdSegmentSchema, epochMsSchema, textFieldSchema } from './atoms.js';\nimport { pictureIdSchema } from './gallery.js';\n\n// An award's id, which every grant names and so never changes: an award created by its badge upload\n// takes that upload's staging id.\nexport const awardIdSchema = documentIdSegmentSchema;\n\n// An award's name, as the catalog stores it and the creating upload sends it.\nexport const awardNameSchema = textFieldSchema(AWARD_NAME_INPUT_FORMAT);\n\n// `awardDefinitions/{awardId}` — one award in the catalog. It is created by the publication of its\n// first badge, so an award created that way always has one; an award with no badge yet gets one from\n// the next badge upload for it. A badge is replaced only by a newer upload, never removed on its own.\n//\n// `holderCount` is how many accounts hold the award now. Every grant and revoke moves it in the\n// transaction that writes the grant, so a deletion — refused while anyone holds the award — and a\n// concurrent grant conflict on this document instead of racing past each other.\nexport const AwardDefinitionSchema = z.strictObject({\n name: awardNameSchema,\n badgePictureId: pictureIdSchema.optional(),\n holderCount: countSchema,\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n});\nexport type AwardDefinition = z.infer<typeof AwardDefinitionSchema>;\n"]}
|
|
@@ -32,7 +32,7 @@ export const GallerySummarySchema = z
|
|
|
32
32
|
featuredPictureId: pictureIdSchema.optional(),
|
|
33
33
|
updatedAt: epochMsSchema,
|
|
34
34
|
})
|
|
35
|
-
.refine((summary) =>
|
|
35
|
+
.refine((summary) => summary.count > 0 === (summary.featuredPictureId !== undefined), {
|
|
36
36
|
message: 'featuredPictureId is present exactly when the gallery holds a picture',
|
|
37
37
|
path: ['featuredPictureId'],
|
|
38
38
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../src/doc-schemas/gallery.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,EAAE;AACF,iGAAiG;AACjG,gGAAgG;AAChG,4FAA4F;AAC5F,gGAAgG;AAChG,+FAA+F;AAE/F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEzE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;AAEtE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;AAE/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,sBAAsB;IACjC,sFAAsF;IACtF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,gGAAgG;IAChG,g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,gGAAgG;IAChG,gEAAgE;IAChE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,iGAAiG;IACjG,uFAAuF;IACvF,WAAW,EAAE,WAAW,CAAC,QAAQ,EAAE;IACnC,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC;KAClC,MAAM,CAAC;IACN,+EAA+E;IAC/E,KAAK,EAAE,WAAW;IAClB,0EAA0E;IAC1E,iBAAiB,EAAE,eAAe,CAAC,QAAQ,EAAE;IAC7C,SAAS,EAAE,aAAa;CACzB,CAAC;KACD,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,KAAK,SAAS,CAAC,EAAE;IACpF,OAAO,EAAE,uEAAuE;IAChF,IAAI,EAAE,CAAC,mBAAmB,CAAC;CAC5B,CAAC,CAAC","sourcesContent":["// Picture galleries — the league's, each team's, and the landing page's.\n//\n// Each picture in a gallery is its own `galleryPictures/{pictureId}` document, publicly readable\n// and written only by the picture core. The owner document carries its gallery's summary as its\n// optional `pictures` field: a card or a header reads the featured picture off the owner it\n// already holds, and `count` tells a display how many pictures there are without a count query.\n// An absent `pictures` field is an empty gallery, so no copy action or create core writes one.\n\nimport { z } from 'zod';\nimport { GALLERY_OWNER_KIND_KEYS, PICTURE_OWNER_KIND_KEYS } from '../types/picture-owners.js';\nimport { countSchema, epochMsSchema, stagingIdSchema } from './atoms.js';\n\nexport const pictureOwnerKindSchema = z.enum(PICTURE_OWNER_KIND_KEYS);\nexport const galleryOwnerKindSchema = z.enum(GALLERY_OWNER_KIND_KEYS);\n\n// A picture id is its upload's staging id; every stored size lives under it.\nexport const pictureIdSchema = stagingIdSchema;\n\nexport const GalleryPictureSchema = z.object({\n ownerKind: galleryOwnerKindSchema,\n // The league or team id; the landing page's gallery uses `SPECIAL_DOCS.LANDING_PAGE`.\n ownerId: z.string().min(1),\n // A fractional sort key: a move rewrites only the moved picture's key, strictly between its new\n // neighbours, and a gallery's first page is read ordered by it.\n position: z.string().min(1),\n // Set only on a picture the migration carried from V1: its position in the V1 source list, which\n // places a later-finishing carried picture among its carried neighbours in V1's order.\n sourceIndex: countSchema.optional(),\n createdAt: epochMsSchema,\n});\nexport type GalleryPicture = z.infer<typeof GalleryPictureSchema>;\n\nexport const GallerySummarySchema = z\n .object({\n // Exact: every gallery change rewrites the summary inside its own transaction.\n count: countSchema,\n // Always one of the owner's pictures, so no reader needs a fallback rule.\n featuredPictureId: pictureIdSchema.optional(),\n updatedAt: epochMsSchema,\n })\n .refine((summary) => summary.count > 0 === (summary.featuredPictureId !== undefined), {\n message: 'featuredPictureId is present exactly when the gallery holds a picture',\n path: ['featuredPictureId'],\n });\nexport type GallerySummary = z.infer<typeof GallerySummarySchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"game-stat-history.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/game-stat-history.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"game-stat-history.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/game-stat-history.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBASzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC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AM,8BAA8B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC3D,MAAM,EAAE,gBAAgB;IACxB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACtC,UAAU,EAAE,gBAAgB;IAC5B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5C,mDAAmD;IACnD,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;IAClD,qBAAqB,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;IACxD,yBAAyB,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;CAC7D,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC,YAAY,CAAC;IAClE,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAC7B,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAC7B,mCAAmC,CACpC;CACF,CAAC,CAAC;AAGH,mGAAmG;AACnG,+BAA+B;AAC/B,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC/C,8BAA8B;IAC9B,qCAAqC;CACtC,CAAC,CAAC","sourcesContent":["// `sportGames/{gameId}/gameStatHistory/{pageId}` — a completed game's finalized record: every event\n// document of the game, exactly as stored and in `sequence` order, in pages of up to\n// STAT_HISTORY_PAGE_SIZE, the page ids from `buildStatHistoryPageId(index)`.\n//\n// The first page also carries what finalize applied: the sport, the teams, and the participation\n// snapshot, so the record alone reproduces a completed game's contribution without the game\n// document a hand edit can reach (SPORT-204). It exists exactly while the game is `completed`.\n\nimport { z } from 'zod';\nimport { STAT_HISTORY_PAGE_SIZE } from '../constants/sports.js';\nimport { gameRosterPlayerIdSchema, leagueTypeSchema, teamIdSchema } from './atoms.js';\nimport { GameStatEventSchema } from './game-stats.js';\n\nconst pageEventsSchema = z\n .array(GameStatEventSchema)\n .max(STAT_HISTORY_PAGE_SIZE)\n .refine(\n (events) =>\n events.every((event, index) => index === 0 || events[index - 1].sequence < event.sequence),\n 'A page holds its events in sequence order.',\n );\n\n// A game whose replay is its empty stats has a first page and no events.\nexport const GameStatHistoryFirstPageSchema = z.strictObject({\n events: pageEventsSchema,\n pageCount: z.number().int().positive(),\n leagueType: leagueTypeSchema,\n teamIds: z.array(teamIdSchema).min(1).max(2),\n // The participation snapshot, as roster-entry ids.\n rosterPlayerIds: z.array(gameRosterPlayerIdSchema),\n absentRosterPlayerIds: z.array(gameRosterPlayerIdSchema),\n nonScoringRosterPlayerIds: z.array(gameRosterPlayerIdSchema),\n});\nexport type GameStatHistoryFirstPage = z.infer<typeof GameStatHistoryFirstPageSchema>;\n\nexport const GameStatHistoryContinuationPageSchema = z.strictObject({\n events: pageEventsSchema.refine(\n (events) => events.length > 0,\n 'A continuation page holds events.',\n ),\n});\nexport type GameStatHistoryContinuationPage = z.infer<typeof GameStatHistoryContinuationPageSchema>;\n\n// Both page shapes are strict, so a first page missing part of its snapshot is refused rather than\n// read as a continuation page.\nexport const GameStatHistoryPageSchema = z.union([\n GameStatHistoryFirstPageSchema,\n GameStatHistoryContinuationPageSchema,\n]);\nexport type GameStatHistoryPage = z.infer<typeof GameStatHistoryPageSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"game-stats.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/game-stats.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EAEtB,MAAM,oBAAoB,CAAC;AA+B5B,eAAO,MAAM,yBAAyB;;;kBAA0D,CAAC;AACjG,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAqB7B,CAAC;AACJ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AAEtD,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,aAAa,EAAE;IAAE,IAAI,EAAE,uBAAuB,CAAA;CAAE,CAAC,CAAC;AAC5F,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,aAAa,EAAE;IAAE,IAAI,EAAE,oBAAoB,CAAA;CAAE,CAAC,CAAC;AACtF,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,aAAa,EAAE;IAAE,IAAI,EAAE,qBAAqB,CAAA;CAAE,CAAC,CAAC;AACxF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -174,7 +174,10 @@ export const StatCorrectionEventSchema = z
|
|
|
174
174
|
.refine((event) => event.eventId ===
|
|
175
175
|
buildStatCorrectionId(event.operationId, event.playerUserId === undefined
|
|
176
176
|
? event.teamId
|
|
177
|
-
: buildGameRosterPlayerId(event.teamId, event.rekeyedFromGhostUserId ?? event.playerUserId), event.stat), {
|
|
177
|
+
: buildGameRosterPlayerId(event.teamId, event.rekeyedFromGhostUserId ?? event.playerUserId), event.stat), {
|
|
178
|
+
message: 'A correction is stored at the id its operation, line, and field derive.',
|
|
179
|
+
path: ['eventId'],
|
|
180
|
+
});
|
|
178
181
|
// Recorder facts are all present or all absent, and a team is named exactly when the authority is a
|
|
179
182
|
// team role.
|
|
180
183
|
function recorderFactsAgree(event) {
|
|
@@ -190,7 +193,12 @@ function recorderFactsAgree(event) {
|
|
|
190
193
|
// snapshot and a recorder fact is refused (ARCH-103, SPORT-104).
|
|
191
194
|
function snapshotsOnlyOnCopiedEvents(event) {
|
|
192
195
|
const snapshot = event.displayNameSnapshot !== undefined || event.assistedByDisplayNameSnapshot !== undefined;
|
|
193
|
-
const recorded = [
|
|
196
|
+
const recorded = [
|
|
197
|
+
event.acceptedAt,
|
|
198
|
+
event.recordedByUserId,
|
|
199
|
+
event.recordedByAuthority,
|
|
200
|
+
event.recordedByTeamId,
|
|
201
|
+
].some((fact) => fact !== undefined);
|
|
194
202
|
return !(snapshot && recorded);
|
|
195
203
|
}
|
|
196
204
|
// Event types are disjoint across sports, so `type` alone discriminates the whole union.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"game-stats.js","sourceRoot":"","sources":["../../src/doc-schemas/game-stats.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,6CAA6C;AAC7C,EAAE;AACF,+FAA+F;AAC/F,mGAAmG;AACnG,kGAAkG;AAClG,6EAA6E;AAC7E,EAAE;AACF,oGAAoG;AACpG,kGAAkG;AAClG,oFAAoF;AAEpF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EACL,0CAA0C,EAC1C,+BAA+B,EAC/B,+BAA+B,EAC/B,2BAA2B,EAC3B,uCAAuC,EACvC,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,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AC1B,6BAA6B;IAC7B,mCAAmC;IACnC,gCAAgC;IAChC,4BAA4B;IAC5B,6BAA6B;IAC7B,4BAA4B;IAC5B,0BAA0B;IAC1B,wBAAwB;IACxB,2BAA2B;IAC3B,mBAAmB;IACnB,yBAAyB;CAC1B,CAAC;KACD,MAAM,CAAC,kBAAkB,EAAE,kFAAkF,CAAC;KAC9G,MAAM,CAAC,2BAA2B,EAAE,6EAA6E,CAAC,CAAC","sourcesContent":["// The game tier of the stats model: the stat event documents, and the rollup the game document\n// carries (SPORT-001, SPORT-101, SPORT-102).\n//\n// Each stat event is its own document, `sportGames/{gameId}/gameStatEvents/{eventId}`, and the\n// event documents are the source of truth: at every commit the game's `stats` equals their replay,\n// in `sequence` order, from the sport's empty stats. The store is append-only — an undo appends a\n// `STAT_VOID` and a correction a `STAT_CORRECTION`; no event is ever edited.\n//\n// An event names people by id; names resolve from `publicUsers` at read time (ARCH-103, SPORT-104).\n// `displayNameSnapshot` and `assistedByDisplayNameSnapshot` are carried only by copied events, as\n// the audit record of the name the stat was entered under — never read as identity.\n\nimport { z } from 'zod';\nimport { CURLING_ROUND_COUNT, MAX_CURLING_ROUND_POINTS } from '../constants/sports.js';\nimport { buildGameRosterPlayerId } from '../ids/compound-ids.js';\nimport { buildStatCorrectionId, buildStatVoidId } from '../ids/stat-event-ids.js';\nimport {\n BASKETBALL_ASSISTABLE_SHOT_EVENT_TYPE_KEYS,\n BASKETBALL_BULK_EDIT_EVENT_TYPE,\n BASKETBALL_ONE_POINT_EVENT_TYPE,\n BASKETBALL_PLAYER_STAT_KEYS,\n BASKETBALL_PLAYER_TALLY_EVENT_TYPE_KEYS,\n BASKETBALL_TEAM_STAT_KEYS,\n BASKETBALL_TIMEOUT_EVENT_TYPE,\n CURLING_ROUND_BLANK_EVENT_TYPE,\n CURLING_ROUND_SCORE_EVENT_TYPE,\n CURLING_TEAM_STAT_KEYS,\n FOOTBALL_BULK_EDIT_EVENT_TYPE,\n FOOTBALL_SCORE_EVENT_TYPE_KEYS,\n FOOTBALL_TEAM_STAT_KEYS,\n} from '../types/sports.js';\nimport type {\n BasketballStatEventType,\n CurlingStatEventType,\n FootballStatEventType,\n StatCounterKey,\n} from '../types/sports.js';\nimport {\n STAT_CORRECTION_EVENT_TYPE,\n STAT_CORRECTION_SOURCE_KEYS,\n STAT_EVENT_AUTHORITY_KEYS,\n STAT_VOID_EVENT_TYPE,\n} from '../types/stats.js';\nimport { CAPTAIN_TEAM_ROLES } from '../types/unions.js';\nimport {\n basketballBulkStatKeySchema,\n countSchema,\n epochMsSchema,\n gameRosterPlayerIdSchema,\n repairReasonSchema,\n statCounterKeySchema,\n statEventIdSchema,\n statsOperationIdSchema,\n teamIdSchema,\n userIdSchema,\n} from './atoms.js';\n\n// ---------------------------------------------------------------------------------------------\n// Lines — one per team of the game, one per roster entry holding a non-zero player line\n// ---------------------------------------------------------------------------------------------\n\n// A line's counters: one field per key of the sport's declared stat-key set (SPORT-007), so a key\n// added to the set is a field of every line built from it.\nfunction counterShape<K extends StatCounterKey>(keys: readonly K[]): Record<K, typeof countSchema> {\n return Object.fromEntries(keys.map((key) => [key, countSchema])) as Record<K, typeof countSchema>;\n}\n\nexport const BasketballTeamStatsSchema = z.strictObject(counterShape(BASKETBALL_TEAM_STAT_KEYS));\nexport type BasketballTeamStats = z.infer<typeof BasketballTeamStatsSchema>;\n\n// `fantasyPoints` is `basketballFantasyPoints` of the line's own counters, on every basketball\n// player line — this game line and the totals lines built from it — stored so every table and\n// aggregate reads it rather than deriving it. FP is linear in the counters, so a totals line's FP\n// equals the sum of its games' FP.\nexport const BasketballPlayerStatsSchema = z.strictObject({\n ...counterShape(BASKETBALL_PLAYER_STAT_KEYS),\n fantasyPoints: z.number().nonnegative(),\n});\nexport type BasketballPlayerStats = z.infer<typeof BasketballPlayerStatsSchema>;\n\n// `roundScores[n]` is end n + 1: `null` until the end is recorded, `0` on both teams for a blank end.\n// `score` is the sum of the recorded ends.\nexport const CurlingTeamStatsSchema = z.strictObject({\n ...counterShape(CURLING_TEAM_STAT_KEYS),\n roundScores: z\n .array(z.number().int().min(0).max(MAX_CURLING_ROUND_POINTS).nullable())\n .length(CURLING_ROUND_COUNT),\n});\nexport type CurlingTeamStats = z.infer<typeof CurlingTeamStatsSchema>;\n\nexport const FootballTeamStatsSchema = z.strictObject(counterShape(FOOTBALL_TEAM_STAT_KEYS));\nexport type FootballTeamStats = z.infer<typeof FootballTeamStatsSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// The payload — exactly two keys for every sport (SPORT-001)\n// ---------------------------------------------------------------------------------------------\n\n// The one declaration of the game `stats` payload. Each sport's is built through it from that\n// sport's game lines in `SPORT_LINE_SCHEMAS`, as `SPORT_GAME_STATS_SCHEMAS`. `playerStats` is keyed\n// by roster entry, never by person, so a person on both teams of a game holds a line on each side. A\n// sport with no player lines passes `z.never()`, so its map stays empty.\nexport function gameStatsSchema<TeamLine extends z.ZodType, PlayerLine extends z.ZodType>(\n teamLine: TeamLine,\n playerLine: PlayerLine,\n) {\n return z.strictObject({\n teamStats: z.record(teamIdSchema, teamLine),\n playerStats: z.record(gameRosterPlayerIdSchema, playerLine),\n });\n}\n\n// ---------------------------------------------------------------------------------------------\n// Events\n// ---------------------------------------------------------------------------------------------\n\n// Every event: its id, its place in the replay, and when it was entered. The recorder facts are\n// derived by the writing core, never taken from the payload (ARCH-106); a copied event has none.\nconst statEventBase = {\n eventId: statEventIdSchema,\n sequence: z.number().int().positive(),\n recordedAt: epochMsSchema,\n acceptedAt: epochMsSchema.optional(),\n recordedByUserId: userIdSchema.optional(),\n recordedByAuthority: z.enum(STAT_EVENT_AUTHORITY_KEYS).optional(),\n // Only for the two team roles: the team whose authority the event was recorded under.\n recordedByTeamId: teamIdSchema.optional(),\n};\n\n// A player-attributed event names the roster entry `{teamId}_{playerUserId}` whose line it changes.\nconst playerEventFields = {\n teamId: teamIdSchema,\n playerUserId: userIdSchema,\n displayNameSnapshot: z.string().optional(),\n};\n\n// Basketball\n\nexport const BasketballOnePointEventSchema = z.strictObject({\n ...statEventBase,\n ...playerEventFields,\n type: z.literal(BASKETBALL_ONE_POINT_EVENT_TYPE),\n});\n\n// An assisted shot names its assister on the same event, which credits both players.\nexport const BasketballAssistableShotEventSchema = z\n .strictObject({\n ...statEventBase,\n ...playerEventFields,\n type: z.enum(BASKETBALL_ASSISTABLE_SHOT_EVENT_TYPE_KEYS),\n assistedByUserId: userIdSchema.optional(),\n assistedByDisplayNameSnapshot: z.string().optional(),\n })\n .refine(\n (event) => event.assistedByDisplayNameSnapshot === undefined || event.assistedByUserId !== undefined,\n 'An assister snapshot needs the assister.',\n );\n\nexport const BasketballPlayerTallyEventSchema = z.strictObject({\n ...statEventBase,\n ...playerEventFields,\n type: z.enum(BASKETBALL_PLAYER_TALLY_EVENT_TYPE_KEYS),\n});\n\nexport const BasketballTimeoutEventSchema = z.strictObject({\n ...statEventBase,\n teamId: teamIdSchema,\n type: z.literal(BASKETBALL_TIMEOUT_EVENT_TYPE),\n});\n\n// A scorer's edit: `value` is the signed change to `stat`, entered against `previousValue`, the\n// value the form showed. A copied bulk edit has no `previousValue`; nothing validates one again.\nexport const BasketballBulkEditEventSchema = z.strictObject({\n ...statEventBase,\n ...playerEventFields,\n type: z.literal(BASKETBALL_BULK_EDIT_EVENT_TYPE),\n stat: basketballBulkStatKeySchema,\n value: z.number().int(),\n previousValue: countSchema.optional(),\n});\n\n// Curling — an event names the end it records; it names no player.\n\nconst curlingRoundNumberSchema = z.number().int().min(1).max(CURLING_ROUND_COUNT);\n\nexport const CurlingRoundScoreEventSchema = z.strictObject({\n ...statEventBase,\n type: z.literal(CURLING_ROUND_SCORE_EVENT_TYPE),\n teamId: teamIdSchema,\n roundNumber: curlingRoundNumberSchema,\n points: z.number().int().min(1).max(MAX_CURLING_ROUND_POINTS),\n});\n\nexport const CurlingBlankEndEventSchema = z.strictObject({\n ...statEventBase,\n type: z.literal(CURLING_ROUND_BLANK_EVENT_TYPE),\n roundNumber: curlingRoundNumberSchema,\n});\n\n// Football — team-attributed only.\n\nexport const FootballScoreEventSchema = z.strictObject({\n ...statEventBase,\n type: z.enum(FOOTBALL_SCORE_EVENT_TYPE_KEYS),\n teamId: teamIdSchema,\n});\n\nexport const FootballBulkEditEventSchema = z.strictObject({\n ...statEventBase,\n type: z.literal(FOOTBALL_BULK_EDIT_EVENT_TYPE),\n teamId: teamIdSchema,\n value: z.number().int(),\n previousValue: countSchema,\n});\n\n// The store-level events, members of every sport's union.\n\n// Undoes exactly the event it targets. Its id is derived from the target, so a target has at most\n// one void and a second undo of the same event is the same document.\nexport const StatVoidEventSchema = z\n .strictObject({\n ...statEventBase,\n type: z.literal(STAT_VOID_EVENT_TYPE),\n targetEventId: statEventIdSchema,\n })\n .refine((event) => event.eventId === buildStatVoidId(event.targetEventId), {\n message: 'A void is stored at the id its target derives.',\n path: ['eventId'],\n });\n\n// Adds `value` to one correctable field of one line — the player line `{teamId}_{playerUserId}`\n// when it names a player, the team line of `teamId` when it does not. It never cascades: a player\n// correction does not move the team's score.\nexport const StatCorrectionEventSchema = z\n .strictObject({\n ...statEventBase,\n type: z.literal(STAT_CORRECTION_EVENT_TYPE),\n teamId: teamIdSchema,\n playerUserId: userIdSchema.optional(),\n stat: statCounterKeySchema,\n value: z.number().int(),\n correctionSource: z.enum(STAT_CORRECTION_SOURCE_KEYS),\n operationId: statsOperationIdSchema,\n reason: repairReasonSchema,\n // The ghost a link re-keyed this correction's player line from. The id was derived from the\n // ghost's line when the correction was written, and a document id never changes.\n rekeyedFromGhostUserId: userIdSchema.optional(),\n })\n .refine(\n (event) =>\n event.eventId ===\n buildStatCorrectionId(\n event.operationId,\n event.playerUserId === undefined\n ? event.teamId\n : buildGameRosterPlayerId(event.teamId, event.rekeyedFromGhostUserId ?? event.playerUserId),\n event.stat,\n ),\n { message: 'A correction is stored at the id its operation, line, and field derive.', path: ['eventId'] },\n );\n\n// Recorder facts are all present or all absent, and a team is named exactly when the authority is a\n// team role.\nfunction recorderFactsAgree(event: {\n acceptedAt?: number;\n recordedByUserId?: string;\n recordedByAuthority?: (typeof STAT_EVENT_AUTHORITY_KEYS)[number];\n recordedByTeamId?: string;\n}): boolean {\n const facts = [event.acceptedAt, event.recordedByUserId, event.recordedByAuthority];\n const present = facts.filter((fact) => fact !== undefined).length;\n if (present !== 0 && present !== facts.length) return false;\n const teamAuthority = (CAPTAIN_TEAM_ROLES as readonly string[]).includes(event.recordedByAuthority ?? '');\n return teamAuthority === (event.recordedByTeamId !== undefined);\n}\n\n// A name snapshot is the audit record a copied event keeps of the name its stat was entered under.\n// Only the writing core stamps recorder facts, and it writes ids only, so an event carrying both a\n// snapshot and a recorder fact is refused (ARCH-103, SPORT-104).\nfunction snapshotsOnlyOnCopiedEvents(event: {\n acceptedAt?: number;\n recordedByUserId?: string;\n recordedByAuthority?: string;\n recordedByTeamId?: string;\n displayNameSnapshot?: string;\n assistedByDisplayNameSnapshot?: string;\n}): boolean {\n const snapshot = event.displayNameSnapshot !== undefined || event.assistedByDisplayNameSnapshot !== undefined;\n const recorded = [event.acceptedAt, event.recordedByUserId, event.recordedByAuthority, event.recordedByTeamId].some(\n (fact) => fact !== undefined,\n );\n return !(snapshot && recorded);\n}\n\n// Event types are disjoint across sports, so `type` alone discriminates the whole union.\nexport const GameStatEventSchema = z\n .discriminatedUnion('type', [\n BasketballOnePointEventSchema,\n BasketballAssistableShotEventSchema,\n BasketballPlayerTallyEventSchema,\n BasketballTimeoutEventSchema,\n BasketballBulkEditEventSchema,\n CurlingRoundScoreEventSchema,\n CurlingBlankEndEventSchema,\n FootballScoreEventSchema,\n FootballBulkEditEventSchema,\n StatVoidEventSchema,\n StatCorrectionEventSchema,\n ])\n .refine(recorderFactsAgree, 'Recorder facts are all present, or all absent, with a team only for a team role.')\n .refine(snapshotsOnlyOnCopiedEvents, 'A name snapshot belongs to a copied event, which carries no recorder facts.');\nexport type GameStatEvent = z.infer<typeof GameStatEventSchema>;\nexport type GameStatEventType = GameStatEvent['type'];\n\nexport type BasketballStatEvent = Extract<GameStatEvent, { type: BasketballStatEventType }>;\nexport type CurlingRoundScoreEvent = z.infer<typeof CurlingRoundScoreEventSchema>;\nexport type CurlingBlankEndEvent = z.infer<typeof CurlingBlankEndEventSchema>;\nexport type CurlingStatEvent = Extract<GameStatEvent, { type: CurlingStatEventType }>;\nexport type FootballStatEvent = Extract<GameStatEvent, { type: FootballStatEventType }>;\nexport type StatVoidEvent = z.infer<typeof StatVoidEventSchema>;\nexport type StatCorrectionEvent = z.infer<typeof StatCorrectionEventSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"game-stats.js","sourceRoot":"","sources":["../../src/doc-schemas/game-stats.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,6CAA6C;AAC7C,EAAE;AACF,+FAA+F;AAC/F,mGAAmG;AACnG,kGAAkG;AAClG,6EAA6E;AAC7E,EAAE;AACF,oGAAoG;AACpG,kGAAkG;AAClG,oFAAoF;AAEpF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EACL,0CAA0C,EAC1C,+BAA+B,EAC/B,+BAA+B,EAC/B,2BAA2B,EAC3B,uCAAuC,EACvC,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,EAC9B,8BAA8B,EAC9B,sBAAsB,EACtB,6BAA6B,EAC7B,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,2BAA2B,EAC3B,W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the stat event documents, and the rollup the game document\n// carries (SPORT-001, SPORT-101, SPORT-102).\n//\n// Each stat event is its own document, `sportGames/{gameId}/gameStatEvents/{eventId}`, and the\n// event documents are the source of truth: at every commit the game's `stats` equals their replay,\n// in `sequence` order, from the sport's empty stats. The store is append-only — an undo appends a\n// `STAT_VOID` and a correction a `STAT_CORRECTION`; no event is ever edited.\n//\n// An event names people by id; names resolve from `publicUsers` at read time (ARCH-103, SPORT-104).\n// `displayNameSnapshot` and `assistedByDisplayNameSnapshot` are carried only by copied events, as\n// the audit record of the name the stat was entered under — never read as identity.\n\nimport { z } from 'zod';\nimport { CURLING_ROUND_COUNT, MAX_CURLING_ROUND_POINTS } from '../constants/sports.js';\nimport { buildGameRosterPlayerId } from '../ids/compound-ids.js';\nimport { buildStatCorrectionId, buildStatVoidId } from '../ids/stat-event-ids.js';\nimport {\n BASKETBALL_ASSISTABLE_SHOT_EVENT_TYPE_KEYS,\n BASKETBALL_BULK_EDIT_EVENT_TYPE,\n BASKETBALL_ONE_POINT_EVENT_TYPE,\n BASKETBALL_PLAYER_STAT_KEYS,\n BASKETBALL_PLAYER_TALLY_EVENT_TYPE_KEYS,\n BASKETBALL_TEAM_STAT_KEYS,\n BASKETBALL_TIMEOUT_EVENT_TYPE,\n CURLING_ROUND_BLANK_EVENT_TYPE,\n CURLING_ROUND_SCORE_EVENT_TYPE,\n CURLING_TEAM_STAT_KEYS,\n FOOTBALL_BULK_EDIT_EVENT_TYPE,\n FOOTBALL_SCORE_EVENT_TYPE_KEYS,\n FOOTBALL_TEAM_STAT_KEYS,\n} from '../types/sports.js';\nimport type {\n BasketballStatEventType,\n CurlingStatEventType,\n FootballStatEventType,\n StatCounterKey,\n} from '../types/sports.js';\nimport {\n STAT_CORRECTION_EVENT_TYPE,\n STAT_CORRECTION_SOURCE_KEYS,\n STAT_EVENT_AUTHORITY_KEYS,\n STAT_VOID_EVENT_TYPE,\n} from '../types/stats.js';\nimport { CAPTAIN_TEAM_ROLES } from '../types/unions.js';\nimport {\n basketballBulkStatKeySchema,\n countSchema,\n epochMsSchema,\n gameRosterPlayerIdSchema,\n repairReasonSchema,\n statCounterKeySchema,\n statEventIdSchema,\n statsOperationIdSchema,\n teamIdSchema,\n userIdSchema,\n} from './atoms.js';\n\n// ---------------------------------------------------------------------------------------------\n// Lines — one per team of the game, one per roster entry holding a non-zero player line\n// ---------------------------------------------------------------------------------------------\n\n// A line's counters: one field per key of the sport's declared stat-key set (SPORT-007), so a key\n// added to the set is a field of every line built from it.\nfunction counterShape<K extends StatCounterKey>(keys: readonly K[]): Record<K, typeof countSchema> {\n return Object.fromEntries(keys.map((key) => [key, countSchema])) as Record<K, typeof countSchema>;\n}\n\nexport const BasketballTeamStatsSchema = z.strictObject(counterShape(BASKETBALL_TEAM_STAT_KEYS));\nexport type BasketballTeamStats = z.infer<typeof BasketballTeamStatsSchema>;\n\n// `fantasyPoints` is `basketballFantasyPoints` of the line's own counters, on every basketball\n// player line — this game line and the totals lines built from it — stored so every table and\n// aggregate reads it rather than deriving it. FP is linear in the counters, so a totals line's FP\n// equals the sum of its games' FP.\nexport const BasketballPlayerStatsSchema = z.strictObject({\n ...counterShape(BASKETBALL_PLAYER_STAT_KEYS),\n fantasyPoints: z.number().nonnegative(),\n});\nexport type BasketballPlayerStats = z.infer<typeof BasketballPlayerStatsSchema>;\n\n// `roundScores[n]` is end n + 1: `null` until the end is recorded, `0` on both teams for a blank end.\n// `score` is the sum of the recorded ends.\nexport const CurlingTeamStatsSchema = z.strictObject({\n ...counterShape(CURLING_TEAM_STAT_KEYS),\n roundScores: z\n .array(z.number().int().min(0).max(MAX_CURLING_ROUND_POINTS).nullable())\n .length(CURLING_ROUND_COUNT),\n});\nexport type CurlingTeamStats = z.infer<typeof CurlingTeamStatsSchema>;\n\nexport const FootballTeamStatsSchema = z.strictObject(counterShape(FOOTBALL_TEAM_STAT_KEYS));\nexport type FootballTeamStats = z.infer<typeof FootballTeamStatsSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// The payload — exactly two keys for every sport (SPORT-001)\n// ---------------------------------------------------------------------------------------------\n\n// The one declaration of the game `stats` payload. Each sport's is built through it from that\n// sport's game lines in `SPORT_LINE_SCHEMAS`, as `SPORT_GAME_STATS_SCHEMAS`. `playerStats` is keyed\n// by roster entry, never by person, so a person on both teams of a game holds a line on each side. A\n// sport with no player lines passes `z.never()`, so its map stays empty.\nexport function gameStatsSchema<TeamLine extends z.ZodType, PlayerLine extends z.ZodType>(\n teamLine: TeamLine,\n playerLine: PlayerLine,\n) {\n return z.strictObject({\n teamStats: z.record(teamIdSchema, teamLine),\n playerStats: z.record(gameRosterPlayerIdSchema, playerLine),\n });\n}\n\n// ---------------------------------------------------------------------------------------------\n// Events\n// ---------------------------------------------------------------------------------------------\n\n// Every event: its id, its place in the replay, and when it was entered. The recorder facts are\n// derived by the writing core, never taken from the payload (ARCH-106); a copied event has none.\nconst statEventBase = {\n eventId: statEventIdSchema,\n sequence: z.number().int().positive(),\n recordedAt: epochMsSchema,\n acceptedAt: epochMsSchema.optional(),\n recordedByUserId: userIdSchema.optional(),\n recordedByAuthority: z.enum(STAT_EVENT_AUTHORITY_KEYS).optional(),\n // Only for the two team roles: the team whose authority the event was recorded under.\n recordedByTeamId: teamIdSchema.optional(),\n};\n\n// A player-attributed event names the roster entry `{teamId}_{playerUserId}` whose line it changes.\nconst playerEventFields = {\n teamId: teamIdSchema,\n playerUserId: userIdSchema,\n displayNameSnapshot: z.string().optional(),\n};\n\n// Basketball\n\nexport const BasketballOnePointEventSchema = z.strictObject({\n ...statEventBase,\n ...playerEventFields,\n type: z.literal(BASKETBALL_ONE_POINT_EVENT_TYPE),\n});\n\n// An assisted shot names its assister on the same event, which credits both players.\nexport const BasketballAssistableShotEventSchema = z\n .strictObject({\n ...statEventBase,\n ...playerEventFields,\n type: z.enum(BASKETBALL_ASSISTABLE_SHOT_EVENT_TYPE_KEYS),\n assistedByUserId: userIdSchema.optional(),\n assistedByDisplayNameSnapshot: z.string().optional(),\n })\n .refine(\n (event) =>\n event.assistedByDisplayNameSnapshot === undefined || event.assistedByUserId !== undefined,\n 'An assister snapshot needs the assister.',\n );\n\nexport const BasketballPlayerTallyEventSchema = z.strictObject({\n ...statEventBase,\n ...playerEventFields,\n type: z.enum(BASKETBALL_PLAYER_TALLY_EVENT_TYPE_KEYS),\n});\n\nexport const BasketballTimeoutEventSchema = z.strictObject({\n ...statEventBase,\n teamId: teamIdSchema,\n type: z.literal(BASKETBALL_TIMEOUT_EVENT_TYPE),\n});\n\n// A scorer's edit: `value` is the signed change to `stat`, entered against `previousValue`, the\n// value the form showed. A copied bulk edit has no `previousValue`; nothing validates one again.\nexport const BasketballBulkEditEventSchema = z.strictObject({\n ...statEventBase,\n ...playerEventFields,\n type: z.literal(BASKETBALL_BULK_EDIT_EVENT_TYPE),\n stat: basketballBulkStatKeySchema,\n value: z.number().int(),\n previousValue: countSchema.optional(),\n});\n\n// Curling — an event names the end it records; it names no player.\n\nconst curlingRoundNumberSchema = z.number().int().min(1).max(CURLING_ROUND_COUNT);\n\nexport const CurlingRoundScoreEventSchema = z.strictObject({\n ...statEventBase,\n type: z.literal(CURLING_ROUND_SCORE_EVENT_TYPE),\n teamId: teamIdSchema,\n roundNumber: curlingRoundNumberSchema,\n points: z.number().int().min(1).max(MAX_CURLING_ROUND_POINTS),\n});\n\nexport const CurlingBlankEndEventSchema = z.strictObject({\n ...statEventBase,\n type: z.literal(CURLING_ROUND_BLANK_EVENT_TYPE),\n roundNumber: curlingRoundNumberSchema,\n});\n\n// Football — team-attributed only.\n\nexport const FootballScoreEventSchema = z.strictObject({\n ...statEventBase,\n type: z.enum(FOOTBALL_SCORE_EVENT_TYPE_KEYS),\n teamId: teamIdSchema,\n});\n\nexport const FootballBulkEditEventSchema = z.strictObject({\n ...statEventBase,\n type: z.literal(FOOTBALL_BULK_EDIT_EVENT_TYPE),\n teamId: teamIdSchema,\n value: z.number().int(),\n previousValue: countSchema,\n});\n\n// The store-level events, members of every sport's union.\n\n// Undoes exactly the event it targets. Its id is derived from the target, so a target has at most\n// one void and a second undo of the same event is the same document.\nexport const StatVoidEventSchema = z\n .strictObject({\n ...statEventBase,\n type: z.literal(STAT_VOID_EVENT_TYPE),\n targetEventId: statEventIdSchema,\n })\n .refine((event) => event.eventId === buildStatVoidId(event.targetEventId), {\n message: 'A void is stored at the id its target derives.',\n path: ['eventId'],\n });\n\n// Adds `value` to one correctable field of one line — the player line `{teamId}_{playerUserId}`\n// when it names a player, the team line of `teamId` when it does not. It never cascades: a player\n// correction does not move the team's score.\nexport const StatCorrectionEventSchema = z\n .strictObject({\n ...statEventBase,\n type: z.literal(STAT_CORRECTION_EVENT_TYPE),\n teamId: teamIdSchema,\n playerUserId: userIdSchema.optional(),\n stat: statCounterKeySchema,\n value: z.number().int(),\n correctionSource: z.enum(STAT_CORRECTION_SOURCE_KEYS),\n operationId: statsOperationIdSchema,\n reason: repairReasonSchema,\n // The ghost a link re-keyed this correction's player line from. The id was derived from the\n // ghost's line when the correction was written, and a document id never changes.\n rekeyedFromGhostUserId: userIdSchema.optional(),\n })\n .refine(\n (event) =>\n event.eventId ===\n buildStatCorrectionId(\n event.operationId,\n event.playerUserId === undefined\n ? event.teamId\n : buildGameRosterPlayerId(\n event.teamId,\n event.rekeyedFromGhostUserId ?? event.playerUserId,\n ),\n event.stat,\n ),\n {\n message: 'A correction is stored at the id its operation, line, and field derive.',\n path: ['eventId'],\n },\n );\n\n// Recorder facts are all present or all absent, and a team is named exactly when the authority is a\n// team role.\nfunction recorderFactsAgree(event: {\n acceptedAt?: number;\n recordedByUserId?: string;\n recordedByAuthority?: (typeof STAT_EVENT_AUTHORITY_KEYS)[number];\n recordedByTeamId?: string;\n}): boolean {\n const facts = [event.acceptedAt, event.recordedByUserId, event.recordedByAuthority];\n const present = facts.filter((fact) => fact !== undefined).length;\n if (present !== 0 && present !== facts.length) return false;\n const teamAuthority = (CAPTAIN_TEAM_ROLES as readonly string[]).includes(\n event.recordedByAuthority ?? '',\n );\n return teamAuthority === (event.recordedByTeamId !== undefined);\n}\n\n// A name snapshot is the audit record a copied event keeps of the name its stat was entered under.\n// Only the writing core stamps recorder facts, and it writes ids only, so an event carrying both a\n// snapshot and a recorder fact is refused (ARCH-103, SPORT-104).\nfunction snapshotsOnlyOnCopiedEvents(event: {\n acceptedAt?: number;\n recordedByUserId?: string;\n recordedByAuthority?: string;\n recordedByTeamId?: string;\n displayNameSnapshot?: string;\n assistedByDisplayNameSnapshot?: string;\n}): boolean {\n const snapshot =\n event.displayNameSnapshot !== undefined || event.assistedByDisplayNameSnapshot !== undefined;\n const recorded = [\n event.acceptedAt,\n event.recordedByUserId,\n event.recordedByAuthority,\n event.recordedByTeamId,\n ].some((fact) => fact !== undefined);\n return !(snapshot && recorded);\n}\n\n// Event types are disjoint across sports, so `type` alone discriminates the whole union.\nexport const GameStatEventSchema = z\n .discriminatedUnion('type', [\n BasketballOnePointEventSchema,\n BasketballAssistableShotEventSchema,\n BasketballPlayerTallyEventSchema,\n BasketballTimeoutEventSchema,\n BasketballBulkEditEventSchema,\n CurlingRoundScoreEventSchema,\n CurlingBlankEndEventSchema,\n FootballScoreEventSchema,\n FootballBulkEditEventSchema,\n StatVoidEventSchema,\n StatCorrectionEventSchema,\n ])\n .refine(\n recorderFactsAgree,\n 'Recorder facts are all present, or all absent, with a team only for a team role.',\n )\n .refine(\n snapshotsOnlyOnCopiedEvents,\n 'A name snapshot belongs to a copied event, which carries no recorder facts.',\n );\nexport type GameStatEvent = z.infer<typeof GameStatEventSchema>;\nexport type GameStatEventType = GameStatEvent['type'];\n\nexport type BasketballStatEvent = Extract<GameStatEvent, { type: BasketballStatEventType }>;\nexport type CurlingRoundScoreEvent = z.infer<typeof CurlingRoundScoreEventSchema>;\nexport type CurlingBlankEndEvent = z.infer<typeof CurlingBlankEndEventSchema>;\nexport type CurlingStatEvent = Extract<GameStatEvent, { type: CurlingStatEventType }>;\nexport type FootballStatEvent = Extract<GameStatEvent, { type: FootballStatEventType }>;\nexport type StatVoidEvent = z.infer<typeof StatVoidEventSchema>;\nexport type StatCorrectionEvent = z.infer<typeof StatCorrectionEventSchema>;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// `leagueTeams/{teamId}` — one team in one league, with its derived season rollups. Who is on the
|
|
2
2
|
// team, and who captains it, is `teamMemberships` — never a field here.
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { CONTACT_PHONE_INPUT_FORMAT } from '../input-formats/
|
|
4
|
+
import { CONTACT_PHONE_INPUT_FORMAT } from '../input-formats/input-formats.js';
|
|
5
5
|
import { countSchema, epochMsSchema, leagueIdSchema, teamIconSchema, teamTypeSchema, textFieldSchema, userIdSchema, } from './atoms.js';
|
|
6
6
|
import { PlayerSeasonStatsSchema, TeamSeasonStatsSchema } from './aggregate-stats.js';
|
|
7
7
|
import { GallerySummarySchema } from './gallery.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"league-team.js","sourceRoot":"","sources":["../../src/doc-schemas/league-team.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,wEAAwE;AAExE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"league-team.js","sourceRoot":"","sources":["../../src/doc-schemas/league-team.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,wEAAwE;AAExE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,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,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,cAAc;IACxB,qDAAqD;IACrD,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE;IACnC,+FAA+F;IAC/F,kEAAkE;IAClE,eAAe,EAAE,YAAY;IAC7B,uEAAuE;IACvE,WAAW,EAAE,qBAAqB,CAAC,QAAQ,EAAE;IAC7C,kGAAkG;IAClG,0FAA0F;IAC1F,iBAAiB,EAAE,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAC,QAAQ,EAAE;IAC7E,gGAAgG;IAChG,uDAAuD;IACvD,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IACzC,8FAA8F;IAC9F,mGAAmG;IACnG,iGAAiG;IACjG,qFAAqF;IACrF,kBAAkB,EAAE,WAAW,CAAC,QAAQ,EAAE;IAC1C,8FAA8F;IAC9F,6FAA6F;IAC7F,gGAAgG;IAChG,yFAAyF;IACzF,kGAAkG;IAClG,8BAA8B;IAC9B,YAAY,EAAE,WAAW,CAAC,QAAQ,EAAE;IACpC,gGAAgG;IAChG,mGAAmG;IACnG,kGAAkG;IAClG,qGAAqG;IACrG,sDAAsD;IACtD,gBAAgB,EAAE,WAAW,CAAC,QAAQ,EAAE;IACxC,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC;AAGH,6FAA6F;AAC7F,qGAAqG;AACrG,0EAA0E;AAC1E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,QAAQ,EAAE,cAAc;IACxB,6FAA6F;IAC7F,YAAY,EAAE,eAAe,CAAC,0BAA0B,CAAC;IACzD,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC","sourcesContent":["// `leagueTeams/{teamId}` — one team in one league, with its derived season rollups. Who is on the\n// team, and who captains it, is `teamMemberships` — never a field here.\n\nimport { z } from 'zod';\nimport { CONTACT_PHONE_INPUT_FORMAT } from '../input-formats/input-formats.js';\nimport {\n countSchema,\n epochMsSchema,\n leagueIdSchema,\n teamIconSchema,\n teamTypeSchema,\n textFieldSchema,\n userIdSchema,\n} from './atoms.js';\nimport { PlayerSeasonStatsSchema, TeamSeasonStatsSchema } from './aggregate-stats.js';\nimport { GallerySummarySchema } from './gallery.js';\n\nexport const LeagueTeamSchema = z.object({\n name: z.string(),\n icon: teamIconSchema,\n leagueId: leagueIdSchema,\n // Present only in a Competitive/Recreational league.\n teamType: teamTypeSchema.optional(),\n // The account that created the team — the new captain, or the admin who created it for a ghost\n // captain. A creation record, never a membership or an authority.\n createdByUserId: userIdSchema,\n // The team's standings line, absent until its first game is finalized.\n seasonStats: TeamSeasonStatsSchema.optional(),\n // The league player stats: one row per person the team's games credited, keyed by userId (real or\n // ghost). The team's league, the team, and the key are the membership the row belongs to.\n playerSeasonStats: z.record(userIdSchema, PlayerSeasonStatsSchema).optional(),\n // The team's picture gallery summary — absent is an empty gallery. Only the picture core writes\n // it; the team callables and the copy action never do.\n pictures: GallerySummarySchema.optional(),\n // Advanced by every membership change on the team after its creation; absent until the first.\n // Only its changing matters: game creation and a game's team replacement read this document in the\n // transaction that seeds a roster from the team's memberships, so a membership change landing at\n // the same moment conflicts with them instead of missing the new game (BACKEND-116).\n membershipRevision: countSchema.optional(),\n // Advanced by every invitation and join request a door creates for the team; absent until the\n // first. Only its changing matters: a pending invitation or request between one team and one\n // person is unique, and a membership on the team closes both, but a transaction does not lock a\n // query against an insert — so each creation writes this document, which every competing\n // creation and every membership door also writes, and two racers conflict instead of both passing\n // their checks (BACKEND-116).\n joinRevision: countSchema.optional(),\n // Advanced by every game creation and every game edit that brings the team in; absent until the\n // first. Only its changing matters: a team's deletion re-reads the team's games in the transaction\n // that deletes the team document, and a query does not lock against an insert — so a game created\n // for the team writes this document, which the deletion also writes, and the two conflict instead of\n // leaving a game naming a deleted team (BACKEND-116).\n scheduleRevision: countSchema.optional(),\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n});\nexport type LeagueTeam = z.infer<typeof LeagueTeamSchema>;\n\n// `leagueTeamContacts/{teamId}` — how the league reaches the team. Admin read only: the team\n// document is public, so the phone lives here, never on it (BACKEND-105). `leagueId` is what lists a\n// league's contacts in one query. Written with the team by team creation.\nexport const LeagueTeamContactSchema = z.object({\n leagueId: leagueIdSchema,\n // The number as the contact callables kept it, held to the same declaration they parse with.\n contactPhone: textFieldSchema(CONTACT_PHONE_INPUT_FORMAT),\n updatedAt: epochMsSchema,\n});\nexport type LeagueTeamContact = z.infer<typeof LeagueTeamContactSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"membership-roster-sync.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/membership-roster-sync.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,gCAAgC;;;kBAG3C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"membership-roster-sync.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/membership-roster-sync.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,gCAAgC;;;kBAG3C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;iBAyCpC,CAAC;AACJ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -42,7 +42,8 @@ export const MembershipRosterSyncSchema = z
|
|
|
42
42
|
message: 'A roster obligation cannot be reconciled past its own revision.',
|
|
43
43
|
path: ['reconciledRosterRevision'],
|
|
44
44
|
})
|
|
45
|
-
.refine((sync) => (sync.syncStatus === RECONCILED_ROSTER_SYNC_STATUS) ===
|
|
45
|
+
.refine((sync) => (sync.syncStatus === RECONCILED_ROSTER_SYNC_STATUS) ===
|
|
46
|
+
(sync.reconciledRosterRevision === sync.rosterRevision), {
|
|
46
47
|
message: 'An obligation is reconciled exactly when its reconciled revision is its revision.',
|
|
47
48
|
path: ['syncStatus'],
|
|
48
49
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"membership-roster-sync.js","sourceRoot":"","sources":["../../src/doc-schemas/membership-roster-sync.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,2EAA2E;AAC3E,EAAE;AACF,kGAAkG;AAClG,kGAAkG;AAClG,oGAAoG;AACpG,mGAAmG;AACnG,gGAAgG;AAEhG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sCAAsC,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,gCAAgC,EAChC,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,YAAY,CAAC;AAEpB,mGAAmG;AACnG,0FAA0F;AAC1F,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,YAAY,CAAC;IAC7D,cAAc,EAAE,cAAc;IAC9B,WAAW,EAAE,YAAY;CAC1B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC;KACxC,MAAM,CAAC;IACN,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,YAAY;IACpB,yEAAyE;IACzE,cAAc,EAAE,cAAc;IAC9B,yEAAyE;IACzE,wBAAwB,EAAE,qBAAqB;IAC/C,UAAU,EAAE,gCAAgC;IAC5C,sEAAsE;IACtE,YAAY,EAAE,WAAW;IACzB,6DAA6D;IAC7D,aAAa,EAAE,aAAa;IAC5B,MAAM,EAAE,gCAAgC,CAAC,QAAQ,EAAE;IACnD,4EAA4E;IAC5E,QAAQ,EAAE,aAAa,CAAC,QAAQ,EAAE;IAClC,iGAAiG;IACjG,8BAA8B;IAC9B,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC,QAAQ,EAAE;IACrF,SAAS,EAAE,aAAa;CACzB,CAAC;KACD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,wBAAwB,IAAI,IAAI,CAAC,cAAc,EAAE;IACtE,OAAO,EAAE,iEAAiE;IAC1E,IAAI,EAAE,CAAC,0BAA0B,CAAC;CACnC,CAAC;KACD,MAAM,CACL,CAAC,IAAI,EAAE,EAAE,CACP,CAAC,IAAI,CAAC,UAAU,KAAK,6BAA6B,CAAC,
|
|
1
|
+
{"version":3,"file":"membership-roster-sync.js","sourceRoot":"","sources":["../../src/doc-schemas/membership-roster-sync.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,2EAA2E;AAC3E,EAAE;AACF,kGAAkG;AAClG,kGAAkG;AAClG,oGAAoG;AACpG,mGAAmG;AACnG,gGAAgG;AAEhG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sCAAsC,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,gCAAgC,EAChC,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,YAAY,CAAC;AAEp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AK,yBAAyB,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,EAC3F;IACE,OAAO,EAAE,8DAA8D;IACvE,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CACF,CAAC","sourcesContent":["// `membershipRosterSyncs/{teamMembershipId}` — one team membership's durable obligation to bring\n// its team's open game rosters in line with it (QUALITY-104, BACKEND-302).\n//\n// Every change to a membership — made, removed, or linked — advances `rosterRevision` in the same\n// transaction as the change, so a committed membership can never lose its roster work. The roster\n// core raises `reconciledRosterRevision` to the revision it finished; the obligation is outstanding\n// while it is lower. The document outlives a deleted membership, so a removal is still reconciled,\n// and it is keyed by the membership id, so no second id format exists (ARCH-109). Backend-only.\n\nimport { z } from 'zod';\nimport { MAX_ROSTER_SYNC_FAILURE_MESSAGE_LENGTH } from '../constants/business.js';\nimport { FAILED_ROSTER_SYNC_STATUS, RECONCILED_ROSTER_SYNC_STATUS } from '../types/unions.js';\nimport {\n appliedRevisionSchema,\n countSchema,\n epochMsSchema,\n gameIdSchema,\n leagueIdSchema,\n membershipRosterSyncStatusSchema,\n revisionSchema,\n teamIdSchema,\n userIdSchema,\n} from './atoms.js';\n\n// Where a run that stopped part-way resumes: the last game it finished for this revision. A cursor\n// for an older revision is ignored, because a newer change re-reconciles every open game.\nexport const MembershipRosterSyncCursorSchema = z.strictObject({\n rosterRevision: revisionSchema,\n afterGameId: gameIdSchema,\n});\nexport type MembershipRosterSyncCursor = z.infer<typeof MembershipRosterSyncCursorSchema>;\n\nexport const MembershipRosterSyncSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n // Advanced by every change to the membership; the first change writes 1.\n rosterRevision: revisionSchema,\n // The revision the roster core last finished; 0 before the first finish.\n reconciledRosterRevision: appliedRevisionSchema,\n syncStatus: membershipRosterSyncStatusSchema,\n // Runs of the worker at the current revision that ended in a failure.\n attemptCount: countSchema,\n // The earliest moment the worker takes the obligation again.\n nextAttemptAt: epochMsSchema,\n cursor: MembershipRosterSyncCursorSchema.optional(),\n // When its retries ran out: present exactly while the obligation is failed.\n failedAt: epochMsSchema.optional(),\n // The last failed run's message, kept while it retries and while it is failed; a finished run or\n // an admin's retry clears it.\n lastFailureMessage: z.string().max(MAX_ROSTER_SYNC_FAILURE_MESSAGE_LENGTH).optional(),\n updatedAt: epochMsSchema,\n })\n .refine((sync) => sync.reconciledRosterRevision <= sync.rosterRevision, {\n message: 'A roster obligation cannot be reconciled past its own revision.',\n path: ['reconciledRosterRevision'],\n })\n .refine(\n (sync) =>\n (sync.syncStatus === RECONCILED_ROSTER_SYNC_STATUS) ===\n (sync.reconciledRosterRevision === sync.rosterRevision),\n {\n message: 'An obligation is reconciled exactly when its reconciled revision is its revision.',\n path: ['syncStatus'],\n },\n )\n .refine(\n (sync) => (sync.syncStatus === FAILED_ROSTER_SYNC_STATUS) === (sync.failedAt !== undefined),\n {\n message: 'An obligation carries `failedAt` exactly while it is failed.',\n path: ['failedAt'],\n },\n );\nexport type MembershipRosterSync = z.infer<typeof MembershipRosterSyncSchema>;\n"]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// operator. `migrationActionRuns/{actionId}` holds each step's latest real run — the one its
|
|
6
6
|
// dependents read — its latest preview, and, for a recorded step, what was recorded.
|
|
7
7
|
import { z } from 'zod';
|
|
8
|
-
import { MIGRATION_EVIDENCE_INPUT_FORMAT } from '../input-formats/
|
|
8
|
+
import { MIGRATION_EVIDENCE_INPUT_FORMAT } from '../input-formats/input-formats.js';
|
|
9
9
|
import { MIGRATION_ACTION_ID_KEYS } from '../migration-console/action-ids.js';
|
|
10
10
|
import { MAX_MIGRATION_FINDING_TEXT_LENGTH, MAX_MIGRATION_RUN_FINDINGS, MIGRATION_DESTINATION_STATE_KEYS, MIGRATION_RUN_STATUS_KEYS, } from '../migration-console/run-state.js';
|
|
11
11
|
import { countSchema, documentIdSegmentSchema, epochMsSchema, repairReasonSchema, statsOperationIdSchema, textFieldSchema, userIdSchema, } from './atoms.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-console.js","sourceRoot":"","sources":["../../src/doc-schemas/migration-console.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,EAAE;AACF,uGAAuG;AACvG,4FAA4F;AAC5F,6FAA6F;AAC7F,qFAAqF;AAErF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,+BAA+B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"migration-console.js","sourceRoot":"","sources":["../../src/doc-schemas/migration-console.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,EAAE;AACF,uGAAuG;AACvG,4FAA4F;AAC5F,6FAA6F;AAC7F,qFAAqF;AAErF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,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,eAAe,EACf,YAAY,GACb,MAAM,YAAY,CAAC;AAEpB,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,4FAA4F;AAC5F,MAAM,CAAC,MAAM,0BAA0B,GAAG,uBAAuB,CAAC;AAClE,gFAAgF;AAChF,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC,+BAA+B,CAAC,CAAC;AAExF,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC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,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":["// The migration console's recorded state — admin read, written only by the console's callables.\n//\n// `_serverData/migrationConsole` holds the cutover marker and the lock: one action runs at a time, and\n// whether the destinations are still the migration's is recorded here, never taken from the\n// operator. `migrationActionRuns/{actionId}` holds each step's latest real run — the one its\n// dependents read — its latest preview, and, for a recorded step, what was recorded.\n\nimport { z } from 'zod';\nimport { MIGRATION_EVIDENCE_INPUT_FORMAT } from '../input-formats/input-formats.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 textFieldSchema,\n userIdSchema,\n} from './atoms.js';\n\nexport const migrationActionIdSchema = z.enum(MIGRATION_ACTION_ID_KEYS);\nexport const migrationDestinationStateSchema = z.enum(MIGRATION_DESTINATION_STATE_KEYS);\n/** One logical run of an action, minted by the admin's browser when the admin starts it. */\nexport const migrationOperationIdSchema = documentIdSegmentSchema;\n/** What the operator records as proof of a step the console cannot see done. */\nexport const migrationEvidenceSchema = textFieldSchema(MIGRATION_EVIDENCE_INPUT_FORMAT);\n\nconst findingText = z.string().max(MAX_MIGRATION_FINDING_TEXT_LENGTH);\n\n/**\n * One document an action reported: skipped by a copy, missing or mismatched in a verification, or\n * named by one of an action's own report lists (a merged pair, a created roster entry, a ghost's\n * disposition) — `category` names which.\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\n/** A run's totals across its pages. A write action fills the first three, a verification the next three. */\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 // Set with `complete`: the moment the run reached its end.\n completedAt: epochMsSchema.optional(),\n status: z.enum(MIGRATION_RUN_STATUS_KEYS),\n pages: countSchema,\n // The resume key of the next page, or null once the run reached its end.\n nextResumeAfter: z.string().min(1).nullable(),\n counts: MigrationRunCountsSchema,\n // An action's own counters beyond the shared ones — merged pairs, corrections by field, kept\n // ghosts by disposition — summed across pages.\n details: z.record(z.string().min(1), countSchema),\n findings: z.array(MigrationFindingSchema).max(MAX_MIGRATION_RUN_FINDINGS),\n // Findings met past the kept ones; each page's answer carried them in full.\n findingsNotKept: countSchema,\n // A verification run declared, at its start, that its source is empty.\n expectEmptySource: z.boolean(),\n // A `verify.v1Pictures` run acknowledged, at its start, the sources it cannot examine.\n acknowledgeUnexaminedSources: z.boolean().optional(),\n // Why a stopped run stopped: the refusal its core gave.\n stoppedReason: findingText.optional(),\n});\nexport type MigrationRunRecord = z.infer<typeof MigrationRunRecordSchema>;\n\n/** A product control's run, an operator checkpoint, or the cutover, as recorded. */\nexport const MigrationStepRecordSchema = z.strictObject({\n recordedAt: epochMsSchema,\n recordedByUserId: userIdSchema,\n // A product control's runs, whose evidence the console checked.\n operationIds: z.array(statsOperationIdSchema).optional(),\n // An operator checkpoint's evidence, or a recorded step's reason.\n evidence: migrationEvidenceSchema,\n});\nexport type MigrationStepRecord = z.infer<typeof MigrationStepRecordSchema>;\n\nexport const MigrationActionRunSchema = z.strictObject({\n actionId: migrationActionIdSchema,\n // The latest real run: what every dependent and every gate reads.\n run: MigrationRunRecordSchema.optional(),\n // The latest dry run, kept apart so a preview never stands in for a run.\n preview: MigrationRunRecordSchema.optional(),\n recorded: MigrationStepRecordSchema.optional(),\n});\nexport type MigrationActionRun = z.infer<typeof MigrationActionRunSchema>;\n\n/** The one action holding the console, until its lease runs out. */\nexport const MigrationConsoleLockSchema = z.strictObject({\n actionId: migrationActionIdSchema,\n operationId: migrationOperationIdSchema,\n heldByUserId: userIdSchema,\n expiresAt: epochMsSchema,\n // Present while one page of the run is in flight: the moment its claim was stamped, and that\n // page's fencing token. Only the page holding this exact token records its result or releases the\n // lock; any other page, the same run's included, is refused while it stands. A lock stored\n // without one has no page in flight.\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending-media.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/pending-media.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,gBAAgB;;;;;;;;EAA2B,CAAC;AACzD,eAAO,MAAM,mBAAmB;;;;;;EAA8B,CAAC;AAI/D,eAAO,MAAM,sBAAsB;;;kBAExB,CAAC;AACZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAGtE,eAAO,MAAM,qBAAqB;;;;;;;;;k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AM,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC;AAC7E,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC","sourcesContent":["// `pendingMedia/{pendingMediaId}` — one accepted picture upload: the durable hand-off from the\n// accepting callable to the processing trigger. Its id is the upload's staging id, which is also\n// the picture's id; rows are never deleted, so no two uploads ever share an id.\n//\n// The shape is media-schemas' generic pending-media lifecycle composed with Q-Sports' origins and\n// domain events. Every field is written by the server: `originalFileName` and `clientContext`,\n// which the generic shape requires, hold the staging id and the origin, so no client-authored\n// metadata reaches the row. `targetInfo` is the server-normalized `PendingMediaTarget`.\n\nimport { z } from 'zod';\nimport { createPendingMediaSchemas } from '@ttt-productions/media-schemas';\nimport { DomainEventSchema } from '../domain-events/domain-events.js';\nimport { FILE_ORIGIN_KEYS, PICTURE_ORIGIN_KEYS } from '../media/file-origins.js';\nimport { AWARD_DEFINITION_OWNER_KIND } from '../types/picture-owners.js';\nimport { countSchema } from './atoms.js';\nimport { awardNameSchema } from './catalogs.js';\nimport { pictureOwnerKindSchema } from './gallery.js';\n\nexport const fileOriginSchema = z.enum(FILE_ORIGIN_KEYS);\nexport const pictureOriginSchema = z.enum(PICTURE_ORIGIN_KEYS);\n\n// A stored object, by bucket and path — never a URL. A retained signature is recorded this way, and\n// so is the source a carried picture was read from.\nexport const StorageObjectRefSchema = z\n .object({ bucket: z.string().min(1), path: z.string().min(1) })\n .strict();\nexport type StorageObjectRef = z.infer<typeof StorageObjectRefSchema>;\n\n// The document a picture belongs to. A landing page picture's owner id is `SPECIAL_DOCS.LANDING_PAGE`.\nexport const PictureOwnerRefSchema = z\n .object({ kind: pictureOwnerKindSchema, id: z.string().min(1) })\n .strict();\nexport type PictureOwnerRef = z.infer<typeof PictureOwnerRefSchema>;\n\nexport const PendingMediaTargetSchema = z\n .object({\n owner: PictureOwnerRefSchema,\n // The object a carried picture was read from. Written only by the migration console's picture\n // carry, never from a callable's input; a carried picture fills only an empty slot.\n carriedFrom: StorageObjectRefSchema.optional(),\n // A carried picture's position in its V1 source list, so the carried gallery keeps V1's order\n // and V1's first image stays the featured one. Only beside `carriedFrom`.\n sourceIndex: countSchema.optional(),\n // A badge upload that creates its award: the award's name, which the publication writes with\n // the award. The owner's id is then the upload's staging id.\n newAwardName: awardNameSchema.optional(),\n })\n .strict()\n .refine(\n (target) =>\n target.newAwardName === undefined || target.owner.kind === AWARD_DEFINITION_OWNER_KIND,\n {\n message: 'Only a badge upload creates an award.',\n path: ['newAwardName'],\n },\n )\n .refine((target) => target.sourceIndex === undefined || target.carriedFrom !== undefined, {\n message: 'Only a carried picture has a source position.',\n path: ['sourceIndex'],\n });\nexport type PendingMediaTarget = z.infer<typeof PendingMediaTargetSchema>;\n\nconst schemas = createPendingMediaSchemas({\n fileOriginSchema,\n domainEventSchema: DomainEventSchema,\n});\n\nexport const PendingMediaErrorCategorySchema = schemas.PendingMediaErrorCategorySchema;\nexport const PendingMediaResultSchema = schemas.PendingMediaResultSchema;\nexport const PendingMediaPendingSchema = schemas.PendingMediaPendingSchema;\nexport const PendingMediaProcessingSchema = schemas.PendingMediaProcessingSchema;\nexport const PendingMediaCompletedSchema = schemas.PendingMediaCompletedSchema;\nexport const PendingMediaFailedSchema = schemas.PendingMediaFailedSchema;\nexport const PendingMediaRejectedSchema = schemas.PendingMediaRejectedSchema;\nexport const PendingMediaSchema = schemas.PendingMediaSchema;\n\nexport type PendingMediaErrorCategory = z.infer<typeof PendingMediaErrorCategorySchema>;\nexport type PendingMediaResult = z.infer<typeof PendingMediaResultSchema>;\nexport type PendingMediaPending = z.infer<typeof PendingMediaPendingSchema>;\nexport type PendingMediaProcessing = z.infer<typeof PendingMediaProcessingSchema>;\nexport type PendingMediaCompleted = z.infer<typeof PendingMediaCompletedSchema>;\nexport type PendingMediaFailed = z.infer<typeof PendingMediaFailedSchema>;\nexport type PendingMediaRejected = z.infer<typeof PendingMediaRejectedSchema>;\nexport type PendingMedia = z.infer<typeof PendingMediaSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picture-retirement.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/picture-retirement.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,6BAA6B;;;;;;EAAyC,CAAC;AAEpF,eAAO,MAAM,6BAA6B;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"picture-retirement.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/picture-retirement.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,6BAA6B;;;;;;EAAyC,CAAC;AAEpF,eAAO,MAAM,6BAA6B;;;;;;;;;;;4BAWxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;iBAIlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -16,7 +16,11 @@ export const PictureRetirementTargetSchema = z.discriminatedUnion('kind', [
|
|
|
16
16
|
z.object({ kind: z.literal('picture'), pictureId: pictureIdSchema }).strict(),
|
|
17
17
|
// A deleted owner's whole gallery: every one of its gallery documents and their sizes.
|
|
18
18
|
z
|
|
19
|
-
.object({
|
|
19
|
+
.object({
|
|
20
|
+
kind: z.literal('gallery'),
|
|
21
|
+
ownerKind: galleryOwnerKindSchema,
|
|
22
|
+
ownerId: z.string().min(1),
|
|
23
|
+
})
|
|
20
24
|
.strict(),
|
|
21
25
|
]);
|
|
22
26
|
export const PictureRetirementSchema = z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picture-retirement.js","sourceRoot":"","sources":["../../src/doc-schemas/picture-retirement.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,UAAU;AACV,EAAE;AACF,oGAAoG;AACpG,8FAA8F;AAC9F,oGAAoG;AACpG,mGAAmG;AACnG,kDAAkD;AAElD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;AAEpF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACxE,uCAAuC;IACvC,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC7E,uFAAuF;IACvF,CAAC;SACE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"picture-retirement.js","sourceRoot":"","sources":["../../src/doc-schemas/picture-retirement.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,UAAU;AACV,EAAE;AACF,oGAAoG;AACpG,8FAA8F;AAC9F,oGAAoG;AACpG,mGAAmG;AACnG,kDAAkD;AAElD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;AAEpF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACxE,uCAAuC;IACvC,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC7E,uFAAuF;IACvF,CAAC;SACE,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;QAC1B,SAAS,EAAE,sBAAsB;QACjC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KAC3B,CAAC;SACD,MAAM,EAAE;CACZ,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAE,6BAA6B;IACrC,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,6BAA6B;CACtC,CAAC,CAAC","sourcesContent":["// `pictureRetirements/{retirementId}` — the durable obligation to delete picture files. No client\n// access.\n//\n// It is written in the same transaction that drops a picture's last reference, fails its upload, or\n// deletes its owner, and the media maintenance sweep carries it out and then deletes the row.\n// Retirement is the only way files under the picture prefix are deleted, and the only way a deleted\n// owner's gallery documents go: a picture target's id is the picture id, and a gallery target's is\n// `buildGalleryRetirementId(ownerKind, ownerId)`.\n\nimport { z } from 'zod';\nimport { PICTURE_RETIREMENT_REASON_KEYS } from '../types/uploads.js';\nimport { epochMsSchema } from './atoms.js';\nimport { galleryOwnerKindSchema, pictureIdSchema } from './gallery.js';\n\nexport const pictureRetirementReasonSchema = z.enum(PICTURE_RETIREMENT_REASON_KEYS);\n\nexport const PictureRetirementTargetSchema = z.discriminatedUnion('kind', [\n // One picture: its three stored sizes.\n z.object({ kind: z.literal('picture'), pictureId: pictureIdSchema }).strict(),\n // A deleted owner's whole gallery: every one of its gallery documents and their sizes.\n z\n .object({\n kind: z.literal('gallery'),\n ownerKind: galleryOwnerKindSchema,\n ownerId: z.string().min(1),\n })\n .strict(),\n]);\nexport type PictureRetirementTarget = z.infer<typeof PictureRetirementTargetSchema>;\n\nexport const PictureRetirementSchema = z.object({\n target: PictureRetirementTargetSchema,\n requestedAt: epochMsSchema,\n reason: pictureRetirementReasonSchema,\n});\nexport type PictureRetirement = z.infer<typeof PictureRetirementSchema>;\n"]}
|
|
@@ -2717,9 +2717,9 @@ export declare const COLLECTION_SCHEMAS: {
|
|
|
2717
2717
|
readonly 'notificationDeliveries/{deliveryId}': z.ZodObject<{
|
|
2718
2718
|
deliveryId: z.ZodString;
|
|
2719
2719
|
state: z.ZodEnum<{
|
|
2720
|
-
skipped: "skipped";
|
|
2721
2720
|
queued: "queued";
|
|
2722
2721
|
materialized: "materialized";
|
|
2722
|
+
skipped: "skipped";
|
|
2723
2723
|
deadLetter: "deadLetter";
|
|
2724
2724
|
}>;
|
|
2725
2725
|
notificationType: z.ZodEnum<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/registry.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/registry.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiD7B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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Schema, TeamJoinRequestSchema, TeamInvitationSchema, TeamMembershipSchema, } from './team-membership.js';
|
|
32
32
|
import { HistoricalStatsSchema, UserPrivateDataSchema, UserProfileSchema } from './user-profile.js';
|
|
33
33
|
import { HardwareLoanContractSchema, SignedWaiverSchema } from './waivers-and-hardware.js';
|
|
34
|
-
import { WaiverTemplateRegistrySchema, WaiverTemplateSchema, WaiverTemplateVersionSchema } from './waiver-template.js';
|
|
34
|
+
import { WaiverTemplateRegistrySchema, WaiverTemplateSchema, WaiverTemplateVersionSchema, } from './waiver-template.js';
|
|
35
35
|
export const COLLECTION_SCHEMAS = {
|
|
36
36
|
'userProfiles/{userId}': UserProfileSchema,
|
|
37
37
|
'userProfiles/{userId}/privateData/{privateDataId}': UserPrivateDataSchema,
|