@ttt-productions/q-core 0.1.1 → 0.1.3
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 +12 -0
- package/dist/constants/business.d.ts.map +1 -1
- package/dist/constants/business.js +24 -0
- package/dist/constants/business.js.map +1 -1
- package/dist/constants/media.d.ts +1 -0
- package/dist/constants/media.d.ts.map +1 -1
- package/dist/constants/media.js +5 -0
- package/dist/constants/media.js.map +1 -1
- package/dist/doc-schemas/admin-notifications.d.ts +1 -0
- package/dist/doc-schemas/admin-notifications.d.ts.map +1 -1
- package/dist/doc-schemas/admin-notifications.js +4 -0
- package/dist/doc-schemas/admin-notifications.js.map +1 -1
- package/dist/doc-schemas/atoms.d.ts +2 -0
- package/dist/doc-schemas/atoms.d.ts.map +1 -1
- package/dist/doc-schemas/audit-event.d.ts +2 -0
- package/dist/doc-schemas/audit-event.d.ts.map +1 -1
- package/dist/doc-schemas/gallery.d.ts +1 -0
- package/dist/doc-schemas/gallery.d.ts.map +1 -1
- package/dist/doc-schemas/gallery.js +3 -0
- package/dist/doc-schemas/gallery.js.map +1 -1
- package/dist/doc-schemas/migration-console.d.ts +2 -0
- package/dist/doc-schemas/migration-console.d.ts.map +1 -1
- package/dist/doc-schemas/migration-console.js +5 -0
- package/dist/doc-schemas/migration-console.js.map +1 -1
- package/dist/doc-schemas/pending-media.d.ts +1 -0
- package/dist/doc-schemas/pending-media.d.ts.map +1 -1
- package/dist/doc-schemas/pending-media.js +8 -0
- package/dist/doc-schemas/pending-media.js.map +1 -1
- package/dist/doc-schemas/registry.d.ts +12 -0
- package/dist/doc-schemas/registry.d.ts.map +1 -1
- package/dist/doc-schemas/stats-operation.d.ts.map +1 -1
- package/dist/doc-schemas/stats-operation.js +6 -11
- package/dist/doc-schemas/stats-operation.js.map +1 -1
- package/dist/doc-schemas/system.d.ts +7 -0
- package/dist/doc-schemas/system.d.ts.map +1 -1
- package/dist/doc-schemas/system.js +4 -1
- package/dist/doc-schemas/system.js.map +1 -1
- package/dist/doc-schemas/user-profile.d.ts +1 -0
- package/dist/doc-schemas/user-profile.d.ts.map +1 -1
- package/dist/doc-schemas/user-profile.js +5 -0
- package/dist/doc-schemas/user-profile.js.map +1 -1
- package/dist/doc-schemas/waiver-template.d.ts +1 -0
- package/dist/doc-schemas/waiver-template.d.ts.map +1 -1
- package/dist/doc-schemas/waiver-template.js +10 -1
- package/dist/doc-schemas/waiver-template.js.map +1 -1
- package/dist/doc-schemas/waivers-and-hardware.d.ts +1 -0
- package/dist/doc-schemas/waivers-and-hardware.d.ts.map +1 -1
- package/dist/doc-schemas/waivers-and-hardware.js +17 -9
- package/dist/doc-schemas/waivers-and-hardware.js.map +1 -1
- package/dist/ids/minted-ids.d.ts +1 -0
- package/dist/ids/minted-ids.d.ts.map +1 -1
- package/dist/ids/minted-ids.js +6 -0
- package/dist/ids/minted-ids.js.map +1 -1
- package/dist/input-formats/index.d.ts +2 -2
- package/dist/input-formats/index.d.ts.map +1 -1
- package/dist/input-formats/index.js +2 -2
- package/dist/input-formats/index.js.map +1 -1
- package/dist/migration-console/manifest.d.ts.map +1 -1
- package/dist/migration-console/manifest.js +11 -10
- package/dist/migration-console/manifest.js.map +1 -1
- package/dist/notifications/archive-all.d.ts +2 -0
- package/dist/notifications/archive-all.d.ts.map +1 -0
- package/dist/notifications/archive-all.js +6 -0
- package/dist/notifications/archive-all.js.map +1 -0
- package/dist/notifications/index.d.ts +1 -0
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +1 -0
- package/dist/notifications/index.js.map +1 -1
- package/dist/schemas/admin-notifications.d.ts +1 -0
- package/dist/schemas/admin-notifications.d.ts.map +1 -1
- package/dist/schemas/admin-notifications.js +4 -2
- package/dist/schemas/admin-notifications.js.map +1 -1
- package/dist/schemas/app-config.d.ts +2 -2
- package/dist/schemas/app-config.d.ts.map +1 -1
- package/dist/schemas/app-config.js +9 -5
- package/dist/schemas/app-config.js.map +1 -1
- package/dist/schemas/awards.d.ts +16 -4
- package/dist/schemas/awards.d.ts.map +1 -1
- package/dist/schemas/awards.js +10 -6
- package/dist/schemas/awards.js.map +1 -1
- package/dist/schemas/game-locations.d.ts +4 -4
- package/dist/schemas/game-locations.d.ts.map +1 -1
- package/dist/schemas/game-locations.js +11 -3
- package/dist/schemas/game-locations.js.map +1 -1
- package/dist/schemas/migration-console.d.ts +1 -0
- package/dist/schemas/migration-console.d.ts.map +1 -1
- package/dist/schemas/pictures.d.ts +3 -0
- package/dist/schemas/pictures.d.ts.map +1 -1
- package/dist/schemas/stats.d.ts +2 -0
- package/dist/schemas/stats.d.ts.map +1 -1
- package/dist/schemas/teams.d.ts +3 -2
- package/dist/schemas/teams.d.ts.map +1 -1
- package/dist/schemas/teams.js +22 -11
- package/dist/schemas/teams.js.map +1 -1
- package/dist/schemas/users.d.ts +7 -3
- package/dist/schemas/users.d.ts.map +1 -1
- package/dist/schemas/users.js +10 -3
- package/dist/schemas/users.js.map +1 -1
- package/dist/schemas/waiver-templates.d.ts +1 -0
- package/dist/schemas/waiver-templates.d.ts.map +1 -1
- package/dist/schemas/waiver-templates.js +4 -1
- package/dist/schemas/waiver-templates.js.map +1 -1
- package/dist/sports/index.d.ts +1 -0
- package/dist/sports/index.d.ts.map +1 -1
- package/dist/sports/index.js +1 -0
- package/dist/sports/index.js.map +1 -1
- package/dist/sports/ledger-continuity.d.ts +13 -0
- package/dist/sports/ledger-continuity.d.ts.map +1 -0
- package/dist/sports/ledger-continuity.js +19 -0
- package/dist/sports/ledger-continuity.js.map +1 -0
- package/dist/types/audit.d.ts +1 -1
- package/dist/types/audit.d.ts.map +1 -1
- package/dist/types/audit.js +5 -2
- package/dist/types/audit.js.map +1 -1
- package/dist/types/unions.d.ts +4 -2
- package/dist/types/unions.d.ts.map +1 -1
- package/dist/types/unions.js +6 -0
- package/dist/types/unions.js.map +1 -1
- package/dist/upload-variables/index.d.ts +3 -0
- package/dist/upload-variables/index.d.ts.map +1 -0
- package/dist/upload-variables/index.js +3 -0
- package/dist/upload-variables/index.js.map +1 -0
- package/dist/upload-variables/on-progress.d.ts +4 -0
- package/dist/upload-variables/on-progress.d.ts.map +1 -0
- package/dist/upload-variables/on-progress.js +10 -0
- package/dist/upload-variables/on-progress.js.map +1 -0
- package/dist/upload-variables/picture-upload-variables.d.ts +32 -0
- package/dist/upload-variables/picture-upload-variables.d.ts.map +1 -0
- package/dist/upload-variables/picture-upload-variables.js +21 -0
- package/dist/upload-variables/picture-upload-variables.js.map +1 -0
- package/dist/utils/app-config.d.ts +17 -3
- package/dist/utils/app-config.d.ts.map +1 -1
- package/dist/utils/app-config.js +21 -14
- package/dist/utils/app-config.js.map +1 -1
- package/package.json +6 -2
|
@@ -46,4 +46,16 @@ export declare const MAX_SCHEDULE_WEEK_TITLE_LENGTH = 100;
|
|
|
46
46
|
export declare const MAX_SCHEDULE_WEEK_GAMES = 20;
|
|
47
47
|
export declare const LEAGUE_TIME_ZONE = "America/New_York";
|
|
48
48
|
export declare const MAX_GAME_MEMO_LENGTH = 30;
|
|
49
|
+
export declare const countCapReachedMessage: (subject: string, limit: number, noun: string) => string;
|
|
50
|
+
export declare const MAX_ACTIVE_TEAM_MEMBERS = 100;
|
|
51
|
+
export declare const TEAM_FULL_MESSAGE: string;
|
|
52
|
+
export declare const MAX_ROSTER_SEED_MEMBERSHIPS_PER_TEAM = 100;
|
|
53
|
+
export declare const MAX_DEPARTED_ROSTER_ENTRIES_PER_TEAM = 20;
|
|
54
|
+
export declare const MAX_ROSTER_ENTRIES_PER_TEAM: number;
|
|
55
|
+
export declare const MAX_TEAMS_PER_LEAGUE = 498;
|
|
56
|
+
export declare const MAX_GAMES_PER_LEAGUE = 1000;
|
|
57
|
+
export declare const LEAGUE_TEAMS_FULL_MESSAGE: string;
|
|
58
|
+
export declare const LEAGUE_GAMES_FULL_MESSAGE: string;
|
|
59
|
+
export declare const MAX_STAT_EVENTS_PER_GAME = 5000;
|
|
60
|
+
export declare const GAME_STAT_LOG_FULL_MESSAGE: string;
|
|
49
61
|
//# sourceMappingURL=business.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"business.d.ts","sourceRoot":"","sources":["../../src/constants/business.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,eAAO,MAAM,oCAAoC,KAAK,CAAC;AACvD,eAAO,MAAM,oCAAoC,MAAM,CAAC;AACxD,eAAO,MAAM,kCAAkC,MAAM,CAAC;AAEtD,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAChD,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAGlD,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAGtC,eAAO,MAAM,gBAAgB;;;;;;EAGnB,CAAC;AACX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAC5E,eAAO,MAAM,yBAAyB,EAA8C,CAClF,qBAAqB,EACrB,GAAG,qBAAqB,EAAE,CAC3B,CAAC;AAGF,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAIxC,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAI1C,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAG5C,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAGzC,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAG5C,eAAO,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G1C,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAGnD,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAIvC,eAAO,MAAM,sBAAsB,GAAI,SAAS,MAAM,EAAE,OAAO,MAAM,EAAE,MAAM,MAAM,KAAG,MAC3B,CAAC;AAI5D,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,iBAAiB,QAA0E,CAAC;AAEzG,eAAO,MAAM,oCAAoC,MAA0B,CAAC;AAG5E,eAAO,MAAM,oCAAoC,KAAK,CAAC;AAEvD,eAAO,MAAM,2BAA2B,QAAiE,CAAC;AAK1G,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,eAAO,MAAM,yBAAyB,QAAuE,CAAC;AAC9G,eAAO,MAAM,yBAAyB,QAAuE,CAAC;AAI9G,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAC7C,eAAO,MAAM,0BAA0B,QAAkF,CAAC"}
|
|
@@ -70,4 +70,28 @@ export const MAX_SCHEDULE_WEEK_GAMES = 20;
|
|
|
70
70
|
export const LEAGUE_TIME_ZONE = 'America/New_York';
|
|
71
71
|
// A scorer's note on one person in a game ("red shirt", "#9").
|
|
72
72
|
export const MAX_GAME_MEMO_LENGTH = 30;
|
|
73
|
+
// How a refusal at a count cap reads: the thing that is full, its limit, and what it holds.
|
|
74
|
+
export const countCapReachedMessage = (subject, limit, noun) => `${subject} already has the maximum of ${limit} ${noun}.`;
|
|
75
|
+
// A team's size. Every way onto a team is refused at this many active members, inside the
|
|
76
|
+
// admission's transaction, so a game's roster can always be seeded and checked in one read.
|
|
77
|
+
export const MAX_ACTIVE_TEAM_MEMBERS = 100;
|
|
78
|
+
export const TEAM_FULL_MESSAGE = countCapReachedMessage('This team', MAX_ACTIVE_TEAM_MEMBERS, 'members');
|
|
79
|
+
// The memberships one game-roster seed reads for a team: every membership is active, so the cap.
|
|
80
|
+
export const MAX_ROSTER_SEED_MEMBERSHIPS_PER_TEAM = MAX_ACTIVE_TEAM_MEMBERS;
|
|
81
|
+
// Departed players a team's side of an open game may keep beside its members: a player who recorded
|
|
82
|
+
// stats in the game keeps their entry after leaving the team.
|
|
83
|
+
export const MAX_DEPARTED_ROSTER_ENTRIES_PER_TEAM = 20;
|
|
84
|
+
// The entries one team's side of a game may hold, so a reconcile or finalize reads them in one page.
|
|
85
|
+
export const MAX_ROSTER_ENTRIES_PER_TEAM = MAX_ACTIVE_TEAM_MEMBERS + MAX_DEPARTED_ROSTER_ENTRIES_PER_TEAM;
|
|
86
|
+
// A league's size. Standings, schedules, and rankings need a league's complete set of teams and
|
|
87
|
+
// games, so creation is refused at these caps rather than any read being cut short. The team cap is
|
|
88
|
+
// also the most teams one mode switch rewrites in its one transaction.
|
|
89
|
+
export const MAX_TEAMS_PER_LEAGUE = 498;
|
|
90
|
+
export const MAX_GAMES_PER_LEAGUE = 1000;
|
|
91
|
+
export const LEAGUE_TEAMS_FULL_MESSAGE = countCapReachedMessage('This league', MAX_TEAMS_PER_LEAGUE, 'teams');
|
|
92
|
+
export const LEAGUE_GAMES_FULL_MESSAGE = countCapReachedMessage('This league', MAX_GAMES_PER_LEAGUE, 'games');
|
|
93
|
+
// A game's stat log. A write that would take a game's `statEventSequence` past it is refused with
|
|
94
|
+
// nothing written, which also bounds the game's live play-by-play.
|
|
95
|
+
export const MAX_STAT_EVENTS_PER_GAME = 5000;
|
|
96
|
+
export const GAME_STAT_LOG_FULL_MESSAGE = countCapReachedMessage('This game', MAX_STAT_EVENTS_PER_GAME, 'recorded stats');
|
|
73
97
|
//# sourceMappingURL=business.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"business.js","sourceRoot":"","sources":["../../src/constants/business.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,6FAA6F;AAE7F,6EAA6E;AAC7E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AACzC,MAAM,CAAC,MAAM,uB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AC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAEnD,+DAA+D;AAC/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC","sourcesContent":["// Business limits and policy values both app roots enforce. A form reads these for its\n// `maxLength` / zod bound and the callable's input schema reads the same constant (ENG-005).\n\n// Display names, team names, and ghost player names share one length policy.\nexport const MIN_DISPLAY_NAME_LENGTH = 3;\nexport const MAX_DISPLAY_NAME_LENGTH = 50;\n// The shortest password an account takes: Firebase Auth's own floor.\nexport const PASSWORD_MIN_LENGTH = 6;\nexport const MIN_TEAM_NAME_LENGTH = 3;\nexport const MAX_TEAM_NAME_LENGTH = 50;\n\nexport const MIN_TEAM_JOIN_REQUEST_MESSAGE_LENGTH = 10;\nexport const MAX_TEAM_JOIN_REQUEST_MESSAGE_LENGTH = 500;\nexport const MAX_TEAM_INVITATION_MESSAGE_LENGTH = 500;\n\nexport const MIN_LEAGUE_TITLE_LENGTH = 3;\nexport const MAX_LEAGUE_TITLE_LENGTH = 100;\nexport const MIN_LEAGUE_DESCRIPTION_LENGTH = 10;\nexport const MAX_LEAGUE_DESCRIPTION_LENGTH = 5000;\n// How many teams in a pool reach the playoffs. The cap only bounds the input: no league comes near\n// it, and a cutoff above a pool's team count simply admits every team.\nexport const MAX_PLAYOFF_CUTOFF = 100;\n// The equipment a referee can be loaned. The catalog is this constant: adding an item is a code\n// change, and a contract records each item's id and name as it was loaned.\nexport const HARDWARE_CATALOG = [\n { id: 'ipad', name: 'iPad' },\n { id: 'ipad-charger', name: 'iPad Charger' },\n] as const;\nexport type HardwareCatalogItemId = (typeof HARDWARE_CATALOG)[number]['id'];\nexport const HARDWARE_CATALOG_ITEM_IDS = HARDWARE_CATALOG.map((item) => item.id) as [\n HardwareCatalogItemId,\n ...HardwareCatalogItemId[],\n];\n\n// An award's name in the catalog.\nexport const MIN_AWARD_NAME_LENGTH = 3;\nexport const MAX_AWARD_NAME_LENGTH = 60;\n\n// The most people one award grant may reach once its teams and leagues are resolved to their active\n// members: every grant of one call commits in one transaction, beside its audit events.\nexport const MAX_AWARD_GRANT_RECIPIENTS = 200;\n// The most users, teams, or leagues one award grant call may name in each list.\nexport const MAX_AWARD_GRANT_TARGETS = 20;\n\n// The reason an admin gives for a repair action — a backfill, a recalculation, a reopen — recorded on\n// its audit event (BACKEND-212).\nexport const MIN_REPAIR_REASON_LENGTH = 3;\nexport const MAX_REPAIR_REASON_LENGTH = 500;\n\n// The most uids one `updateAdminList` call may grant or revoke per list.\nexport const MAX_ADMIN_LIST_CHANGES = 20;\n\n// A team may be created in a league until this many days after the league's start date.\nexport const TEAM_CREATION_CUTOFF_DAYS = 14;\n\n// Contact phone numbers are stored as typed, bounded only in length.\nexport const MAX_CONTACT_PHONE_LENGTH = 30;\n\n// The failure a roster obligation records when a reconciliation run fails, cut to this length.\nexport const MAX_ROSTER_SYNC_FAILURE_MESSAGE_LENGTH = 500;\n\n// `_appConfig/app` operator messages.\nexport const MAX_MAINTENANCE_MESSAGE_LENGTH = 2000;\nexport const MAX_ANNOUNCEMENT_MESSAGE_LENGTH = 300;\n// `_appConfig/app.appVersion` — the version a live client compares itself against.\nexport const MAX_APP_VERSION_LENGTH = 64;\n\n// `_appConfig/landingPage` copy.\nexport const MAX_LANDING_HERO_TITLE_LENGTH = 200;\nexport const MAX_LANDING_ABOUT_TEXT_LENGTH = 5000;\n\n// Waiver template wording. A signed waiver carries its own copy of the title and text, so the text\n// cap also bounds every signature document.\nexport const MAX_WAIVER_TEMPLATE_TITLE_LENGTH = 120;\nexport const MAX_WAIVER_TEMPLATE_TEXT_LENGTH = 20000;\n\n// Game locations: the venue, its address, the courts or sheets inside it, and the directions memo.\nexport const MAX_GAME_LOCATION_NAME_LENGTH = 100;\nexport const MAX_GAME_LOCATION_STREET_ADDRESS_LENGTH = 200;\nexport const MAX_GAME_LOCATION_SUB_LOCATIONS = 50;\nexport const MAX_GAME_LOCATION_SUB_LOCATION_LENGTH = 60;\nexport const MAX_GAME_LOCATION_MEMO_LENGTH = 500;\n\n// A week of the schedule: its title, and the games one save creates with it — each seeded with its\n// teams' rosters in the same transaction, so a larger week is saved in parts.\nexport const MAX_SCHEDULE_WEEK_TITLE_LENGTH = 100;\nexport const MAX_SCHEDULE_WEEK_GAMES = 20;\n\n// The timezone a game's `dayKey` (its local calendar date) is computed in.\nexport const LEAGUE_TIME_ZONE = 'America/New_York';\n\n// A scorer's note on one person in a game (\"red shirt\", \"#9\").\nexport const MAX_GAME_MEMO_LENGTH = 30;\n\n"]}
|
|
1
|
+
{"version":3,"file":"business.js","sourceRoot":"","sources":["../../src/constants/business.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,6FAA6F;AAE7F,6EAA6E;AAC7E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AACzC,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAC1C,qEAAqE;AACrE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AACrC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AACtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEvC,MAAM,CAAC,MAAM,oCAAoC,GAAG,EAAE,CAAC;AACvD,MAAM,CAAC,MAAM,oCAAoC,GAAG,GAAG,CAAC;AACxD,MAAM,CAAC,MAAM,kCAAkC,GAAG,GAAG,CAAC;AAEtD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AACzC,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAC3C,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,CAAC;AAChD,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,CAAC;AAClD,mGAAmG;AACnG,uEAAuE;AACvE,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AACtC,gGAAgG;AAChG,2EAA2E;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,E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AgG;AAChG,oGAAoG;AACpG,uEAAuE;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AACxC,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AACzC,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAAsB,CAAC,aAAa,EAAE,oBAAoB,EAAE,OAAO,CAAC,CAAC;AAC9G,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAAsB,CAAC,aAAa,EAAE,oBAAoB,EAAE,OAAO,CAAC,CAAC;AAE9G,kGAAkG;AAClG,mEAAmE;AACnE,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAC7C,MAAM,CAAC,MAAM,0BAA0B,GAAG,sBAAsB,CAAC,WAAW,EAAE,wBAAwB,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["// Business limits and policy values both app roots enforce. A form reads these for its\n// `maxLength` / zod bound and the callable's input schema reads the same constant (ENG-005).\n\n// Display names, team names, and ghost player names share one length policy.\nexport const MIN_DISPLAY_NAME_LENGTH = 3;\nexport const MAX_DISPLAY_NAME_LENGTH = 50;\n// The shortest password an account takes: Firebase Auth's own floor.\nexport const PASSWORD_MIN_LENGTH = 6;\nexport const MIN_TEAM_NAME_LENGTH = 3;\nexport const MAX_TEAM_NAME_LENGTH = 50;\n\nexport const MIN_TEAM_JOIN_REQUEST_MESSAGE_LENGTH = 10;\nexport const MAX_TEAM_JOIN_REQUEST_MESSAGE_LENGTH = 500;\nexport const MAX_TEAM_INVITATION_MESSAGE_LENGTH = 500;\n\nexport const MIN_LEAGUE_TITLE_LENGTH = 3;\nexport const MAX_LEAGUE_TITLE_LENGTH = 100;\nexport const MIN_LEAGUE_DESCRIPTION_LENGTH = 10;\nexport const MAX_LEAGUE_DESCRIPTION_LENGTH = 5000;\n// How many teams in a pool reach the playoffs. The cap only bounds the input: no league comes near\n// it, and a cutoff above a pool's team count simply admits every team.\nexport const MAX_PLAYOFF_CUTOFF = 100;\n// The equipment a referee can be loaned. The catalog is this constant: adding an item is a code\n// change, and a contract records each item's id and name as it was loaned.\nexport const HARDWARE_CATALOG = [\n { id: 'ipad', name: 'iPad' },\n { id: 'ipad-charger', name: 'iPad Charger' },\n] as const;\nexport type HardwareCatalogItemId = (typeof HARDWARE_CATALOG)[number]['id'];\nexport const HARDWARE_CATALOG_ITEM_IDS = HARDWARE_CATALOG.map((item) => item.id) as [\n HardwareCatalogItemId,\n ...HardwareCatalogItemId[],\n];\n\n// An award's name in the catalog.\nexport const MIN_AWARD_NAME_LENGTH = 3;\nexport const MAX_AWARD_NAME_LENGTH = 60;\n\n// The most people one award grant may reach once its teams and leagues are resolved to their active\n// members: every grant of one call commits in one transaction, beside its audit events.\nexport const MAX_AWARD_GRANT_RECIPIENTS = 200;\n// The most users, teams, or leagues one award grant call may name in each list.\nexport const MAX_AWARD_GRANT_TARGETS = 20;\n\n// The reason an admin gives for a repair action — a backfill, a recalculation, a reopen — recorded on\n// its audit event (BACKEND-212).\nexport const MIN_REPAIR_REASON_LENGTH = 3;\nexport const MAX_REPAIR_REASON_LENGTH = 500;\n\n// The most uids one `updateAdminList` call may grant or revoke per list.\nexport const MAX_ADMIN_LIST_CHANGES = 20;\n\n// A team may be created in a league until this many days after the league's start date.\nexport const TEAM_CREATION_CUTOFF_DAYS = 14;\n\n// Contact phone numbers are stored as typed, bounded only in length.\nexport const MAX_CONTACT_PHONE_LENGTH = 30;\n\n// The failure a roster obligation records when a reconciliation run fails, cut to this length.\nexport const MAX_ROSTER_SYNC_FAILURE_MESSAGE_LENGTH = 500;\n\n// `_appConfig/app` operator messages.\nexport const MAX_MAINTENANCE_MESSAGE_LENGTH = 2000;\nexport const MAX_ANNOUNCEMENT_MESSAGE_LENGTH = 300;\n// `_appConfig/app.appVersion` — the version a live client compares itself against.\nexport const MAX_APP_VERSION_LENGTH = 64;\n\n// `_appConfig/landingPage` copy.\nexport const MAX_LANDING_HERO_TITLE_LENGTH = 200;\nexport const MAX_LANDING_ABOUT_TEXT_LENGTH = 5000;\n\n// Waiver template wording. A signed waiver carries its own copy of the title and text, so the text\n// cap also bounds every signature document.\nexport const MAX_WAIVER_TEMPLATE_TITLE_LENGTH = 120;\nexport const MAX_WAIVER_TEMPLATE_TEXT_LENGTH = 20000;\n\n// Game locations: the venue, its address, the courts or sheets inside it, and the directions memo.\nexport const MAX_GAME_LOCATION_NAME_LENGTH = 100;\nexport const MAX_GAME_LOCATION_STREET_ADDRESS_LENGTH = 200;\nexport const MAX_GAME_LOCATION_SUB_LOCATIONS = 50;\nexport const MAX_GAME_LOCATION_SUB_LOCATION_LENGTH = 60;\nexport const MAX_GAME_LOCATION_MEMO_LENGTH = 500;\n\n// A week of the schedule: its title, and the games one save creates with it — each seeded with its\n// teams' rosters in the same transaction, so a larger week is saved in parts.\nexport const MAX_SCHEDULE_WEEK_TITLE_LENGTH = 100;\nexport const MAX_SCHEDULE_WEEK_GAMES = 20;\n\n// The timezone a game's `dayKey` (its local calendar date) is computed in.\nexport const LEAGUE_TIME_ZONE = 'America/New_York';\n\n// A scorer's note on one person in a game (\"red shirt\", \"#9\").\nexport const MAX_GAME_MEMO_LENGTH = 30;\n\n\n// How a refusal at a count cap reads: the thing that is full, its limit, and what it holds.\nexport const countCapReachedMessage = (subject: string, limit: number, noun: string): string =>\n `${subject} already has the maximum of ${limit} ${noun}.`;\n\n// A team's size. Every way onto a team is refused at this many active members, inside the\n// admission's transaction, so a game's roster can always be seeded and checked in one read.\nexport const MAX_ACTIVE_TEAM_MEMBERS = 100;\nexport const TEAM_FULL_MESSAGE = countCapReachedMessage('This team', MAX_ACTIVE_TEAM_MEMBERS, 'members');\n// The memberships one game-roster seed reads for a team: every membership is active, so the cap.\nexport const MAX_ROSTER_SEED_MEMBERSHIPS_PER_TEAM = MAX_ACTIVE_TEAM_MEMBERS;\n// Departed players a team's side of an open game may keep beside its members: a player who recorded\n// stats in the game keeps their entry after leaving the team.\nexport const MAX_DEPARTED_ROSTER_ENTRIES_PER_TEAM = 20;\n// The entries one team's side of a game may hold, so a reconcile or finalize reads them in one page.\nexport const MAX_ROSTER_ENTRIES_PER_TEAM = MAX_ACTIVE_TEAM_MEMBERS + MAX_DEPARTED_ROSTER_ENTRIES_PER_TEAM;\n\n// A league's size. Standings, schedules, and rankings need a league's complete set of teams and\n// games, so creation is refused at these caps rather than any read being cut short. The team cap is\n// also the most teams one mode switch rewrites in its one transaction.\nexport const MAX_TEAMS_PER_LEAGUE = 498;\nexport const MAX_GAMES_PER_LEAGUE = 1000;\nexport const LEAGUE_TEAMS_FULL_MESSAGE = countCapReachedMessage('This league', MAX_TEAMS_PER_LEAGUE, 'teams');\nexport const LEAGUE_GAMES_FULL_MESSAGE = countCapReachedMessage('This league', MAX_GAMES_PER_LEAGUE, 'games');\n\n// A game's stat log. A write that would take a game's `statEventSequence` past it is refused with\n// nothing written, which also bounds the game's live play-by-play.\nexport const MAX_STAT_EVENTS_PER_GAME = 5000;\nexport const GAME_STAT_LOG_FULL_MESSAGE = countCapReachedMessage('This game', MAX_STAT_EVENTS_PER_GAME, 'recorded stats');\n"]}
|
|
@@ -8,6 +8,7 @@ export declare const PICTURE_RETIREMENT_PAGE_SIZE = 50;
|
|
|
8
8
|
export declare const GALLERY_RETIREMENT_PICTURES_PER_RUN = 100;
|
|
9
9
|
export declare const STAGING_LIST_PAGE_SIZE = 1000;
|
|
10
10
|
export declare const MAX_STAGING_DELETES_PER_RUN = 500;
|
|
11
|
+
export declare const MAX_STAGING_EXAMINED_PER_RUN: number;
|
|
11
12
|
export declare const MAX_V1_PICTURE_CARRY_ATTEMPTS = 3;
|
|
12
13
|
export declare const MAX_STAGING_UPLOAD_PATH_LENGTH = 300;
|
|
13
14
|
//# sourceMappingURL=media.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/constants/media.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAI/C,eAAO,MAAM,yBAAyB,QAAiB,CAAC;AAIxD,eAAO,MAAM,0BAA0B,QAAiB,CAAC;AAIzD,eAAO,MAAM,wBAAwB,QAAe,CAAC;AAIrD,eAAO,MAAM,6BAA6B,MAAM,CAAC;AACjD,eAAO,MAAM,qCAAqC,IAAI,CAAC;AACvD,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAC/C,eAAO,MAAM,mCAAmC,MAAM,CAAC;AACvD,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,2BAA2B,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/constants/media.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAI/C,eAAO,MAAM,yBAAyB,QAAiB,CAAC;AAIxD,eAAO,MAAM,0BAA0B,QAAiB,CAAC;AAIzD,eAAO,MAAM,wBAAwB,QAAe,CAAC;AAIrD,eAAO,MAAM,6BAA6B,MAAM,CAAC;AACjD,eAAO,MAAM,qCAAqC,IAAI,CAAC;AACvD,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAC/C,eAAO,MAAM,mCAAmC,MAAM,CAAC;AACvD,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAK/C,eAAO,MAAM,4BAA4B,QAA6B,CAAC;AAIvE,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAG/C,eAAO,MAAM,8BAA8B,MAAM,CAAC"}
|
package/dist/constants/media.js
CHANGED
|
@@ -23,6 +23,11 @@ export const PICTURE_RETIREMENT_PAGE_SIZE = 50;
|
|
|
23
23
|
export const GALLERY_RETIREMENT_PICTURES_PER_RUN = 100;
|
|
24
24
|
export const STAGING_LIST_PAGE_SIZE = 1000;
|
|
25
25
|
export const MAX_STAGING_DELETES_PER_RUN = 500;
|
|
26
|
+
// The most staged objects one abandoned-staging pass examines before it stops and saves its
|
|
27
|
+
// position. Kept objects (young, with a live row, unreadable) cost nothing against the delete cap, so
|
|
28
|
+
// this is what bounds a pass over a long kept stretch; two listing pages keep the pass well inside
|
|
29
|
+
// the sweep's timeout beside its other passes, and the next run resumes after the last one examined.
|
|
30
|
+
export const MAX_STAGING_EXAMINED_PER_RUN = 2 * STAGING_LIST_PAGE_SIZE;
|
|
26
31
|
// How many times the migration console's picture carry enqueues one source before reporting it as refused by the
|
|
27
32
|
// pipeline.
|
|
28
33
|
export const MAX_V1_PICTURE_CARRY_ATTEMPTS = 3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../src/constants/media.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,mGAAmG;AACnG,6CAA6C;AAE7C,MAAM,SAAS,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5B,MAAM,OAAO,GAAG,EAAE,GAAG,SAAS,CAAC;AAE/B,iGAAiG;AACjG,yCAAyC;AACzC,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAE/C,+FAA+F;AAC/F,wFAAwF;AACxF,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,GAAG,SAAS,CAAC;AAExD,oGAAoG;AACpG,oEAAoE;AACpE,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,GAAG,SAAS,CAAC;AAEzD,6FAA6F;AAC7F,4FAA4F;AAC5F,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,GAAG,OAAO,CAAC;AAErD,kGAAkG;AAClG,2BAA2B;AAC3B,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AACjD,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAC/C,MAAM,CAAC,MAAM,mCAAmC,GAAG,GAAG,CAAC;AACvD,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAC3C,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../src/constants/media.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,mGAAmG;AACnG,6CAA6C;AAE7C,MAAM,SAAS,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5B,MAAM,OAAO,GAAG,EAAE,GAAG,SAAS,CAAC;AAE/B,iGAAiG;AACjG,yCAAyC;AACzC,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAE/C,+FAA+F;AAC/F,wFAAwF;AACxF,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,GAAG,SAAS,CAAC;AAExD,oGAAoG;AACpG,oEAAoE;AACpE,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,GAAG,SAAS,CAAC;AAEzD,6FAA6F;AAC7F,4FAA4F;AAC5F,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,GAAG,OAAO,CAAC;AAErD,kGAAkG;AAClG,2BAA2B;AAC3B,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AACjD,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAC/C,MAAM,CAAC,MAAM,mCAAmC,GAAG,GAAG,CAAC;AACvD,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAC3C,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAC/C,4FAA4F;AAC5F,sGAAsG;AACtG,mGAAmG;AACnG,qGAAqG;AACrG,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,GAAG,sBAAsB,CAAC;AAEvE,iHAAiH;AACjH,YAAY;AACZ,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAE/C,+FAA+F;AAC/F,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,CAAC","sourcesContent":["// Upload pipeline policy: the processing claim, the maintenance sweep's windows and bounds, and the\n// retry ceiling of the migration console's picture carry. The generic claim and lease machinery is\n// media-schemas'; the numbers are Q-Sports'.\n\nconst MINUTE_MS = 60 * 1000;\nconst HOUR_MS = 60 * MINUTE_MS;\n\n// Processing attempts a picture upload gets, the first included. A second attempt exists only to\n// recover a crashed or killed first one.\nexport const MEDIA_PROCESSING_MAX_ATTEMPTS = 2;\n\n// How long a processing claim owns its row before a redelivery may reclaim it. Longer than the\n// processing trigger's timeout, so a live attempt is never reclaimed from under itself.\nexport const MEDIA_PROCESSING_LEASE_MS = 10 * MINUTE_MS;\n\n// An upload still `pending` or `processing` this long after it was accepted, past its lease, has no\n// live attempt left driving it, and the maintenance sweep fails it.\nexport const STALE_PENDING_MEDIA_AGE_MS = 30 * MINUTE_MS;\n\n// A staged object this old with no `pending` or `processing` upload row is abandoned — never\n// accepted, consumed by a signing, or left by a finished upload — and the sweep deletes it.\nexport const ABANDONED_STAGING_AGE_MS = 24 * HOUR_MS;\n\n// The maintenance sweep's per-run bounds (BACKEND-112). Each pass stops at its bound and the next\n// scheduled run continues.\nexport const STALE_PENDING_MEDIA_PAGE_SIZE = 100;\nexport const MAX_STALE_PENDING_MEDIA_PAGES_PER_RUN = 5;\nexport const PICTURE_RETIREMENT_PAGE_SIZE = 50;\nexport const GALLERY_RETIREMENT_PICTURES_PER_RUN = 100;\nexport const STAGING_LIST_PAGE_SIZE = 1000;\nexport const MAX_STAGING_DELETES_PER_RUN = 500;\n// The most staged objects one abandoned-staging pass examines before it stops and saves its\n// position. Kept objects (young, with a live row, unreadable) cost nothing against the delete cap, so\n// this is what bounds a pass over a long kept stretch; two listing pages keep the pass well inside\n// the sweep's timeout beside its other passes, and the next run resumes after the last one examined.\nexport const MAX_STAGING_EXAMINED_PER_RUN = 2 * STAGING_LIST_PAGE_SIZE;\n\n// How many times the migration console's picture carry enqueues one source before reporting it as refused by the\n// pipeline.\nexport const MAX_V1_PICTURE_CARRY_ATTEMPTS = 3;\n\n// The longest staging path a callable accepts: `uploads/{origin}/{uid}/{uuid}` is far shorter.\nexport const MAX_STAGING_UPLOAD_PATH_LENGTH = 300;\n"]}
|
|
@@ -141,6 +141,7 @@ export declare const NotificationArchiveAllJobSchema: z.ZodObject<{
|
|
|
141
141
|
}>;
|
|
142
142
|
revision: z.ZodNumber;
|
|
143
143
|
archived: z.ZodNumber;
|
|
144
|
+
notArchived: z.ZodOptional<z.ZodNumber>;
|
|
144
145
|
error: z.ZodNullable<z.ZodString>;
|
|
145
146
|
attemptCount: z.ZodNumber;
|
|
146
147
|
nextAttemptAt: z.ZodNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-notifications.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/admin-notifications.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAIvE,eAAO,MAAM,2BAA2B;;;EAAuC,CAAC;AAIhF,eAAO,MAAM,2CAA2C;;;kBAE7C,CAAC;AACZ,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2CAA2C,CAAC,CAAC;AAEhH,eAAO,MAAM,iDAAiD;;;kBAEnD,CAAC;AACZ,MAAM,MAAM,2CAA2C,GAAG,CAAC,CAAC,KAAK,CAC/D,OAAO,iDAAiD,CACzD,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;CAGgB,CAAC;AAEjE,MAAM,MAAM,+BAA+B,GAAG;KAC3C,CAAC,IAAI,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,mCAAmC,CAAC,CAAC,CAAC,CAAC,CAAC;CACvF,CAAC;AAEF,0DAA0D;AAC1D,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAEnG;AAQD,eAAO,MAAM,6BAA6B;;;;;;;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,CAAC,CAAC,OAAO,mCAAmC,CAAC,CAAC,CAAC,CAAC,CAAC;CACvF,CAAC;AAEF,0DAA0D;AAC1D,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAEnG;AAQD,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;iBAWmD,CAAC;AAC9F,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAIpF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAazC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,iCAAiC;;;;iBAK5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAS5F,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BnC,CAAC;AACL,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAM9E,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;iBAuB1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
|
|
@@ -119,6 +119,10 @@ export const NotificationArchiveAllJobSchema = z.object({
|
|
|
119
119
|
// Moves on every claim, so an overlapping run that claimed an older revision cannot settle the job.
|
|
120
120
|
revision: countSchema,
|
|
121
121
|
archived: countSchema,
|
|
122
|
+
// The cards the COMPLETING drain could not archive — each failed on its own and is still in the
|
|
123
|
+
// list. Set (never summed) when the job completes, because that drain walked the whole active set
|
|
124
|
+
// once. Optional, never defaulted: absent until a job completes with cards left behind, read as 0.
|
|
125
|
+
notArchived: countSchema.optional(),
|
|
122
126
|
error: z.string().nullable(),
|
|
123
127
|
attemptCount: countSchema,
|
|
124
128
|
nextAttemptAt: epochMsSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-notifications.js","sourceRoot":"","sources":["../../src/doc-schemas/admin-notifications.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,sGAAsG;AACtG,mBAAmB;AACnB,EAAE;AACF,yFAAyF;AACzF,oGAAoG;AACpG,kGAAkG;AAClG,mGAAmG;AACnG,mGAAmG;AACnG,EAAE;AACF,oGAAoG;AACpG,+EAA+E;AAE/E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,uCAAuC,EACvC,qCAAqC,EACrC,sCAAsC,EACtC,gCAAgC,EAChC,uCAAuC,EACvC,kCAAkC,GACnC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpG,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;AAEhF,oGAAoG;AACpG,uCAAuC;AACvC,MAAM,CAAC,MAAM,2CAA2C,GAAG,CAAC;KACzD,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;KAC1D,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,iDAAiD,GAAG,CAAC;KAC/D,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;KAC1D,MAAM,EAAE,CAAC;AAKZ,MAAM,C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IACtD,oGAAoG;IACpG,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,WAAW;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,YAAY,EAAE,WAAW;IACzB,aAAa,EAAE,aAAa;IAC5B,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE;IACzB,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;IACxB,WAAW,EAAE,aAAa,CAAC,QAAQ,EAAE;IACrC,cAAc,EAAE,aAAa,CAAC,QAAQ,EAAE;IACxC,QAAQ,EAAE,wBAAwB,CAAC,QAAQ,EAAE;CAC9C,CAAC,CAAC","sourcesContent":["// The admin notification documents: the shared cards, their archived history, the delivery ledger\n// the owning callables write occurrences into, and the archive-all jobs. Every one is written only by\n// Cloud Functions.\n//\n// notification-core owns the generic card shape, so the card schema is composed from its\n// `NotificationDocSchema` and narrowed to Q-Sports' one shared category and its notification types.\n// The history, ledger, and job documents are written by notification-core's server helpers and by\n// the functions around them; their schemas are declared here because the package exports no schema\n// for them. A card, a history entry, and a ledger row each hold ids only, never a name (ARCH-103).\n//\n// `expireAt` is the one Firestore `Timestamp` any of them holds: a native-TTL policy honours only a\n// real Timestamp, and nothing reads the field for display or order (ARCH-105).\n\nimport { z } from 'zod';\nimport { NotificationDocSchema } from '@ttt-productions/notification-core';\nimport {\n ADMIN_NOTIFICATION_CATEGORY,\n ADMIN_NOTIFICATION_TYPE_KEYS,\n NOTIFICATION_ARCHIVE_ALL_JOB_STATE_KEYS,\n NOTIFICATION_DELIVERY_PAYLOAD_VERSION,\n NOTIFICATION_DELIVERY_SKIP_REASON_KEYS,\n NOTIFICATION_DELIVERY_STATE_KEYS,\n NOTIFICATION_MATERIALIZATION_CLASS_KEYS,\n SHARED_NOTIFICATION_AUDIENCE_SCOPE,\n} from '../types/notifications.js';\nimport type { AdminNotificationType } from '../types/notifications.js';\nimport { countSchema, epochMsSchema, leagueIdSchema, teamIdSchema, userIdSchema } from './atoms.js';\nimport { FirestoreTimestampSchema } from './firestore-primitives.js';\n\nexport const adminNotificationTypeSchema = z.enum(ADMIN_NOTIFICATION_TYPE_KEYS);\n\n// What each type's card and ledger row name, by id. The card's title, link, and every name it shows\n// are derived from these at read time.\nexport const LeagueTeamCreatedNotificationMetadataSchema = z\n .object({ leagueId: leagueIdSchema, teamId: teamIdSchema })\n .strict();\nexport type LeagueTeamCreatedNotificationMetadata = z.infer<typeof LeagueTeamCreatedNotificationMetadataSchema>;\n\nexport const LeagueFreeAgentSignedUpNotificationMetadataSchema = z\n .object({ leagueId: leagueIdSchema, userId: userIdSchema })\n .strict();\nexport type LeagueFreeAgentSignedUpNotificationMetadata = z.infer<\n typeof LeagueFreeAgentSignedUpNotificationMetadataSchema\n>;\n\nexport const ADMIN_NOTIFICATION_METADATA_SCHEMAS = {\n leagueTeamCreated: LeagueTeamCreatedNotificationMetadataSchema,\n leagueFreeAgentSignedUp: LeagueFreeAgentSignedUpNotificationMetadataSchema,\n} as const satisfies Record<AdminNotificationType, z.ZodTypeAny>;\n\nexport type AdminNotificationMetadataByType = {\n [T in AdminNotificationType]: z.infer<(typeof ADMIN_NOTIFICATION_METADATA_SCHEMAS)[T]>;\n};\n\n/** Whether `metadata` is the metadata `type` declares. */\nexport function isAdminNotificationMetadata(type: AdminNotificationType, metadata: unknown): boolean {\n return ADMIN_NOTIFICATION_METADATA_SCHEMAS[type].safeParse(metadata).success;\n}\n\nconst METADATA_MISMATCH = { message: \"The metadata is not the notification type's.\", path: ['metadata'] };\n\n// activeAdminNotifications/{notificationId} — one shared card, as notification-core stores it. The id\n// is notification-core's, hashed from the type and the aggregation key, and is not a field: a reader\n// is handed it beside the document. `seenAt` is the package's field: a shared card has no seen state,\n// so no admin marks it and it stays 0.\nexport const ActiveAdminNotificationSchema = NotificationDocSchema.omit({ id: true })\n .extend({\n type: adminNotificationTypeSchema,\n category: z.literal(ADMIN_NOTIFICATION_CATEGORY),\n targetUserId: z.null(),\n count: countSchema,\n latestActorIds: z.array(userIdSchema),\n seenAt: epochMsSchema,\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n })\n .refine((card) => isAdminNotificationMetadata(card.type, card.metadata), METADATA_MISMATCH);\nexport type ActiveAdminNotification = z.infer<typeof ActiveAdminNotificationSchema>;\n\n// adminNotificationHistory/{historyId} — an archived card: the card as it stood when archived, kept\n// whole under `archivedSnapshot`, with who archived it and the archive's replay facts.\nexport const AdminNotificationHistorySchema = z.object({\n archiveOccurrenceId: z.string().min(1),\n requestId: z.string().min(1),\n // The archive's replay key: the card and the generation the archiving admin saw.\n payloadHash: z.string().min(1),\n activeId: z.string().min(1),\n observedActivityGeneration: z.string().min(1),\n category: z.literal(ADMIN_NOTIFICATION_CATEGORY),\n audienceScope: z.literal(SHARED_NOTIFICATION_AUDIENCE_SCOPE),\n archivedSnapshot: ActiveAdminNotificationSchema,\n archivedAt: epochMsSchema,\n expireAt: FirestoreTimestampSchema,\n handledBy: userIdSchema,\n});\nexport type AdminNotificationHistory = z.infer<typeof AdminNotificationHistorySchema>;\n\nexport const NotificationDeliveryPayloadSchema = z.object({\n // Who did what the occurrence records; null for an occurrence with no acting account.\n actorId: userIdSchema.nullable(),\n metadata: z.record(z.string(), z.unknown()),\n occurrenceAt: epochMsSchema,\n});\nexport type NotificationDeliveryPayload = z.infer<typeof NotificationDeliveryPayloadSchema>;\n\n// notificationDeliveries/{deliveryId} — one occurrence: the queue row the worker materializes and the\n// record that it happened, in one document, so the occurrence and its delivery cannot come apart.\n// Written in the owning callable's own transaction. A queued or dead-lettered row never expires:\n// notification-core sets `expireAt` only when the row materializes or is skipped, and an admin's\n// replay of a dead-lettered row sets it back to null. A row is skipped only when it names a recipient\n// who may no longer receive, which no Q-Sports row does; the skip's fields are declared because the\n// package writes them.\nexport const NotificationDeliverySchema = z\n .object({\n deliveryId: z.string().min(1),\n state: z.enum(NOTIFICATION_DELIVERY_STATE_KEYS),\n notificationType: adminNotificationTypeSchema,\n eventId: z.string().min(1),\n // Every Q-Sports notification is shared, so no row names a recipient.\n recipientUid: z.null(),\n aggregationKey: z.string().min(1),\n strategy: z.literal('increment'),\n payload: NotificationDeliveryPayloadSchema,\n payloadVersion: z.literal(NOTIFICATION_DELIVERY_PAYLOAD_VERSION),\n materializationClass: z.enum(NOTIFICATION_MATERIALIZATION_CLASS_KEYS),\n createdAt: epochMsSchema,\n attemptCount: countSchema,\n nextAttemptAt: epochMsSchema,\n lastError: z.string().nullable(),\n materializedAt: epochMsSchema.nullable(),\n deadLetteredAt: epochMsSchema.nullable(),\n skipReason: z.enum(NOTIFICATION_DELIVERY_SKIP_REASON_KEYS).optional(),\n skippedAt: epochMsSchema.optional(),\n expireAt: FirestoreTimestampSchema.nullable().optional(),\n })\n .refine((row) => isAdminNotificationMetadata(row.notificationType, row.payload.metadata), {\n message: METADATA_MISMATCH.message,\n path: ['payload', 'metadata'],\n });\nexport type NotificationDelivery = z.infer<typeof NotificationDeliverySchema>;\n\n// notificationArchiveAllJobs/{jobId} — one admin's \"archive all\": the server drains every active card\n// in pages until none is left, whether or not that admin's browser is still open. Backend-only: the\n// admin learns its state through the status callable. A completed job expires; one that is still\n// running, stopped short, or failed never does.\nexport const NotificationArchiveAllJobSchema = z.object({\n jobId: z.string().min(1),\n // The admin who asked. Each card the job archives is recorded as archived by them; the event the\n // request wrote when the job was created carries the request's origin (BACKEND-211).\n userId: userIdSchema,\n category: z.literal(ADMIN_NOTIFICATION_CATEGORY),\n state: z.enum(NOTIFICATION_ARCHIVE_ALL_JOB_STATE_KEYS),\n // Moves on every claim, so an overlapping run that claimed an older revision cannot settle the job.\n revision: countSchema,\n archived: countSchema,\n error: z.string().nullable(),\n attemptCount: countSchema,\n nextAttemptAt: epochMsSchema,\n deadLettered: z.boolean(),\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n completedAt: epochMsSchema.nullable(),\n deadLetteredAt: epochMsSchema.nullable(),\n expireAt: FirestoreTimestampSchema.optional(),\n});\nexport type NotificationArchiveAllJob = z.infer<typeof NotificationArchiveAllJobSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"admin-notifications.js","sourceRoot":"","sources":["../../src/doc-schemas/admin-notifications.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,sGAAsG;AACtG,mBAAmB;AACnB,EAAE;AACF,yFAAyF;AACzF,oGAAoG;AACpG,kGAAkG;AAClG,mGAAmG;AACnG,mGAAmG;AACnG,EAAE;AACF,oGAAoG;AACpG,+EAA+E;AAE/E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,uCAAuC,EACvC,qCAAqC,EACrC,sCAAsC,EACtC,gCAAgC,EAChC,uCAAuC,EACvC,kCAAkC,GACnC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpG,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;AAEhF,oGAAoG;AACpG,uCAAuC;AACvC,MAAM,CAAC,MAAM,2CAA2C,GAAG,CAAC;KACzD,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;KAC1D,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,iDAAiD,GAAG,CAAC;KAC/D,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;KAC1D,MAAM,EAAE,CAAC;AAKZ,MAAM,CAAC,MAAM,mCAAmC,GAAG;IACjD,iBAAiB,EAAE,2CAA2C;IAC9D,uBAAuB,EAAE,iDAAiD;CACZ,C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G;IAClG,mGAAmG;IACnG,WAAW,EAAE,WAAW,CAAC,QAAQ,EAAE;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,YAAY,EAAE,WAAW;IACzB,aAAa,EAAE,aAAa;IAC5B,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE;IACzB,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;IACxB,WAAW,EAAE,aAAa,CAAC,QAAQ,EAAE;IACrC,cAAc,EAAE,aAAa,CAAC,QAAQ,EAAE;IACxC,QAAQ,EAAE,wBAAwB,CAAC,QAAQ,EAAE;CAC9C,CAAC,CAAC","sourcesContent":["// The admin notification documents: the shared cards, their archived history, the delivery ledger\n// the owning callables write occurrences into, and the archive-all jobs. Every one is written only by\n// Cloud Functions.\n//\n// notification-core owns the generic card shape, so the card schema is composed from its\n// `NotificationDocSchema` and narrowed to Q-Sports' one shared category and its notification types.\n// The history, ledger, and job documents are written by notification-core's server helpers and by\n// the functions around them; their schemas are declared here because the package exports no schema\n// for them. A card, a history entry, and a ledger row each hold ids only, never a name (ARCH-103).\n//\n// `expireAt` is the one Firestore `Timestamp` any of them holds: a native-TTL policy honours only a\n// real Timestamp, and nothing reads the field for display or order (ARCH-105).\n\nimport { z } from 'zod';\nimport { NotificationDocSchema } from '@ttt-productions/notification-core';\nimport {\n ADMIN_NOTIFICATION_CATEGORY,\n ADMIN_NOTIFICATION_TYPE_KEYS,\n NOTIFICATION_ARCHIVE_ALL_JOB_STATE_KEYS,\n NOTIFICATION_DELIVERY_PAYLOAD_VERSION,\n NOTIFICATION_DELIVERY_SKIP_REASON_KEYS,\n NOTIFICATION_DELIVERY_STATE_KEYS,\n NOTIFICATION_MATERIALIZATION_CLASS_KEYS,\n SHARED_NOTIFICATION_AUDIENCE_SCOPE,\n} from '../types/notifications.js';\nimport type { AdminNotificationType } from '../types/notifications.js';\nimport { countSchema, epochMsSchema, leagueIdSchema, teamIdSchema, userIdSchema } from './atoms.js';\nimport { FirestoreTimestampSchema } from './firestore-primitives.js';\n\nexport const adminNotificationTypeSchema = z.enum(ADMIN_NOTIFICATION_TYPE_KEYS);\n\n// What each type's card and ledger row name, by id. The card's title, link, and every name it shows\n// are derived from these at read time.\nexport const LeagueTeamCreatedNotificationMetadataSchema = z\n .object({ leagueId: leagueIdSchema, teamId: teamIdSchema })\n .strict();\nexport type LeagueTeamCreatedNotificationMetadata = z.infer<typeof LeagueTeamCreatedNotificationMetadataSchema>;\n\nexport const LeagueFreeAgentSignedUpNotificationMetadataSchema = z\n .object({ leagueId: leagueIdSchema, userId: userIdSchema })\n .strict();\nexport type LeagueFreeAgentSignedUpNotificationMetadata = z.infer<\n typeof LeagueFreeAgentSignedUpNotificationMetadataSchema\n>;\n\nexport const ADMIN_NOTIFICATION_METADATA_SCHEMAS = {\n leagueTeamCreated: LeagueTeamCreatedNotificationMetadataSchema,\n leagueFreeAgentSignedUp: LeagueFreeAgentSignedUpNotificationMetadataSchema,\n} as const satisfies Record<AdminNotificationType, z.ZodTypeAny>;\n\nexport type AdminNotificationMetadataByType = {\n [T in AdminNotificationType]: z.infer<(typeof ADMIN_NOTIFICATION_METADATA_SCHEMAS)[T]>;\n};\n\n/** Whether `metadata` is the metadata `type` declares. */\nexport function isAdminNotificationMetadata(type: AdminNotificationType, metadata: unknown): boolean {\n return ADMIN_NOTIFICATION_METADATA_SCHEMAS[type].safeParse(metadata).success;\n}\n\nconst METADATA_MISMATCH = { message: \"The metadata is not the notification type's.\", path: ['metadata'] };\n\n// activeAdminNotifications/{notificationId} — one shared card, as notification-core stores it. The id\n// is notification-core's, hashed from the type and the aggregation key, and is not a field: a reader\n// is handed it beside the document. `seenAt` is the package's field: a shared card has no seen state,\n// so no admin marks it and it stays 0.\nexport const ActiveAdminNotificationSchema = NotificationDocSchema.omit({ id: true })\n .extend({\n type: adminNotificationTypeSchema,\n category: z.literal(ADMIN_NOTIFICATION_CATEGORY),\n targetUserId: z.null(),\n count: countSchema,\n latestActorIds: z.array(userIdSchema),\n seenAt: epochMsSchema,\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n })\n .refine((card) => isAdminNotificationMetadata(card.type, card.metadata), METADATA_MISMATCH);\nexport type ActiveAdminNotification = z.infer<typeof ActiveAdminNotificationSchema>;\n\n// adminNotificationHistory/{historyId} — an archived card: the card as it stood when archived, kept\n// whole under `archivedSnapshot`, with who archived it and the archive's replay facts.\nexport const AdminNotificationHistorySchema = z.object({\n archiveOccurrenceId: z.string().min(1),\n requestId: z.string().min(1),\n // The archive's replay key: the card and the generation the archiving admin saw.\n payloadHash: z.string().min(1),\n activeId: z.string().min(1),\n observedActivityGeneration: z.string().min(1),\n category: z.literal(ADMIN_NOTIFICATION_CATEGORY),\n audienceScope: z.literal(SHARED_NOTIFICATION_AUDIENCE_SCOPE),\n archivedSnapshot: ActiveAdminNotificationSchema,\n archivedAt: epochMsSchema,\n expireAt: FirestoreTimestampSchema,\n handledBy: userIdSchema,\n});\nexport type AdminNotificationHistory = z.infer<typeof AdminNotificationHistorySchema>;\n\nexport const NotificationDeliveryPayloadSchema = z.object({\n // Who did what the occurrence records; null for an occurrence with no acting account.\n actorId: userIdSchema.nullable(),\n metadata: z.record(z.string(), z.unknown()),\n occurrenceAt: epochMsSchema,\n});\nexport type NotificationDeliveryPayload = z.infer<typeof NotificationDeliveryPayloadSchema>;\n\n// notificationDeliveries/{deliveryId} — one occurrence: the queue row the worker materializes and the\n// record that it happened, in one document, so the occurrence and its delivery cannot come apart.\n// Written in the owning callable's own transaction. A queued or dead-lettered row never expires:\n// notification-core sets `expireAt` only when the row materializes or is skipped, and an admin's\n// replay of a dead-lettered row sets it back to null. A row is skipped only when it names a recipient\n// who may no longer receive, which no Q-Sports row does; the skip's fields are declared because the\n// package writes them.\nexport const NotificationDeliverySchema = z\n .object({\n deliveryId: z.string().min(1),\n state: z.enum(NOTIFICATION_DELIVERY_STATE_KEYS),\n notificationType: adminNotificationTypeSchema,\n eventId: z.string().min(1),\n // Every Q-Sports notification is shared, so no row names a recipient.\n recipientUid: z.null(),\n aggregationKey: z.string().min(1),\n strategy: z.literal('increment'),\n payload: NotificationDeliveryPayloadSchema,\n payloadVersion: z.literal(NOTIFICATION_DELIVERY_PAYLOAD_VERSION),\n materializationClass: z.enum(NOTIFICATION_MATERIALIZATION_CLASS_KEYS),\n createdAt: epochMsSchema,\n attemptCount: countSchema,\n nextAttemptAt: epochMsSchema,\n lastError: z.string().nullable(),\n materializedAt: epochMsSchema.nullable(),\n deadLetteredAt: epochMsSchema.nullable(),\n skipReason: z.enum(NOTIFICATION_DELIVERY_SKIP_REASON_KEYS).optional(),\n skippedAt: epochMsSchema.optional(),\n expireAt: FirestoreTimestampSchema.nullable().optional(),\n })\n .refine((row) => isAdminNotificationMetadata(row.notificationType, row.payload.metadata), {\n message: METADATA_MISMATCH.message,\n path: ['payload', 'metadata'],\n });\nexport type NotificationDelivery = z.infer<typeof NotificationDeliverySchema>;\n\n// notificationArchiveAllJobs/{jobId} — one admin's \"archive all\": the server drains every active card\n// in pages until none is left, whether or not that admin's browser is still open. Backend-only: the\n// admin learns its state through the status callable. A completed job expires; one that is still\n// running, stopped short, or failed never does.\nexport const NotificationArchiveAllJobSchema = z.object({\n jobId: z.string().min(1),\n // The admin who asked. Each card the job archives is recorded as archived by them; the event the\n // request wrote when the job was created carries the request's origin (BACKEND-211).\n userId: userIdSchema,\n category: z.literal(ADMIN_NOTIFICATION_CATEGORY),\n state: z.enum(NOTIFICATION_ARCHIVE_ALL_JOB_STATE_KEYS),\n // Moves on every claim, so an overlapping run that claimed an older revision cannot settle the job.\n revision: countSchema,\n archived: countSchema,\n // The cards the COMPLETING drain could not archive — each failed on its own and is still in the\n // list. Set (never summed) when the job completes, because that drain walked the whole active set\n // once. Optional, never defaulted: absent until a job completes with cards left behind, read as 0.\n notArchived: countSchema.optional(),\n error: z.string().nullable(),\n attemptCount: countSchema,\n nextAttemptAt: epochMsSchema,\n deadLettered: z.boolean(),\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n completedAt: epochMsSchema.nullable(),\n deadLetteredAt: epochMsSchema.nullable(),\n expireAt: FirestoreTimestampSchema.optional(),\n});\nexport type NotificationArchiveAllJob = z.infer<typeof NotificationArchiveAllJobSchema>;\n"]}
|
|
@@ -251,8 +251,10 @@ export declare const statsBeaconActionSchema: z.ZodEnum<{
|
|
|
251
251
|
link: "link";
|
|
252
252
|
}>;
|
|
253
253
|
export declare const statsDiscrepancyKindSchema: z.ZodEnum<{
|
|
254
|
+
gameUnreadable: "gameUnreadable";
|
|
254
255
|
invalidEvent: "invalidEvent";
|
|
255
256
|
eventSequenceMismatch: "eventSequenceMismatch";
|
|
257
|
+
eventSequenceGap: "eventSequenceGap";
|
|
256
258
|
rollupMismatch: "rollupMismatch";
|
|
257
259
|
scoreMirrorMismatch: "scoreMirrorMismatch";
|
|
258
260
|
unrosteredStatLine: "unrosteredStatLine";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atoms.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/atoms.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAoB,KAAK,mBAAmB,EAAE,KAAK,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAgCvH,eAAO,MAAM,aAAa,aAAiC,CAAC;AAG5D,eAAO,MAAM,WAAW,aAAiC,CAAC;AAG1D,eAAO,MAAM,cAAc,aAA8B,CAAC;AAG1D,eAAO,MAAM,qBAAqB,aAAiC,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAC9C,MAAM,CAAC,gBAAgB,EAAE,CAAC,WAAW,EAAE,mBAAmB,KAAK,MAAM,CAAC,CAKvE,CAAC;AAEF;;;;;GAKG;AACH,8EAA8E;AAC9E,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AAEvD,MAAM,MAAM,eAAe,GACvB;IAAE,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AAC;AACrD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAyB,CAAC;AACrD,eAAO,MAAM,cAAc;;;;EAAyB,CAAC;AACrD,eAAO,MAAM,gBAAgB;;;EAA2B,CAAC;AACzD,eAAO,MAAM,gBAAgB;;;EAA2B,CAAC;AACzD,eAAO,MAAM,0BAA0B;;EAAsC,CAAC;AAC9E,eAAO,MAAM,oBAAoB;;;;;;EAAgC,CAAC;AAClE,eAAO,MAAM,gBAAgB;;;;EAA2B,CAAC;AACzD,eAAO,MAAM,0BAA0B;;;;;EAAsC,CAAC;AAC9E,eAAO,MAAM,2BAA2B;;;;;EAAwC,CAAC;AACjF,eAAO,MAAM,gCAAgC;;;;EAA6C,CAAC;AAC3F,eAAO,MAAM,gCAAgC;;;;EAA6C,CAAC;AAC3F,eAAO,MAAM,4BAA4B;;;;;EAAwC,CAAC;AAClF,eAAO,MAAM,uBAAuB;;;;;;;EAAmC,CAAC;AACxE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;EAAsC,CAAC;AAC9E,eAAO,MAAM,2BAA2B;;;;EAAoC,CAAC;AAC7E,eAAO,MAAM,oBAAoB;;;;;;EAA4B,CAAC"}
|
|
@@ -82,6 +82,7 @@ export declare const auditEventTypeSchema: z.ZodEnum<{
|
|
|
82
82
|
"adminNotification.archiveAllRequested": "adminNotification.archiveAllRequested";
|
|
83
83
|
"system.manualIntervention": "system.manualIntervention";
|
|
84
84
|
"migrationAction.pageRun": "migrationAction.pageRun";
|
|
85
|
+
"migrationAction.writesCommitted": "migrationAction.writesCommitted";
|
|
85
86
|
"migrationAction.controlRecorded": "migrationAction.controlRecorded";
|
|
86
87
|
"migrationAction.checkpointRecorded": "migrationAction.checkpointRecorded";
|
|
87
88
|
"migrationConsole.cutoverRecorded": "migrationConsole.cutoverRecorded";
|
|
@@ -195,6 +196,7 @@ export declare const AuditEventSchema: z.ZodObject<{
|
|
|
195
196
|
"adminNotification.archiveAllRequested": "adminNotification.archiveAllRequested";
|
|
196
197
|
"system.manualIntervention": "system.manualIntervention";
|
|
197
198
|
"migrationAction.pageRun": "migrationAction.pageRun";
|
|
199
|
+
"migrationAction.writesCommitted": "migrationAction.writesCommitted";
|
|
198
200
|
"migrationAction.controlRecorded": "migrationAction.controlRecorded";
|
|
199
201
|
"migrationAction.checkpointRecorded": "migrationAction.checkpointRecorded";
|
|
200
202
|
"migrationConsole.cutoverRecorded": "migrationConsole.cutoverRecorded";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-event.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/audit-event.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"audit-event.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/audit-event.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAgC,CAAC;AAElE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;iCAY3B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAe3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -20,6 +20,7 @@ export declare const GalleryPictureSchema: z.ZodObject<{
|
|
|
20
20
|
}>;
|
|
21
21
|
ownerId: z.ZodString;
|
|
22
22
|
position: z.ZodString;
|
|
23
|
+
sourceIndex: z.ZodOptional<z.ZodNumber>;
|
|
23
24
|
createdAt: z.ZodNumber;
|
|
24
25
|
}, z.core.$strip>;
|
|
25
26
|
export type GalleryPicture = z.infer<typeof GalleryPictureSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/gallery.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,sBAAsB;;;;;;EAAkC,CAAC;AACtE,eAAO,MAAM,sBAAsB;;;;EAAkC,CAAC;AAGtE,eAAO,MAAM,eAAe,aAAkB,CAAC;AAE/C,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/gallery.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,sBAAsB;;;;;;EAAkC,CAAC;AACtE,eAAO,MAAM,sBAAsB;;;;EAAkC,CAAC;AAGtE,eAAO,MAAM,eAAe,aAAkB,CAAC;AAE/C,eAAO,MAAM,oBAAoB;;;;;;;;;;iBAW/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,oBAAoB;;;;iBAW7B,CAAC;AACL,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -19,6 +19,9 @@ export const GalleryPictureSchema = z.object({
|
|
|
19
19
|
// A fractional sort key: a move rewrites only the moved picture's key, strictly between its new
|
|
20
20
|
// neighbours, and a gallery's first page is read ordered by it.
|
|
21
21
|
position: z.string().min(1),
|
|
22
|
+
// Set only on a picture the migration carried from V1: its position in the V1 source list, which
|
|
23
|
+
// places a later-finishing carried picture among its carried neighbours in V1's order.
|
|
24
|
+
sourceIndex: countSchema.optional(),
|
|
22
25
|
createdAt: epochMsSchema,
|
|
23
26
|
});
|
|
24
27
|
export const GallerySummarySchema = z
|
|
@@ -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,gEAAgE;IAChE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,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,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,KAAK,SAAS,CAAC,EAAE;IACtF,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 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
|
+
{"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,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,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,KAAK,SAAS,CAAC,EAAE;IACtF,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"]}
|
|
@@ -415,6 +415,7 @@ export declare const MigrationConsoleLockSchema: z.ZodObject<{
|
|
|
415
415
|
operationId: z.ZodString;
|
|
416
416
|
heldByUserId: z.ZodString;
|
|
417
417
|
expiresAt: z.ZodNumber;
|
|
418
|
+
pageClaimedAt: z.ZodOptional<z.ZodNumber>;
|
|
418
419
|
}, z.core.$strict>;
|
|
419
420
|
export type MigrationConsoleLock = z.infer<typeof MigrationConsoleLockSchema>;
|
|
420
421
|
export declare const MigrationConsoleSchema: z.ZodObject<{
|
|
@@ -514,6 +515,7 @@ export declare const MigrationConsoleSchema: z.ZodObject<{
|
|
|
514
515
|
operationId: z.ZodString;
|
|
515
516
|
heldByUserId: z.ZodString;
|
|
516
517
|
expiresAt: z.ZodNumber;
|
|
518
|
+
pageClaimedAt: z.ZodOptional<z.ZodNumber>;
|
|
517
519
|
}, z.core.$strict>>;
|
|
518
520
|
updatedAt: z.ZodNumber;
|
|
519
521
|
}, z.core.$strict>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-console.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/migration-console.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,oEAAoE;AACpE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAUrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAMjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -86,6 +86,11 @@ export const MigrationConsoleLockSchema = z.strictObject({
|
|
|
86
86
|
operationId: migrationOperationIdSchema,
|
|
87
87
|
heldByUserId: userIdSchema,
|
|
88
88
|
expiresAt: epochMsSchema,
|
|
89
|
+
// Present while one page of the run is in flight: the moment its claim was stamped, and that
|
|
90
|
+
// page's fencing token. Only the page holding this exact token records its result or releases the
|
|
91
|
+
// lock; any other page, the same run's included, is refused while it stands. A lock stored
|
|
92
|
+
// without one has no page in flight.
|
|
93
|
+
pageClaimedAt: epochMsSchema.optional(),
|
|
89
94
|
});
|
|
90
95
|
export const MigrationConsoleSchema = z.strictObject({
|
|
91
96
|
destinationState: migrationDestinationStateSchema,
|
|
@@ -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;AAC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B,SAAS,EAAE,aAAa;IACxB,6FAA6F;IAC7F,kGAAkG;IAClG,2FAA2F;IAC3F,qCAAqC;IACrC,aAAa,EAAE,aAAa,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAAC;IACnD,gBAAgB,EAAE,+BAA+B;IACjD,iBAAiB,EAAE,aAAa,CAAC,QAAQ,EAAE;IAC3C,uBAAuB,EAAE,YAAY,CAAC,QAAQ,EAAE;IAChD,IAAI,EAAE,0BAA0B,CAAC,QAAQ,EAAE;IAC3C,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC","sourcesContent":["// 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/index.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"]}
|
|
@@ -46,6 +46,7 @@ export declare const PendingMediaTargetSchema: z.ZodObject<{
|
|
|
46
46
|
bucket: z.ZodString;
|
|
47
47
|
path: z.ZodString;
|
|
48
48
|
}, z.core.$strict>>;
|
|
49
|
+
sourceIndex: z.ZodOptional<z.ZodNumber>;
|
|
49
50
|
newAwardName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
50
51
|
}, z.core.$strict>;
|
|
51
52
|
export type PendingMediaTarget = z.infer<typeof PendingMediaTargetSchema>;
|
|
@@ -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;
|
|
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;;;;;;;;;kBAEvB,CAAC;AACZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;kBAqBjC,CAAC;AACL,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAO1E,eAAO,MAAM,+BAA+B;;;;;;;EAA0C,CAAC;AACvF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAA6B,CAAC;AAE7D,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AACxF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -11,6 +11,7 @@ import { createPendingMediaSchemas } from '@ttt-productions/media-schemas';
|
|
|
11
11
|
import { DomainEventSchema } from '../domain-events/domain-events.js';
|
|
12
12
|
import { FILE_ORIGIN_KEYS, PICTURE_ORIGIN_KEYS } from '../media/file-origins.js';
|
|
13
13
|
import { AWARD_DEFINITION_OWNER_KIND } from '../types/picture-owners.js';
|
|
14
|
+
import { countSchema } from './atoms.js';
|
|
14
15
|
import { awardNameSchema } from './catalogs.js';
|
|
15
16
|
import { pictureOwnerKindSchema } from './gallery.js';
|
|
16
17
|
export const fileOriginSchema = z.enum(FILE_ORIGIN_KEYS);
|
|
@@ -30,6 +31,9 @@ export const PendingMediaTargetSchema = z
|
|
|
30
31
|
// The object a carried picture was read from. Written only by the migration console's picture
|
|
31
32
|
// carry, never from a callable's input; a carried picture fills only an empty slot.
|
|
32
33
|
carriedFrom: StorageObjectRefSchema.optional(),
|
|
34
|
+
// A carried picture's position in its V1 source list, so the carried gallery keeps V1's order
|
|
35
|
+
// and V1's first image stays the featured one. Only beside `carriedFrom`.
|
|
36
|
+
sourceIndex: countSchema.optional(),
|
|
33
37
|
// A badge upload that creates its award: the award's name, which the publication writes with
|
|
34
38
|
// the award. The owner's id is then the upload's staging id.
|
|
35
39
|
newAwardName: awardNameSchema.optional(),
|
|
@@ -38,6 +42,10 @@ export const PendingMediaTargetSchema = z
|
|
|
38
42
|
.refine((target) => target.newAwardName === undefined || target.owner.kind === AWARD_DEFINITION_OWNER_KIND, {
|
|
39
43
|
message: 'Only a badge upload creates an award.',
|
|
40
44
|
path: ['newAwardName'],
|
|
45
|
+
})
|
|
46
|
+
.refine((target) => target.sourceIndex === undefined || target.carriedFrom !== undefined, {
|
|
47
|
+
message: 'Only a carried picture has a source position.',
|
|
48
|
+
path: ['sourceIndex'],
|
|
41
49
|
});
|
|
42
50
|
const schemas = createPendingMediaSchemas({
|
|
43
51
|
fileOriginSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending-media.js","sourceRoot":"","sources":["../../src/doc-schemas/pending-media.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,iGAAiG;AACjG,gFAAgF;AAChF,EAAE;AACF,kGAAkG;AAClG,+FAA+F;AAC/F,8FAA8F;AAC9F,wFAAwF;AAExF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE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AC,IAAI,KAAK,2BAA2B,EAAE;IAC1G,OAAO,EAAE,uCAAuC;IAChD,IAAI,EAAE,CAAC,cAAc,CAAC;CACvB,CAAC,CAAC;AAGL,MAAM,OAAO,GAAG,yBAAyB,CAAC;IACxC,gBAAgB;IAChB,iBAAiB,EAAE,iBAAiB;CACrC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,OAAO,CAAC,+BAA+B,CAAC;AACvF,MAAM,CAAC,MAAM,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACzE,MAAM,CAAC,MAAM,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAC3E,MAAM,CAAC,MAAM,4BAA4B,GAAG,OAAO,CAAC,4BAA4B,CAAC;AACjF,MAAM,CAAC,MAAM,2BAA2B,GAAG,OAAO,CAAC,2BAA2B,CAAC;AAC/E,MAAM,CAAC,MAAM,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACzE,MAAM,CAAC,MAAM,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 { 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 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((target) => target.newAwardName === undefined || target.owner.kind === AWARD_DEFINITION_OWNER_KIND, {\n message: 'Only a badge upload creates an award.',\n path: ['newAwardName'],\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
|
+
{"version":3,"file":"pending-media.js","sourceRoot":"","sources":["../../src/doc-schemas/pending-media.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,iGAAiG;AACjG,gFAAgF;AAChF,EAAE;AACF,kGAAkG;AAClG,+FAA+F;AAC/F,8FAA8F;AAC9F,wFAAwF;AAExF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AACzD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;AAE/D,oGAAoG;AACpG,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,OAAO,GAAG,yBAAyB,CAAC;IACxC,gBAAgB;IAChB,iBAAiB,EAAE,iBAAiB;CACrC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,OAAO,CAAC,+BAA+B,CAAC;AACvF,MAAM,CAAC,MAAM,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACzE,MAAM,CAAC,MAAM,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAC3E,MAAM,CAAC,MAAM,4BAA4B,GAAG,OAAO,CAAC,4BAA4B,CAAC;AACjF,MAAM,CAAC,MAAM,2BAA2B,GAAG,OAAO,CAAC,2BAA2B,CAAC;AAC/E,MAAM,CAAC,MAAM,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACzE,MAAM,CAAC,MAAM,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((target) => target.newAwardName === undefined || target.owner.kind === AWARD_DEFINITION_OWNER_KIND, {\n message: 'Only a badge upload creates an award.',\n path: ['newAwardName'],\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"]}
|