@ttt-productions/q-core 0.1.3 → 0.1.5
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 +40 -9
- package/dist/constants/business.d.ts.map +1 -1
- package/dist/constants/business.js +41 -20
- package/dist/constants/business.js.map +1 -1
- package/dist/constants/media.d.ts +2 -0
- package/dist/constants/media.d.ts.map +1 -1
- package/dist/constants/media.js +8 -0
- package/dist/constants/media.js.map +1 -1
- package/dist/constants/scheduled-jobs.d.ts +1 -1
- package/dist/constants/scheduled-jobs.d.ts.map +1 -1
- package/dist/constants/scheduled-jobs.js +7 -1
- package/dist/constants/scheduled-jobs.js.map +1 -1
- package/dist/doc-schemas/admin-notifications.d.ts +1 -1
- package/dist/doc-schemas/award-group-grant.d.ts +53 -0
- package/dist/doc-schemas/award-group-grant.d.ts.map +1 -0
- package/dist/doc-schemas/award-group-grant.js +63 -0
- package/dist/doc-schemas/award-group-grant.js.map +1 -0
- package/dist/doc-schemas/index.d.ts +1 -0
- package/dist/doc-schemas/index.d.ts.map +1 -1
- package/dist/doc-schemas/index.js +1 -0
- package/dist/doc-schemas/index.js.map +1 -1
- package/dist/doc-schemas/migration-console.d.ts +3 -3
- package/dist/doc-schemas/registry.d.ts +52 -12
- package/dist/doc-schemas/registry.d.ts.map +1 -1
- package/dist/doc-schemas/registry.js +5 -0
- package/dist/doc-schemas/registry.js.map +1 -1
- package/dist/doc-schemas/sport-league.d.ts +2 -0
- package/dist/doc-schemas/sport-league.d.ts.map +1 -1
- package/dist/doc-schemas/sport-league.js +9 -0
- package/dist/doc-schemas/sport-league.js.map +1 -1
- package/dist/doc-schemas/stats-operation.d.ts +18 -18
- package/dist/ids/award-grant-ids.d.ts +9 -0
- package/dist/ids/award-grant-ids.d.ts.map +1 -0
- package/dist/ids/award-grant-ids.js +17 -0
- package/dist/ids/award-grant-ids.js.map +1 -0
- package/dist/ids/index.d.ts +1 -0
- package/dist/ids/index.d.ts.map +1 -1
- package/dist/ids/index.js +1 -0
- package/dist/ids/index.js.map +1 -1
- package/dist/paths/collection-groups.d.ts +1 -0
- package/dist/paths/collection-groups.d.ts.map +1 -1
- package/dist/paths/collection-groups.js +3 -1
- package/dist/paths/collection-groups.js.map +1 -1
- package/dist/paths/collection-refs.d.ts +1 -0
- package/dist/paths/collection-refs.d.ts.map +1 -1
- package/dist/paths/collection-refs.js +1 -0
- package/dist/paths/collection-refs.js.map +1 -1
- package/dist/paths/collections.d.ts +5 -0
- package/dist/paths/collections.d.ts.map +1 -1
- package/dist/paths/collections.js +8 -0
- package/dist/paths/collections.js.map +1 -1
- package/dist/paths/path-builders.d.ts +3 -0
- package/dist/paths/path-builders.d.ts.map +1 -1
- package/dist/paths/path-builders.js +13 -1
- package/dist/paths/path-builders.js.map +1 -1
- package/dist/schemas/admin-notifications.d.ts +1 -1
- package/dist/schemas/awards.d.ts +94 -2
- package/dist/schemas/awards.d.ts.map +1 -1
- package/dist/schemas/awards.js +49 -9
- package/dist/schemas/awards.js.map +1 -1
- package/dist/schemas/leagues.d.ts +2 -2
- package/dist/schemas/migration-console.d.ts +7 -7
- package/dist/types/unions.d.ts +8 -0
- package/dist/types/unions.d.ts.map +1 -1
- package/dist/types/unions.js +12 -2
- package/dist/types/unions.js.map +1 -1
- package/package.json +1 -1
|
@@ -23,6 +23,7 @@ export const COLLECTION_REFS = {
|
|
|
23
23
|
signedWaivers: () => [COLLECTIONS.SIGNED_WAIVERS],
|
|
24
24
|
hardwareLoanContracts: () => [COLLECTIONS.HARDWARE_LOAN_CONTRACTS],
|
|
25
25
|
awardDefinitions: () => [COLLECTIONS.AWARD_DEFINITIONS],
|
|
26
|
+
awardGroupGrants: () => [COLLECTIONS.AWARD_GROUP_GRANTS],
|
|
26
27
|
statsValidationReports: () => [COLLECTIONS.STATS_VALIDATION_REPORTS],
|
|
27
28
|
statsOperations: () => [COLLECTIONS.STATS_OPERATIONS],
|
|
28
29
|
migrationActionRuns: () => [COLLEC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AC,WAAW,CAAC;IACrD,aAAa,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC;IAC3D,eAAe,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC;IAC/D,aAAa,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC;IAC3D,qBAAqB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,uBAAuB,CAAC;IAC5E,gBAAgB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,iBAAiB,CAAC;IACjE,sBAAsB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,wBAAwB,CAAC;IAC9E,eAAe,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC;IAC/D,mBAAmB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,qBAAqB,CAAC;IACxE,eAAe,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC;IAC/D,YAAY,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC;IACzD,kBAAkB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,mBAAmB,CAAC;IACrE,WAAW,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC;IACvD,wBAAwB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,0BAA0B,CAAC;IAClF,wBAAwB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,0BAA0B,CAAC;IAClF,sBAAsB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,uBAAuB,CAAC;IAC7E,0BAA0B,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,6BAA6B,CAAC;CAC/E,CAAC","sourcesContent":["// Collection reference builders — for collection-level operations.\n//\n// Frontend: collection(db, ...COLLECTION_REFS.userProfiles())\n// Backend: db.collection(toPath(COLLECTION_REFS.userProfiles()))\n\nimport { COLLECTIONS } from './collections.js';\n\nexport const COLLECTION_REFS = {\n userProfiles: (): [string] => [COLLECTIONS.USER_PROFILES],\n publicUsers: (): [string] => [COLLECTIONS.PUBLIC_USERS],\n statusReconcileQueue: (): [string] => [COLLECTIONS.STATUS_RECONCILE_QUEUE],\n registrationStarts: (): [string] => [COLLECTIONS.REGISTRATION_STARTS],\n reservedDisplayNames: (): [string] => [COLLECTIONS.RESERVED_DISPLAY_NAMES],\n sportLeagues: (): [string] => [COLLECTIONS.SPORT_LEAGUES],\n leagueTeams: (): [string] => [COLLECTIONS.LEAGUE_TEAMS],\n leagueTeamContacts: (): [string] => [COLLECTIONS.LEAGUE_TEAM_CONTACTS],\n teamMemberships: (): [string] => [COLLECTIONS.TEAM_MEMBERSHIPS],\n teamInvitations: (): [string] => [COLLECTIONS.TEAM_INVITATIONS],\n teamJoinRequests: (): [string] => [COLLECTIONS.TEAM_JOIN_REQUESTS],\n leagueFreeAgents: (): [string] => [COLLECTIONS.LEAGUE_FREE_AGENTS],\n membershipRosterSyncs: (): [string] => [COLLECTIONS.MEMBERSHIP_ROSTER_SYNCS],\n sportGames: (): [string] => [COLLECTIONS.SPORT_GAMES],\n gameLocations: (): [string] => [COLLECTIONS.GAME_LOCATIONS],\n waiverTemplates: (): [string] => [COLLECTIONS.WAIVER_TEMPLATES],\n signedWaivers: (): [string] => [COLLECTIONS.SIGNED_WAIVERS],\n hardwareLoanContracts: (): [string] => [COLLECTIONS.HARDWARE_LOAN_CONTRACTS],\n awardDefinitions: (): [string] => [COLLECTIONS.AWARD_DEFINITIONS],\n statsValidationReports: (): [string] => [COLLECTIONS.STATS_VALIDATION_REPORTS],\n statsOperations: (): [string] => [COLLECTIONS.STATS_OPERATIONS],\n migrationActionRuns: (): [string] => [COLLECTIONS.MIGRATION_ACTION_RUNS],\n galleryPictures: (): [string] => [COLLECTIONS.GALLERY_PICTURES],\n pendingMedia: (): [string] => [COLLECTIONS.PENDING_MEDIA],\n pictureRetirements: (): [string] => [COLLECTIONS.PICTURE_RETIREMENTS],\n auditEvents: (): [string] => [COLLECTIONS.AUDIT_EVENTS],\n activeAdminNotifications: (): [string] => [COLLECTIONS.ACTIVE_ADMIN_NOTIFICATIONS],\n adminNotificationHistory: (): [string] => [COLLECTIONS.ADMIN_NOTIFICATION_HISTORY],\n notificationDeliveries: (): [string] => [COLLECTIONS.NOTIFICATION_DELIVERIES],\n notificationArchiveAllJobs: (): [string] => [COLLECTIONS.NOTIFICATION_ARCHIVE_ALL_JOBS],\n} as const;\n"]}
|
|
1
|
+
{"version":3,"file":"collection-refs.js","sourceRoot":"","sources":["../../src/paths/collection-refs.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,EAAE;AACF,8DAA8D;AAC9D,kEAAkE;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,YAAY,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC;IACzD,WAAW,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC;IACvD,oBAAoB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,sBAAsB,CAAC;IAC1E,kBAAkB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,mBAAmB,CAAC;IACrE,oBAAoB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,sBAAsB,CAAC;IAC1E,YAAY,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC;IACzD,WAAW,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC;IACvD,kBAAkB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAC;IACtE,eAAe,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC;IAC/D,eAAe,EAAE,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AAC;IACvD,wBAAwB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,0BAA0B,CAAC;IAClF,wBAAwB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,0BAA0B,CAAC;IAClF,sBAAsB,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,uBAAuB,CAAC;IAC7E,0BAA0B,EAAE,GAAa,EAAE,CAAC,CAAC,WAAW,CAAC,6BAA6B,CAAC;CAC/E,CAAC","sourcesContent":["// Collection reference builders — for collection-level operations.\n//\n// Frontend: collection(db, ...COLLECTION_REFS.userProfiles())\n// Backend: db.collection(toPath(COLLECTION_REFS.userProfiles()))\n\nimport { COLLECTIONS } from './collections.js';\n\nexport const COLLECTION_REFS = {\n userProfiles: (): [string] => [COLLECTIONS.USER_PROFILES],\n publicUsers: (): [string] => [COLLECTIONS.PUBLIC_USERS],\n statusReconcileQueue: (): [string] => [COLLECTIONS.STATUS_RECONCILE_QUEUE],\n registrationStarts: (): [string] => [COLLECTIONS.REGISTRATION_STARTS],\n reservedDisplayNames: (): [string] => [COLLECTIONS.RESERVED_DISPLAY_NAMES],\n sportLeagues: (): [string] => [COLLECTIONS.SPORT_LEAGUES],\n leagueTeams: (): [string] => [COLLECTIONS.LEAGUE_TEAMS],\n leagueTeamContacts: (): [string] => [COLLECTIONS.LEAGUE_TEAM_CONTACTS],\n teamMemberships: (): [string] => [COLLECTIONS.TEAM_MEMBERSHIPS],\n teamInvitations: (): [string] => [COLLECTIONS.TEAM_INVITATIONS],\n teamJoinRequests: (): [string] => [COLLECTIONS.TEAM_JOIN_REQUESTS],\n leagueFreeAgents: (): [string] => [COLLECTIONS.LEAGUE_FREE_AGENTS],\n membershipRosterSyncs: (): [string] => [COLLECTIONS.MEMBERSHIP_ROSTER_SYNCS],\n sportGames: (): [string] => [COLLECTIONS.SPORT_GAMES],\n gameLocations: (): [string] => [COLLECTIONS.GAME_LOCATIONS],\n waiverTemplates: (): [string] => [COLLECTIONS.WAIVER_TEMPLATES],\n signedWaivers: (): [string] => [COLLECTIONS.SIGNED_WAIVERS],\n hardwareLoanContracts: (): [string] => [COLLECTIONS.HARDWARE_LOAN_CONTRACTS],\n awardDefinitions: (): [string] => [COLLECTIONS.AWARD_DEFINITIONS],\n awardGroupGrants: (): [string] => [COLLECTIONS.AWARD_GROUP_GRANTS],\n statsValidationReports: (): [string] => [COLLECTIONS.STATS_VALIDATION_REPORTS],\n statsOperations: (): [string] => [COLLECTIONS.STATS_OPERATIONS],\n migrationActionRuns: (): [string] => [COLLECTIONS.MIGRATION_ACTION_RUNS],\n galleryPictures: (): [string] => [COLLECTIONS.GALLERY_PICTURES],\n pendingMedia: (): [string] => [COLLECTIONS.PENDING_MEDIA],\n pictureRetirements: (): [string] => [COLLECTIONS.PICTURE_RETIREMENTS],\n auditEvents: (): [string] => [COLLECTIONS.AUDIT_EVENTS],\n activeAdminNotifications: (): [string] => [COLLECTIONS.ACTIVE_ADMIN_NOTIFICATIONS],\n adminNotificationHistory: (): [string] => [COLLECTIONS.ADMIN_NOTIFICATION_HISTORY],\n notificationDeliveries: (): [string] => [COLLECTIONS.NOTIFICATION_DELIVERIES],\n notificationArchiveAllJobs: (): [string] => [COLLECTIONS.NOTIFICATION_ARCHIVE_ALL_JOBS],\n} as const;\n"]}
|
|
@@ -19,6 +19,7 @@ export declare const COLLECTIONS: {
|
|
|
19
19
|
readonly SIGNED_WAIVERS: "signedWaivers";
|
|
20
20
|
readonly HARDWARE_LOAN_CONTRACTS: "hardwareLoanContracts";
|
|
21
21
|
readonly AWARD_DEFINITIONS: "awardDefinitions";
|
|
22
|
+
readonly AWARD_GROUP_GRANTS: "awardGroupGrants";
|
|
22
23
|
readonly SPORT_HALL_OF_FAME: "sportHallOfFame";
|
|
23
24
|
readonly STATS_VALIDATION_REPORTS: "statsValidationReports";
|
|
24
25
|
readonly STATS_OPERATIONS: "statsOperations";
|
|
@@ -51,6 +52,10 @@ export declare const SPORT_GAME_SUBCOLLECTIONS: {
|
|
|
51
52
|
export declare const WAIVER_TEMPLATE_SUBCOLLECTIONS: {
|
|
52
53
|
readonly WAIVER_TEMPLATE_VERSIONS: "waiverTemplateVersions";
|
|
53
54
|
};
|
|
55
|
+
/** Subcollections of `awardGroupGrants/{grantId}`. */
|
|
56
|
+
export declare const AWARD_GROUP_GRANT_SUBCOLLECTIONS: {
|
|
57
|
+
readonly AWARD_GROUP_GRANT_PEOPLE: "awardGroupGrantPeople";
|
|
58
|
+
};
|
|
54
59
|
/** Static document IDs for fixed-ID documents. */
|
|
55
60
|
export declare const SPECIAL_DOCS: {
|
|
56
61
|
readonly APP_CONFIG: "app";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/paths/collections.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/paths/collections.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFd,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAE5E,iDAAiD;AACjD,eAAO,MAAM,2BAA2B;;;CAM9B,CAAC;AAEX,+CAA+C;AAC/C,eAAO,MAAM,yBAAyB;;;;CAO5B,CAAC;AAEX,8DAA8D;AAC9D,eAAO,MAAM,8BAA8B;;CAGjC,CAAC;AAEX,sDAAsD;AACtD,eAAO,MAAM,gCAAgC;;CAGnC,CAAC;AAEX,kDAAkD;AAClD,eAAO,MAAM,YAAY;;;;;;CAgBf,CAAC"}
|
|
@@ -45,6 +45,9 @@ export const COLLECTIONS = {
|
|
|
45
45
|
HARDWARE_LOAN_CONTRACTS: 'hardwareLoanContracts',
|
|
46
46
|
// Awards and derived stats
|
|
47
47
|
AWARD_DEFINITIONS: 'awardDefinitions',
|
|
48
|
+
// One decision on one award for one group — a team, or a whole league — granted or taken back a
|
|
49
|
+
// page of people at a time, id `buildAwardGroupGrantId`. Backend-only.
|
|
50
|
+
AWARD_GROUP_GRANTS: 'awardGroupGrants',
|
|
48
51
|
SPORT_HALL_OF_FAME: 'sportHallOfFame',
|
|
49
52
|
STATS_VALIDATION_REPORTS: 'statsValidationReports',
|
|
50
53
|
// One logical run of a stats action: its status, its resume position, and the hold it places on
|
|
@@ -99,6 +102,11 @@ export const WAIVER_TEMPLATE_SUBCOLLECTIONS = {
|
|
|
99
102
|
// One immutable document per published wording, id `buildWaiverTemplateVersionId(version)`.
|
|
100
103
|
WAIVER_TEMPLATE_VERSIONS: 'waiverTemplateVersions',
|
|
101
104
|
};
|
|
105
|
+
/** Subcollections of `awardGroupGrants/{grantId}`. */
|
|
106
|
+
export const AWARD_GROUP_GRANT_SUBCOLLECTIONS = {
|
|
107
|
+
// One document per person the grant reached, id = the userId, recorded before their profile changed.
|
|
108
|
+
AWARD_GROUP_GRANT_PEOPLE: 'awardGroupGrantPeople',
|
|
109
|
+
};
|
|
102
110
|
/** Static document IDs for fixed-ID documents. */
|
|
103
111
|
export const SPECIAL_DOCS = {
|
|
104
112
|
// _appConfig — public read
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections.js","sourceRoot":"","sources":["../../src/paths/collections.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,EAAE;AACF,gGAAgG;AAChG,mGAAmG;AACnG,mGAAmG;AACnG,6FAA6F;AAC7F,6BAA6B;AAC7B,gCAAgC;AAChC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,SAAS;IACT,aAAa,EAAE,cAAc;IAC7B,YAAY,EAAE,aAAa;IAC3B,2FAA2F;IAC3F,sBAAsB,EAAE,sBAAsB;IAC9C,2FAA2F;IAC3F,qEAAqE;IACrE,sBAAsB,EAAE,sBAAsB;IAC9C,iGAAiG;IACjG,2BAA2B;IAC3B,mBAAmB,EA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,EAAE,aAAa;CAClB,CAAC;AAIX,iDAAiD;AACjD,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,6FAA6F;IAC7F,gBAAgB,EAAE,iBAAiB;IACnC,6FAA6F;IAC7F,oEAAoE;IACpE,YAAY,EAAE,aAAa;CACnB,CAAC;AAEX,+CAA+C;AAC/C,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,6FAA6F;IAC7F,mBAAmB,EAAE,mBAAmB;IACxC,wEAAwE;IACxE,gBAAgB,EAAE,gBAAgB;IAClC,8EAA8E;IAC9E,iBAAiB,EAAE,iBAAiB;CAC5B,CAAC;AAEX,8DAA8D;AAC9D,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,4FAA4F;IAC5F,wBAAwB,EAAE,wBAAwB;CAC1C,CAAC;AAEX,kDAAkD;AAClD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,2BAA2B;IAC3B,gGAAgG;IAChG,UAAU,EAAE,KAAK;IACjB,YAAY,EAAE,aAAa;IAC3B,mEAAmE;IACnE,YAAY,EAAE,aAAa;IAE3B,+BAA+B;IAC/B,6FAA6F;IAC7F,UAAU,EAAE,WAAW;IAEvB,iCAAiC;IACjC,gGAAgG;IAChG,QAAQ;IACR,iBAAiB,EAAE,kBAAkB;CAC7B,CAAC","sourcesContent":["// Firestore collection, subcollection, and fixed-document name constants for Q-Sports.\n//\n// Every collection value is compound camelCase — it says what the documents are, never a single\n// bare word (guarded by __tests__/collections.test.ts). The three underscore buckets hold fixed-ID\n// system documents and are placed by who reads them; every one of them is callable-only for writes\n// (BACKEND-108). An admin-only document is server-only, read by an admin through a callable:\n// _appConfig public read\n// _systemData signed-in read\n// _serverData no client access\n\nexport const COLLECTIONS = {\n // People\n USER_PROFILES: 'userProfiles',\n PUBLIC_USERS: 'publicUsers',\n // One document per taken display name, keyed by its normalized form — the uniqueness lock.\n RESERVED_DISPLAY_NAMES: 'reservedDisplayNames',\n // One entry per account owed a post-commit Firebase Auth effect, id = the userId: a status\n // change's sign-in half, or a failed role-claim write. Backend-only.\n STATUS_RECONCILE_QUEUE: 'statusReconcileQueue',\n // One document per login whose registration started, id = the userId: the orphan-login cleanup's\n // work list. Backend-only.\n REGISTRATION_STARTS: 'registrationStarts',\n // One document per scheduled pass that keeps a rolling cursor, id = its `SWEEP_STATE_NAMES` name.\n // Backend-only.\n SWEEP_STATE: 'sweepState',\n\n // Leagues, teams, membership\n SPORT_LEAGUES: 'sportLeagues',\n LEAGUE_TEAMS: 'leagueTeams',\n // One admin-only document per team, id = the team id: how the league reaches the team. The team\n // itself is publicly readable, so no contact detail lives on it (BACKEND-105); a league's contacts\n // are one query on `leagueId`.\n LEAGUE_TEAM_CONTACTS: 'leagueTeamContacts',\n TEAM_MEMBERSHIPS: 'teamMemberships',\n TEAM_INVITATIONS: 'teamInvitations',\n TEAM_JOIN_REQUESTS: 'teamJoinRequests',\n LEAGUE_FREE_AGENTS: 'leagueFreeAgents',\n // One document per team membership, id = the membership's id: the durable obligation to bring\n // that membership's open game rosters in line with it. Backend-only.\n MEMBERSHIP_ROSTER_SYNCS: 'membershipRosterSyncs',\n\n // Games\n SPORT_GAMES: 'sportGames',\n GAME_LOCATIONS: 'gameLocations',\n\n // Waivers and hardware\n WAIVER_TEMPLATES: 'waiverTemplates',\n SIGNED_WAIVERS: 'signedWaivers',\n HARDWARE_LOAN_CONTRACTS: 'hardwareLoanContracts',\n\n // Awards and derived stats\n AWARD_DEFINITIONS: 'awardDefinitions',\n SPORT_HALL_OF_FAME: 'sportHallOfFame',\n STATS_VALIDATION_REPORTS: 'statsValidationReports',\n // One logical run of a stats action: its status, its resume position, and the hold it places on\n // a game. Admin read; written only by the stats cores.\n STATS_OPERATIONS: 'statsOperations',\n\n // One document per cutover action, id = the action id: where its latest real run stands, its\n // last preview, and what it reported. Admin read; written only by the migration console.\n MIGRATION_ACTION_RUNS: 'migrationActionRuns',\n\n // One document per picture in a league, team, or landing page gallery. Public read; written only\n // by the picture core.\n GALLERY_PICTURES: 'galleryPictures',\n // One accepted picture upload, id = its staging id = the picture id. Read by its uploader and\n // admins; written only by the accept core (the upload callable and the picture carry), the\n // processing trigger, and the maintenance sweep's stale-upload pass; never deleted.\n PENDING_MEDIA: 'pendingMedia',\n // The durable obligation to delete a picture's files, or a deleted owner's whole gallery. No\n // client access; carried out by the media maintenance sweep.\n PICTURE_RETIREMENTS: 'pictureRetirements',\n\n // Append-only record of sensitive actions. No client access; written only by Cloud Functions.\n AUDIT_EVENTS: 'auditEvents',\n\n // Admin notifications, all written only by Cloud Functions. The shared cards every admin reads and\n // their archived history are admin read; the delivery ledger the owning callables write each\n // occurrence into, and each admin's archive-all job, have no client access.\n ACTIVE_ADMIN_NOTIFICATIONS: 'activeAdminNotifications',\n ADMIN_NOTIFICATION_HISTORY: 'adminNotificationHistory',\n NOTIFICATION_DELIVERIES: 'notificationDeliveries',\n NOTIFICATION_ARCHIVE_ALL_JOBS: 'notificationArchiveAllJobs',\n\n // Fixed-ID system document buckets\n APP_CONFIG: '_appConfig',\n SYSTEM_DATA: '_systemData',\n SERVER_DATA: '_serverData',\n} as const;\n\nexport type CollectionName = (typeof COLLECTIONS)[keyof typeof COLLECTIONS];\n\n/** Subcollections of `userProfiles/{userId}`. */\nexport const USER_PROFILE_SUBCOLLECTIONS = {\n // One document per sport key: pre-Q-Sports career totals folded into lifetime recalculation.\n HISTORICAL_STATS: 'historicalStats',\n // One owner-only document, id = the userId: email and contact details. The profile itself is\n // publicly readable, so nothing personal lives on it (BACKEND-105).\n PRIVATE_DATA: 'privateData',\n} as const;\n\n/** Subcollections of `sportGames/{gameId}`. */\nexport const SPORT_GAME_SUBCOLLECTIONS = {\n // Who participated in the game: one entry per team per person, id `buildGameRosterPlayerId`.\n GAME_ROSTER_PLAYERS: 'gameRosterPlayers',\n // One stat event per document, keyed by the event id minted at the tap.\n GAME_STAT_EVENTS: 'gameStatEvents',\n // A completed game's finalized record, in pages, id `buildStatHistoryPageId`.\n GAME_STAT_HISTORY: 'gameStatHistory',\n} as const;\n\n/** Subcollections of `waiverTemplates/{waiverTemplateId}`. */\nexport const WAIVER_TEMPLATE_SUBCOLLECTIONS = {\n // One immutable document per published wording, id `buildWaiverTemplateVersionId(version)`.\n WAIVER_TEMPLATE_VERSIONS: 'waiverTemplateVersions',\n} as const;\n\n/** Static document IDs for fixed-ID documents. */\nexport const SPECIAL_DOCS = {\n // _appConfig — public read\n // The app-wide operational levers: version gate, maintenance mode, registration switch, banner.\n APP_CONFIG: 'app',\n LANDING_PAGE: 'landingPage',\n // Public because signed-out spectators follow it for live updates.\n STATS_BEACON: 'statsBeacon',\n\n // _systemData — signed-in read\n // The admin and referee rosters — source of truth for the `admin` / `referee` custom claims.\n ADMIN_LIST: 'adminList',\n\n // _serverData — no client access\n // The migration console: the cutover marker and the lock that keeps two actions from running at\n // once.\n MIGRATION_CONSOLE: 'migrationConsole',\n} as const;\n"]}
|
|
1
|
+
{"version":3,"file":"collections.js","sourceRoot":"","sources":["../../src/paths/collections.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,EAAE;AACF,gGAAgG;AAChG,mGAAmG;AACnG,mGAAmG;AACnG,6FAA6F;AAC7F,6BAA6B;AAC7B,gCAAgC;AAChC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,SAAS;IACT,aAAa,EAAE,cAAc;IAC7B,YAAY,EAAE,aAAa;IAC3B,2FAA2F;IAC3F,sBAAsB,EAAE,sBAAsB;IAC9C,2FAA2F;IAC3F,qEAAqE;IACrE,sBAAsB,EAAE,sBAAsB;IAC9C,iGAAiG;IACjG,2BAA2B;IAC3B,mBAAmB,EAAE,oBAAoB;IACzC,kGAAkG;IAClG,gBAAgB;IAChB,WAAW,EAAE,YAAY;IAEzB,6BAA6B;IAC7B,aAAa,EAAE,cAAc;IAC7B,YAAY,EAAE,aAAa;IAC3B,gGAAgG;IAChG,mGAAmG;IACnG,+BAA+B;IAC/B,oBAAoB,EAAE,oBAAoB;IAC1C,gB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,YAAY,EAAE,aAAa;CACnB,CAAC;AAEX,+CAA+C;AAC/C,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,6FAA6F;IAC7F,mBAAmB,EAAE,mBAAmB;IACxC,wEAAwE;IACxE,gBAAgB,EAAE,gBAAgB;IAClC,8EAA8E;IAC9E,iBAAiB,EAAE,iBAAiB;CAC5B,CAAC;AAEX,8DAA8D;AAC9D,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,4FAA4F;IAC5F,wBAAwB,EAAE,wBAAwB;CAC1C,CAAC;AAEX,sDAAsD;AACtD,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,qGAAqG;IACrG,wBAAwB,EAAE,uBAAuB;CACzC,CAAC;AAEX,kDAAkD;AAClD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,2BAA2B;IAC3B,gGAAgG;IAChG,UAAU,EAAE,KAAK;IACjB,YAAY,EAAE,aAAa;IAC3B,mEAAmE;IACnE,YAAY,EAAE,aAAa;IAE3B,+BAA+B;IAC/B,6FAA6F;IAC7F,UAAU,EAAE,WAAW;IAEvB,iCAAiC;IACjC,gGAAgG;IAChG,QAAQ;IACR,iBAAiB,EAAE,kBAAkB;CAC7B,CAAC","sourcesContent":["// Firestore collection, subcollection, and fixed-document name constants for Q-Sports.\n//\n// Every collection value is compound camelCase — it says what the documents are, never a single\n// bare word (guarded by __tests__/collections.test.ts). The three underscore buckets hold fixed-ID\n// system documents and are placed by who reads them; every one of them is callable-only for writes\n// (BACKEND-108). An admin-only document is server-only, read by an admin through a callable:\n// _appConfig public read\n// _systemData signed-in read\n// _serverData no client access\n\nexport const COLLECTIONS = {\n // People\n USER_PROFILES: 'userProfiles',\n PUBLIC_USERS: 'publicUsers',\n // One document per taken display name, keyed by its normalized form — the uniqueness lock.\n RESERVED_DISPLAY_NAMES: 'reservedDisplayNames',\n // One entry per account owed a post-commit Firebase Auth effect, id = the userId: a status\n // change's sign-in half, or a failed role-claim write. Backend-only.\n STATUS_RECONCILE_QUEUE: 'statusReconcileQueue',\n // One document per login whose registration started, id = the userId: the orphan-login cleanup's\n // work list. Backend-only.\n REGISTRATION_STARTS: 'registrationStarts',\n // One document per scheduled pass that keeps a rolling cursor, id = its `SWEEP_STATE_NAMES` name.\n // Backend-only.\n SWEEP_STATE: 'sweepState',\n\n // Leagues, teams, membership\n SPORT_LEAGUES: 'sportLeagues',\n LEAGUE_TEAMS: 'leagueTeams',\n // One admin-only document per team, id = the team id: how the league reaches the team. The team\n // itself is publicly readable, so no contact detail lives on it (BACKEND-105); a league's contacts\n // are one query on `leagueId`.\n LEAGUE_TEAM_CONTACTS: 'leagueTeamContacts',\n TEAM_MEMBERSHIPS: 'teamMemberships',\n TEAM_INVITATIONS: 'teamInvitations',\n TEAM_JOIN_REQUESTS: 'teamJoinRequests',\n LEAGUE_FREE_AGENTS: 'leagueFreeAgents',\n // One document per team membership, id = the membership's id: the durable obligation to bring\n // that membership's open game rosters in line with it. Backend-only.\n MEMBERSHIP_ROSTER_SYNCS: 'membershipRosterSyncs',\n\n // Games\n SPORT_GAMES: 'sportGames',\n GAME_LOCATIONS: 'gameLocations',\n\n // Waivers and hardware\n WAIVER_TEMPLATES: 'waiverTemplates',\n SIGNED_WAIVERS: 'signedWaivers',\n HARDWARE_LOAN_CONTRACTS: 'hardwareLoanContracts',\n\n // Awards and derived stats\n AWARD_DEFINITIONS: 'awardDefinitions',\n // One decision on one award for one group — a team, or a whole league — granted or taken back a\n // page of people at a time, id `buildAwardGroupGrantId`. Backend-only.\n AWARD_GROUP_GRANTS: 'awardGroupGrants',\n SPORT_HALL_OF_FAME: 'sportHallOfFame',\n STATS_VALIDATION_REPORTS: 'statsValidationReports',\n // One logical run of a stats action: its status, its resume position, and the hold it places on\n // a game. Admin read; written only by the stats cores.\n STATS_OPERATIONS: 'statsOperations',\n\n // One document per cutover action, id = the action id: where its latest real run stands, its\n // last preview, and what it reported. Admin read; written only by the migration console.\n MIGRATION_ACTION_RUNS: 'migrationActionRuns',\n\n // One document per picture in a league, team, or landing page gallery. Public read; written only\n // by the picture core.\n GALLERY_PICTURES: 'galleryPictures',\n // One accepted picture upload, id = its staging id = the picture id. Read by its uploader and\n // admins; written only by the accept core (the upload callable and the picture carry), the\n // processing trigger, and the maintenance sweep's stale-upload pass; never deleted.\n PENDING_MEDIA: 'pendingMedia',\n // The durable obligation to delete a picture's files, or a deleted owner's whole gallery. No\n // client access; carried out by the media maintenance sweep.\n PICTURE_RETIREMENTS: 'pictureRetirements',\n\n // Append-only record of sensitive actions. No client access; written only by Cloud Functions.\n AUDIT_EVENTS: 'auditEvents',\n\n // Admin notifications, all written only by Cloud Functions. The shared cards every admin reads and\n // their archived history are admin read; the delivery ledger the owning callables write each\n // occurrence into, and each admin's archive-all job, have no client access.\n ACTIVE_ADMIN_NOTIFICATIONS: 'activeAdminNotifications',\n ADMIN_NOTIFICATION_HISTORY: 'adminNotificationHistory',\n NOTIFICATION_DELIVERIES: 'notificationDeliveries',\n NOTIFICATION_ARCHIVE_ALL_JOBS: 'notificationArchiveAllJobs',\n\n // Fixed-ID system document buckets\n APP_CONFIG: '_appConfig',\n SYSTEM_DATA: '_systemData',\n SERVER_DATA: '_serverData',\n} as const;\n\nexport type CollectionName = (typeof COLLECTIONS)[keyof typeof COLLECTIONS];\n\n/** Subcollections of `userProfiles/{userId}`. */\nexport const USER_PROFILE_SUBCOLLECTIONS = {\n // One document per sport key: pre-Q-Sports career totals folded into lifetime recalculation.\n HISTORICAL_STATS: 'historicalStats',\n // One owner-only document, id = the userId: email and contact details. The profile itself is\n // publicly readable, so nothing personal lives on it (BACKEND-105).\n PRIVATE_DATA: 'privateData',\n} as const;\n\n/** Subcollections of `sportGames/{gameId}`. */\nexport const SPORT_GAME_SUBCOLLECTIONS = {\n // Who participated in the game: one entry per team per person, id `buildGameRosterPlayerId`.\n GAME_ROSTER_PLAYERS: 'gameRosterPlayers',\n // One stat event per document, keyed by the event id minted at the tap.\n GAME_STAT_EVENTS: 'gameStatEvents',\n // A completed game's finalized record, in pages, id `buildStatHistoryPageId`.\n GAME_STAT_HISTORY: 'gameStatHistory',\n} as const;\n\n/** Subcollections of `waiverTemplates/{waiverTemplateId}`. */\nexport const WAIVER_TEMPLATE_SUBCOLLECTIONS = {\n // One immutable document per published wording, id `buildWaiverTemplateVersionId(version)`.\n WAIVER_TEMPLATE_VERSIONS: 'waiverTemplateVersions',\n} as const;\n\n/** Subcollections of `awardGroupGrants/{grantId}`. */\nexport const AWARD_GROUP_GRANT_SUBCOLLECTIONS = {\n // One document per person the grant reached, id = the userId, recorded before their profile changed.\n AWARD_GROUP_GRANT_PEOPLE: 'awardGroupGrantPeople',\n} as const;\n\n/** Static document IDs for fixed-ID documents. */\nexport const SPECIAL_DOCS = {\n // _appConfig — public read\n // The app-wide operational levers: version gate, maintenance mode, registration switch, banner.\n APP_CONFIG: 'app',\n LANDING_PAGE: 'landingPage',\n // Public because signed-out spectators follow it for live updates.\n STATS_BEACON: 'statsBeacon',\n\n // _systemData — signed-in read\n // The admin and referee rosters — source of truth for the `admin` / `referee` custom claims.\n ADMIN_LIST: 'adminList',\n\n // _serverData — no client access\n // The migration console: the cutover marker and the lock that keeps two actions from running at\n // once.\n MIGRATION_CONSOLE: 'migrationConsole',\n} as const;\n"]}
|
|
@@ -32,6 +32,9 @@ export declare const PATH_BUILDERS: {
|
|
|
32
32
|
readonly signedWaiver: (leagueId: string, userId: string) => [string, string];
|
|
33
33
|
readonly hardwareLoanContract: (contractId: string) => [string, string];
|
|
34
34
|
readonly awardDefinition: (awardId: string) => [string, string];
|
|
35
|
+
readonly awardGroupGrant: (grantId: string) => [string, string];
|
|
36
|
+
readonly awardGroupGrantPerson: (grantId: string, userId: string) => [string, string, string, string];
|
|
37
|
+
readonly awardGroupGrantPeople: (grantId: string) => [string, string, string];
|
|
35
38
|
readonly sportHallOfFame: (sportKey: SportKey) => [string, string];
|
|
36
39
|
readonly statsValidationReport: (reportId: string) => [string, string];
|
|
37
40
|
readonly statsOperation: (operationId: string) => [string, string];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-builders.d.ts","sourceRoot":"","sources":["../../src/paths/path-builders.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"path-builders.d.ts","sourceRoot":"","sources":["../../src/paths/path-builders.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAQrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGnD,eAAO,MAAM,aAAa;mCAEF,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;uCACrB,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;sCAM1C,MAAM,YAAY,QAAQ,KAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;uCAM5D,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;kCAKtC,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;iDACV,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;yCACjC,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;gCAClC,cAAc,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;gDACjB,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;qCAMpC,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;kCAC5B,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;yCAClB,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;wCAC1B,MAAM,UAAU,MAAM,UAAU,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;8CAInD,MAAM,UAAU,MAAM,UAAU,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;wCAI/D,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;0CACvB,MAAM,K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,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;+CACrB,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;2CAI7B,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;4CACxB,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;yCAE5B,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;4CACtB,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;+CAEtB,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;wCAKhC,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;uDAGV,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;wDAIxB,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;gDAIjC,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;gDACzB,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;sCAGrC,CAAC,MAAM,EAAE,MAAM,CAAC;8BACxB,CAAC,MAAM,EAAE,MAAM,CAAC;gCACd,CAAC,MAAM,EAAE,MAAM,CAAC;8BAClB,CAAC,MAAM,EAAE,MAAM,CAAC;qCACT,CAAC,MAAM,EAAE,MAAM,CAAC;CAC9B,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// A singular name builds a document path; its plural builds the parent collection path where the
|
|
7
7
|
// parent is a subcollection (top-level collections are in COLLECTION_REFS). A compound document ID
|
|
8
8
|
// is assembled here through its one builder in ../ids — never at a call site.
|
|
9
|
-
import { COLLECTIONS, SPORT_GAME_SUBCOLLECTIONS, SPECIAL_DOCS, USER_PROFILE_SUBCOLLECTIONS, WAIVER_TEMPLATE_SUBCOLLECTIONS, } from './collections.js';
|
|
9
|
+
import { AWARD_GROUP_GRANT_SUBCOLLECTIONS, COLLECTIONS, SPORT_GAME_SUBCOLLECTIONS, SPECIAL_DOCS, USER_PROFILE_SUBCOLLECTIONS, WAIVER_TEMPLATE_SUBCOLLECTIONS, } from './collections.js';
|
|
10
10
|
import { buildGameRosterPlayerId, buildLeagueFreeAgentId, buildTeamMembershipId, buildSignedWaiverId, } from '../ids/compound-ids.js';
|
|
11
11
|
import { buildWaiverTemplateVersionId } from '../ids/waiver-template-ids.js';
|
|
12
12
|
import { toReservedDisplayNameKey } from '../utils/display-name.js';
|
|
@@ -118,6 +118,18 @@ export const PATH_BUILDERS = {
|
|
|
118
118
|
],
|
|
119
119
|
// Awards and derived stats
|
|
120
120
|
awardDefinition: (awardId) => [COLLECTIONS.AWARD_DEFINITIONS, awardId],
|
|
121
|
+
awardGroupGrant: (grantId) => [COLLECTIONS.AWARD_GROUP_GRANTS, grantId],
|
|
122
|
+
awardGroupGrantPerson: (grantId, userId) => [
|
|
123
|
+
COLLECTIONS.AWARD_GROUP_GRANTS,
|
|
124
|
+
grantId,
|
|
125
|
+
AWARD_GROUP_GRANT_SUBCOLLECTIONS.AWARD_GROUP_GRANT_PEOPLE,
|
|
126
|
+
userId,
|
|
127
|
+
],
|
|
128
|
+
awardGroupGrantPeople: (grantId) => [
|
|
129
|
+
COLLECTIONS.AWARD_GROUP_GRANTS,
|
|
130
|
+
grantId,
|
|
131
|
+
AWARD_GROUP_GRANT_SUBCOLLECTIONS.AWARD_GROUP_GRANT_PEOPLE,
|
|
132
|
+
],
|
|
121
133
|
sportHallOfFame: (sportKey) => [COLLECTIONS.SPORT_HALL_OF_FAME, sportKey],
|
|
122
134
|
statsValidationReport: (reportId) => [
|
|
123
135
|
COLLECTIONS.STATS_VALIDATION_REPORTS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-builders.js","sourceRoot":"","sources":["../../src/paths/path-builders.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,0DAA0D;AAC1D,8DAA8D;AAC9D,EAAE;AACF,iGAAiG;AACjG,mGAAmG;AACnG,8EAA8E;AAE9E,OAAO,EACL,WAAW,EACX,yBAAyB,EACzB,YAAY,EAC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C,cAAc;KACf;IACD,6BAA6B,EAAE,CAAC,SAAiB,EAAoB,EAAE,CAAC;QACtE,WAAW,CAAC,0BAA0B;QACtC,SAAS;KACV;IACD,oBAAoB,EAAE,CAAC,UAAkB,EAAoB,EAAE,CAAC,CAAC,WAAW,CAAC,uBAAuB,EAAE,UAAU,CAAC;IACjH,yBAAyB,EAAE,CAAC,KAAa,EAAoB,EAAE,CAAC,CAAC,WAAW,CAAC,6BAA6B,EAAE,KAAK,CAAC;IAElH,4BAA4B;IAC5B,iBAAiB,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC;IAC9F,SAAS,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,UAAU,CAAC;IACpF,WAAW,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC;IACxF,SAAS,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,YAAY,CAAC,UAAU,CAAC;IACrF,gBAAgB,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,YAAY,CAAC,iBAAiB,CAAC;CAC3F,CAAC","sourcesContent":["// Document path builders — segment tuples, the one path family.\n//\n// Frontend: doc(db, ...PATH_BUILDERS.userProfile(userId))\n// Backend: db.doc(toPath(PATH_BUILDERS.userProfile(userId)))\n//\n// A singular name builds a document path; its plural builds the parent collection path where the\n// parent is a subcollection (top-level collections are in COLLECTION_REFS). A compound document ID\n// is assembled here through its one builder in ../ids — never at a call site.\n\nimport {\n COLLECTIONS,\n SPORT_GAME_SUBCOLLECTIONS,\n SPECIAL_DOCS,\n USER_PROFILE_SUBCOLLECTIONS,\n WAIVER_TEMPLATE_SUBCOLLECTIONS,\n} from './collections.js';\nimport type { SweepStateName } from '../constants/scheduled-jobs.js';\nimport {\n buildGameRosterPlayerId,\n buildLeagueFreeAgentId,\n buildTeamMembershipId,\n buildSignedWaiverId,\n} from '../ids/compound-ids.js';\nimport { buildWaiverTemplateVersionId } from '../ids/waiver-template-ids.js';\nimport type { SportKey } from '../types/sports.js';\nimport { toReservedDisplayNameKey } from '../utils/display-name.js';\n\nexport const PATH_BUILDERS = {\n // People\n userProfile: (userId: string): [string, string] => [COLLECTIONS.USER_PROFILES, userId],\n userPrivateData: (userId: string): [string, string, string, string] => [\n COLLECTIONS.USER_PROFILES,\n userId,\n USER_PROFILE_SUBCOLLECTIONS.PRIVATE_DATA,\n userId,\n ],\n historicalStat: (userId: string, sportKey: SportKey): [string, string, string, string] => [\n COLLECTIONS.USER_PROFILES,\n userId,\n USER_PROFILE_SUBCOLLECTIONS.HISTORICAL_STATS,\n sportKey,\n ],\n historicalStats: (userId: string): [string, string, string] => [\n COLLECTIONS.USER_PROFILES,\n userId,\n USER_PROFILE_SUBCOLLECTIONS.HISTORICAL_STATS,\n ],\n publicUser: (userId: string): [string, string] => [COLLECTIONS.PUBLIC_USERS, userId],\n statusReconcileQueueEntry: (userId: string): [string, string] => [COLLECTIONS.STATUS_RECONCILE_QUEUE, userId],\n registrationStart: (userId: string): [string, string] => [COLLECTIONS.REGISTRATION_STARTS, userId],\n sweepState: (name: SweepStateName): [string, string] => [COLLECTIONS.SWEEP_STATE, name],\n reservedDisplayName: (displayName: string): [string, string] => [\n COLLECTIONS.RESERVED_DISPLAY_NAMES,\n toReservedDisplayNameKey(displayName),\n ],\n\n // Leagues, teams, membership\n sportLeague: (leagueId: string): [string, string] => [COLLECTIONS.SPORT_LEAGUES, leagueId],\n leagueTeam: (teamId: string): [string, string] => [COLLECTIONS.LEAGUE_TEAMS, teamId],\n leagueTeamContact: (teamId: string): [string, string] => [COLLECTIONS.LEAGUE_TEAM_CONTACTS, teamId],\n teamMembership: (leagueId: string, teamId: string, userId: string): [string, string] => [\n COLLECTIONS.TEAM_MEMBERSHIPS,\n buildTeamMembershipId(leagueId, teamId, userId),\n ],\n membershipRosterSync: (leagueId: string, teamId: string, userId: string): [string, string] => [\n COLLECTIONS.MEMBERSHIP_ROSTER_SYNCS,\n buildTeamMembershipId(leagueId, teamId, userId),\n ],\n teamInvitation: (inviteId: string): [string, string] => [COLLECTIONS.TEAM_INVITATIONS, inviteId],\n teamJoinRequest: (requestId: string): [string, string] => [COLLECTIONS.TEAM_JOIN_REQUESTS, requestId],\n leagueFreeAgent: (leagueId: string, userId: string): [string, string] => [\n COLLECTIONS.LEAGUE_FREE_AGENTS,\n buildLeagueFreeAgentId(leagueId, userId),\n ],\n\n // Games\n sportGame: (gameId: string): [string, string] => [COLLECTIONS.SPORT_GAMES, gameId],\n gameRosterPlayer: (gameId: string, teamId: string, userId: string): [string, string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_ROSTER_PLAYERS,\n buildGameRosterPlayerId(teamId, userId),\n ],\n gameRosterPlayers: (gameId: string): [string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_ROSTER_PLAYERS,\n ],\n gameStatEvent: (gameId: string, eventId: string): [string, string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_EVENTS,\n eventId,\n ],\n gameStatEvents: (gameId: string): [string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_EVENTS,\n ],\n gameStatHistoryPage: (gameId: string, pageId: string): [string, string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_HISTORY,\n pageId,\n ],\n gameStatHistory: (gameId: string): [string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_HISTORY,\n ],\n gameLocation: (gameLocationId: string): [string, string] => [COLLECTIONS.GAME_LOCATIONS, gameLocationId],\n\n // Waivers and hardware\n waiverTemplate: (waiverTemplateId: string): [string, string] => [\n COLLECTIONS.WAIVER_TEMPLATES,\n waiverTemplateId,\n ],\n waiverTemplateVersion: (waiverTemplateId: string, version: number): [string, string, string, string] => [\n COLLECTIONS.WAIVER_TEMPLATES,\n waiverTemplateId,\n WAIVER_TEMPLATE_SUBCOLLECTIONS.WAIVER_TEMPLATE_VERSIONS,\n buildWaiverTemplateVersionId(version),\n ],\n waiverTemplateVersions: (waiverTemplateId: string): [string, string, string] => [\n COLLECTIONS.WAIVER_TEMPLATES,\n waiverTemplateId,\n WAIVER_TEMPLATE_SUBCOLLECTIONS.WAIVER_TEMPLATE_VERSIONS,\n ],\n signedWaiver: (leagueId: string, userId: string): [string, string] => [\n COLLECTIONS.SIGNED_WAIVERS,\n buildSignedWaiverId(leagueId, userId),\n ],\n hardwareLoanContract: (contractId: string): [string, string] => [\n COLLECTIONS.HARDWARE_LOAN_CONTRACTS,\n contractId,\n ],\n\n // Awards and derived stats\n awardDefinition: (awardId: string): [string, string] => [COLLECTIONS.AWARD_DEFINITIONS, awardId],\n sportHallOfFame: (sportKey: SportKey): [string, string] => [COLLECTIONS.SPORT_HALL_OF_FAME, sportKey],\n statsValidationReport: (reportId: string): [string, string] => [\n COLLECTIONS.STATS_VALIDATION_REPORTS,\n reportId,\n ],\n statsOperation: (operationId: string): [string, string] => [COLLECTIONS.STATS_OPERATIONS, operationId],\n migrationActionRun: (actionId: string): [string, string] => [COLLECTIONS.MIGRATION_ACTION_RUNS, actionId],\n\n galleryPicture: (pictureId: string): [string, string] => [COLLECTIONS.GALLERY_PICTURES, pictureId],\n pendingMedia: (pendingMediaId: string): [string, string] => [COLLECTIONS.PENDING_MEDIA, pendingMediaId],\n // A picture's retirement is keyed by the picture id; a whole gallery's by `buildGalleryRetirementId`.\n pictureRetirement: (retirementId: string): [string, string] => [\n COLLECTIONS.PICTURE_RETIREMENTS,\n retirementId,\n ],\n\n auditEvent: (auditEventId: string): [string, string] => [COLLECTIONS.AUDIT_EVENTS, auditEventId],\n\n // Admin notifications. A card's id is notification-core's; the others come from ../ids.\n activeAdminNotification: (notificationId: string): [string, string] => [\n COLLECTIONS.ACTIVE_ADMIN_NOTIFICATIONS,\n notificationId,\n ],\n adminNotificationHistoryEntry: (historyId: string): [string, string] => [\n COLLECTIONS.ADMIN_NOTIFICATION_HISTORY,\n historyId,\n ],\n notificationDelivery: (deliveryId: string): [string, string] => [COLLECTIONS.NOTIFICATION_DELIVERIES, deliveryId],\n notificationArchiveAllJob: (jobId: string): [string, string] => [COLLECTIONS.NOTIFICATION_ARCHIVE_ALL_JOBS, jobId],\n\n // Fixed-ID system documents\n landingPageConfig: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.LANDING_PAGE],\n appConfig: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.APP_CONFIG],\n statsBeacon: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.STATS_BEACON],\n adminList: (): [string, string] => [COLLECTIONS.SYSTEM_DATA, SPECIAL_DOCS.ADMIN_LIST],\n migrationConsole: (): [string, string] => [COLLECTIONS.SERVER_DATA, SPECIAL_DOCS.MIGRATION_CONSOLE],\n} as const;\n"]}
|
|
1
|
+
{"version":3,"file":"path-builders.js","sourceRoot":"","sources":["../../src/paths/path-builders.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,0DAA0D;AAC1D,8DAA8D;AAC9D,EAAE;AACF,iGAAiG;AACjG,mGAAmG;AACnG,8EAA8E;AAE9E,OAAO,EACL,gCAAgC,EAChC,WAAW,EACX,yBAAyB,EACzB,YAAY,EACZ,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,4BAA4B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IAED,UAAU,EAAE,CAAC,YAAoB,EAAoB,EAAE,CAAC,CAAC,WAAW,CAAC,YAAY,EAAE,YAAY,CAAC;IAEhG,wFAAwF;IACxF,uBAAuB,EAAE,CAAC,cAAsB,EAAoB,EAAE,CAAC;QACrE,WAAW,CAAC,0BAA0B;QACtC,cAAc;KACf;IACD,6BAA6B,EAAE,CAAC,SAAiB,EAAoB,EAAE,CAAC;QACtE,WAAW,CAAC,0BAA0B;QACtC,SAAS;KACV;IACD,oBAAoB,EAAE,CAAC,UAAkB,EAAoB,EAAE,CAAC,CAAC,WAAW,CAAC,uBAAuB,EAAE,UAAU,CAAC;IACjH,yBAAyB,EAAE,CAAC,KAAa,EAAoB,EAAE,CAAC,CAAC,WAAW,CAAC,6BAA6B,EAAE,KAAK,CAAC;IAElH,4BAA4B;IAC5B,iBAAiB,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC;IAC9F,SAAS,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,UAAU,CAAC;IACpF,WAAW,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC;IACxF,SAAS,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,YAAY,CAAC,UAAU,CAAC;IACrF,gBAAgB,EAAE,GAAqB,EAAE,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,YAAY,CAAC,iBAAiB,CAAC;CAC3F,CAAC","sourcesContent":["// Document path builders — segment tuples, the one path family.\n//\n// Frontend: doc(db, ...PATH_BUILDERS.userProfile(userId))\n// Backend: db.doc(toPath(PATH_BUILDERS.userProfile(userId)))\n//\n// A singular name builds a document path; its plural builds the parent collection path where the\n// parent is a subcollection (top-level collections are in COLLECTION_REFS). A compound document ID\n// is assembled here through its one builder in ../ids — never at a call site.\n\nimport {\n AWARD_GROUP_GRANT_SUBCOLLECTIONS,\n COLLECTIONS,\n SPORT_GAME_SUBCOLLECTIONS,\n SPECIAL_DOCS,\n USER_PROFILE_SUBCOLLECTIONS,\n WAIVER_TEMPLATE_SUBCOLLECTIONS,\n} from './collections.js';\nimport type { SweepStateName } from '../constants/scheduled-jobs.js';\nimport {\n buildGameRosterPlayerId,\n buildLeagueFreeAgentId,\n buildTeamMembershipId,\n buildSignedWaiverId,\n} from '../ids/compound-ids.js';\nimport { buildWaiverTemplateVersionId } from '../ids/waiver-template-ids.js';\nimport type { SportKey } from '../types/sports.js';\nimport { toReservedDisplayNameKey } from '../utils/display-name.js';\n\nexport const PATH_BUILDERS = {\n // People\n userProfile: (userId: string): [string, string] => [COLLECTIONS.USER_PROFILES, userId],\n userPrivateData: (userId: string): [string, string, string, string] => [\n COLLECTIONS.USER_PROFILES,\n userId,\n USER_PROFILE_SUBCOLLECTIONS.PRIVATE_DATA,\n userId,\n ],\n historicalStat: (userId: string, sportKey: SportKey): [string, string, string, string] => [\n COLLECTIONS.USER_PROFILES,\n userId,\n USER_PROFILE_SUBCOLLECTIONS.HISTORICAL_STATS,\n sportKey,\n ],\n historicalStats: (userId: string): [string, string, string] => [\n COLLECTIONS.USER_PROFILES,\n userId,\n USER_PROFILE_SUBCOLLECTIONS.HISTORICAL_STATS,\n ],\n publicUser: (userId: string): [string, string] => [COLLECTIONS.PUBLIC_USERS, userId],\n statusReconcileQueueEntry: (userId: string): [string, string] => [COLLECTIONS.STATUS_RECONCILE_QUEUE, userId],\n registrationStart: (userId: string): [string, string] => [COLLECTIONS.REGISTRATION_STARTS, userId],\n sweepState: (name: SweepStateName): [string, string] => [COLLECTIONS.SWEEP_STATE, name],\n reservedDisplayName: (displayName: string): [string, string] => [\n COLLECTIONS.RESERVED_DISPLAY_NAMES,\n toReservedDisplayNameKey(displayName),\n ],\n\n // Leagues, teams, membership\n sportLeague: (leagueId: string): [string, string] => [COLLECTIONS.SPORT_LEAGUES, leagueId],\n leagueTeam: (teamId: string): [string, string] => [COLLECTIONS.LEAGUE_TEAMS, teamId],\n leagueTeamContact: (teamId: string): [string, string] => [COLLECTIONS.LEAGUE_TEAM_CONTACTS, teamId],\n teamMembership: (leagueId: string, teamId: string, userId: string): [string, string] => [\n COLLECTIONS.TEAM_MEMBERSHIPS,\n buildTeamMembershipId(leagueId, teamId, userId),\n ],\n membershipRosterSync: (leagueId: string, teamId: string, userId: string): [string, string] => [\n COLLECTIONS.MEMBERSHIP_ROSTER_SYNCS,\n buildTeamMembershipId(leagueId, teamId, userId),\n ],\n teamInvitation: (inviteId: string): [string, string] => [COLLECTIONS.TEAM_INVITATIONS, inviteId],\n teamJoinRequest: (requestId: string): [string, string] => [COLLECTIONS.TEAM_JOIN_REQUESTS, requestId],\n leagueFreeAgent: (leagueId: string, userId: string): [string, string] => [\n COLLECTIONS.LEAGUE_FREE_AGENTS,\n buildLeagueFreeAgentId(leagueId, userId),\n ],\n\n // Games\n sportGame: (gameId: string): [string, string] => [COLLECTIONS.SPORT_GAMES, gameId],\n gameRosterPlayer: (gameId: string, teamId: string, userId: string): [string, string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_ROSTER_PLAYERS,\n buildGameRosterPlayerId(teamId, userId),\n ],\n gameRosterPlayers: (gameId: string): [string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_ROSTER_PLAYERS,\n ],\n gameStatEvent: (gameId: string, eventId: string): [string, string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_EVENTS,\n eventId,\n ],\n gameStatEvents: (gameId: string): [string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_EVENTS,\n ],\n gameStatHistoryPage: (gameId: string, pageId: string): [string, string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_HISTORY,\n pageId,\n ],\n gameStatHistory: (gameId: string): [string, string, string] => [\n COLLECTIONS.SPORT_GAMES,\n gameId,\n SPORT_GAME_SUBCOLLECTIONS.GAME_STAT_HISTORY,\n ],\n gameLocation: (gameLocationId: string): [string, string] => [COLLECTIONS.GAME_LOCATIONS, gameLocationId],\n\n // Waivers and hardware\n waiverTemplate: (waiverTemplateId: string): [string, string] => [\n COLLECTIONS.WAIVER_TEMPLATES,\n waiverTemplateId,\n ],\n waiverTemplateVersion: (waiverTemplateId: string, version: number): [string, string, string, string] => [\n COLLECTIONS.WAIVER_TEMPLATES,\n waiverTemplateId,\n WAIVER_TEMPLATE_SUBCOLLECTIONS.WAIVER_TEMPLATE_VERSIONS,\n buildWaiverTemplateVersionId(version),\n ],\n waiverTemplateVersions: (waiverTemplateId: string): [string, string, string] => [\n COLLECTIONS.WAIVER_TEMPLATES,\n waiverTemplateId,\n WAIVER_TEMPLATE_SUBCOLLECTIONS.WAIVER_TEMPLATE_VERSIONS,\n ],\n signedWaiver: (leagueId: string, userId: string): [string, string] => [\n COLLECTIONS.SIGNED_WAIVERS,\n buildSignedWaiverId(leagueId, userId),\n ],\n hardwareLoanContract: (contractId: string): [string, string] => [\n COLLECTIONS.HARDWARE_LOAN_CONTRACTS,\n contractId,\n ],\n\n // Awards and derived stats\n awardDefinition: (awardId: string): [string, string] => [COLLECTIONS.AWARD_DEFINITIONS, awardId],\n awardGroupGrant: (grantId: string): [string, string] => [COLLECTIONS.AWARD_GROUP_GRANTS, grantId],\n awardGroupGrantPerson: (grantId: string, userId: string): [string, string, string, string] => [\n COLLECTIONS.AWARD_GROUP_GRANTS,\n grantId,\n AWARD_GROUP_GRANT_SUBCOLLECTIONS.AWARD_GROUP_GRANT_PEOPLE,\n userId,\n ],\n awardGroupGrantPeople: (grantId: string): [string, string, string] => [\n COLLECTIONS.AWARD_GROUP_GRANTS,\n grantId,\n AWARD_GROUP_GRANT_SUBCOLLECTIONS.AWARD_GROUP_GRANT_PEOPLE,\n ],\n sportHallOfFame: (sportKey: SportKey): [string, string] => [COLLECTIONS.SPORT_HALL_OF_FAME, sportKey],\n statsValidationReport: (reportId: string): [string, string] => [\n COLLECTIONS.STATS_VALIDATION_REPORTS,\n reportId,\n ],\n statsOperation: (operationId: string): [string, string] => [COLLECTIONS.STATS_OPERATIONS, operationId],\n migrationActionRun: (actionId: string): [string, string] => [COLLECTIONS.MIGRATION_ACTION_RUNS, actionId],\n\n galleryPicture: (pictureId: string): [string, string] => [COLLECTIONS.GALLERY_PICTURES, pictureId],\n pendingMedia: (pendingMediaId: string): [string, string] => [COLLECTIONS.PENDING_MEDIA, pendingMediaId],\n // A picture's retirement is keyed by the picture id; a whole gallery's by `buildGalleryRetirementId`.\n pictureRetirement: (retirementId: string): [string, string] => [\n COLLECTIONS.PICTURE_RETIREMENTS,\n retirementId,\n ],\n\n auditEvent: (auditEventId: string): [string, string] => [COLLECTIONS.AUDIT_EVENTS, auditEventId],\n\n // Admin notifications. A card's id is notification-core's; the others come from ../ids.\n activeAdminNotification: (notificationId: string): [string, string] => [\n COLLECTIONS.ACTIVE_ADMIN_NOTIFICATIONS,\n notificationId,\n ],\n adminNotificationHistoryEntry: (historyId: string): [string, string] => [\n COLLECTIONS.ADMIN_NOTIFICATION_HISTORY,\n historyId,\n ],\n notificationDelivery: (deliveryId: string): [string, string] => [COLLECTIONS.NOTIFICATION_DELIVERIES, deliveryId],\n notificationArchiveAllJob: (jobId: string): [string, string] => [COLLECTIONS.NOTIFICATION_ARCHIVE_ALL_JOBS, jobId],\n\n // Fixed-ID system documents\n landingPageConfig: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.LANDING_PAGE],\n appConfig: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.APP_CONFIG],\n statsBeacon: (): [string, string] => [COLLECTIONS.APP_CONFIG, SPECIAL_DOCS.STATS_BEACON],\n adminList: (): [string, string] => [COLLECTIONS.SYSTEM_DATA, SPECIAL_DOCS.ADMIN_LIST],\n migrationConsole: (): [string, string] => [COLLECTIONS.SERVER_DATA, SPECIAL_DOCS.MIGRATION_CONSOLE],\n} as const;\n"]}
|
|
@@ -27,8 +27,8 @@ export declare const AdminGetNotificationArchiveAllStatusInputSchema: z.ZodObjec
|
|
|
27
27
|
export type AdminGetNotificationArchiveAllStatusInput = z.infer<typeof AdminGetNotificationArchiveAllStatusInputSchema>;
|
|
28
28
|
export declare const AdminGetNotificationArchiveAllStatusResultSchema: z.ZodObject<{
|
|
29
29
|
state: z.ZodEnum<{
|
|
30
|
-
failed: "failed";
|
|
31
30
|
complete: "complete";
|
|
31
|
+
failed: "failed";
|
|
32
32
|
"in-progress": "in-progress";
|
|
33
33
|
incomplete: "incomplete";
|
|
34
34
|
}>;
|
package/dist/schemas/awards.d.ts
CHANGED
|
@@ -2,8 +2,6 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const AdminUpdateAwardGrantsInputSchema: z.ZodObject<{
|
|
3
3
|
awardId: z.ZodString;
|
|
4
4
|
grantUserIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5
|
-
grantTeamIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6
|
-
grantLeagueIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7
5
|
revokeUserIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8
6
|
}, z.core.$strict>;
|
|
9
7
|
export type AdminUpdateAwardGrantsInput = z.infer<typeof AdminUpdateAwardGrantsInputSchema>;
|
|
@@ -30,6 +28,100 @@ export declare const AdminUpdateAwardGrantsResultSchema: z.ZodObject<{
|
|
|
30
28
|
}, z.core.$strict>>;
|
|
31
29
|
}, z.core.$strict>;
|
|
32
30
|
export type AdminUpdateAwardGrantsResult = z.infer<typeof AdminUpdateAwardGrantsResultSchema>;
|
|
31
|
+
export declare const AwardGroupSchema: z.ZodObject<{
|
|
32
|
+
groupType: z.ZodEnum<{
|
|
33
|
+
team: "team";
|
|
34
|
+
league: "league";
|
|
35
|
+
}>;
|
|
36
|
+
groupId: z.ZodString;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
export type AwardGroup = z.infer<typeof AwardGroupSchema>;
|
|
39
|
+
export declare const AdminUpdateAwardGroupGrantInputSchema: z.ZodObject<{
|
|
40
|
+
awardId: z.ZodString;
|
|
41
|
+
action: z.ZodEnum<{
|
|
42
|
+
grant: "grant";
|
|
43
|
+
revoke: "revoke";
|
|
44
|
+
}>;
|
|
45
|
+
group: z.ZodObject<{
|
|
46
|
+
groupType: z.ZodEnum<{
|
|
47
|
+
team: "team";
|
|
48
|
+
league: "league";
|
|
49
|
+
}>;
|
|
50
|
+
groupId: z.ZodString;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
}, z.core.$strict>;
|
|
53
|
+
export type AdminUpdateAwardGroupGrantInput = z.infer<typeof AdminUpdateAwardGroupGrantInputSchema>;
|
|
54
|
+
export declare const AwardGroupGrantProgressSchema: z.ZodObject<{
|
|
55
|
+
grantId: z.ZodString;
|
|
56
|
+
action: z.ZodEnum<{
|
|
57
|
+
grant: "grant";
|
|
58
|
+
revoke: "revoke";
|
|
59
|
+
}>;
|
|
60
|
+
decision: z.ZodNumber;
|
|
61
|
+
status: z.ZodEnum<{
|
|
62
|
+
pending: "pending";
|
|
63
|
+
complete: "complete";
|
|
64
|
+
}>;
|
|
65
|
+
peopleReached: z.ZodNumber;
|
|
66
|
+
attemptCount: z.ZodNumber;
|
|
67
|
+
lastError: z.ZodNullable<z.ZodString>;
|
|
68
|
+
createdAt: z.ZodNumber;
|
|
69
|
+
completedAt: z.ZodNullable<z.ZodNumber>;
|
|
70
|
+
}, z.core.$strict>;
|
|
71
|
+
export type AwardGroupGrantProgress = z.infer<typeof AwardGroupGrantProgressSchema>;
|
|
72
|
+
export declare const AdminUpdateAwardGroupGrantResultSchema: z.ZodObject<{
|
|
73
|
+
awardId: z.ZodString;
|
|
74
|
+
opened: z.ZodBoolean;
|
|
75
|
+
grant: z.ZodNullable<z.ZodObject<{
|
|
76
|
+
grantId: z.ZodString;
|
|
77
|
+
action: z.ZodEnum<{
|
|
78
|
+
grant: "grant";
|
|
79
|
+
revoke: "revoke";
|
|
80
|
+
}>;
|
|
81
|
+
decision: z.ZodNumber;
|
|
82
|
+
status: z.ZodEnum<{
|
|
83
|
+
pending: "pending";
|
|
84
|
+
complete: "complete";
|
|
85
|
+
}>;
|
|
86
|
+
peopleReached: z.ZodNumber;
|
|
87
|
+
attemptCount: z.ZodNumber;
|
|
88
|
+
lastError: z.ZodNullable<z.ZodString>;
|
|
89
|
+
createdAt: z.ZodNumber;
|
|
90
|
+
completedAt: z.ZodNullable<z.ZodNumber>;
|
|
91
|
+
}, z.core.$strict>>;
|
|
92
|
+
}, z.core.$strict>;
|
|
93
|
+
export type AdminUpdateAwardGroupGrantResult = z.infer<typeof AdminUpdateAwardGroupGrantResultSchema>;
|
|
94
|
+
export declare const AdminGetAwardGroupGrantStatusInputSchema: z.ZodObject<{
|
|
95
|
+
awardId: z.ZodString;
|
|
96
|
+
group: z.ZodObject<{
|
|
97
|
+
groupType: z.ZodEnum<{
|
|
98
|
+
team: "team";
|
|
99
|
+
league: "league";
|
|
100
|
+
}>;
|
|
101
|
+
groupId: z.ZodString;
|
|
102
|
+
}, z.core.$strict>;
|
|
103
|
+
}, z.core.$strict>;
|
|
104
|
+
export type AdminGetAwardGroupGrantStatusInput = z.infer<typeof AdminGetAwardGroupGrantStatusInputSchema>;
|
|
105
|
+
export declare const AdminGetAwardGroupGrantStatusResultSchema: z.ZodObject<{
|
|
106
|
+
grant: z.ZodNullable<z.ZodObject<{
|
|
107
|
+
grantId: z.ZodString;
|
|
108
|
+
action: z.ZodEnum<{
|
|
109
|
+
grant: "grant";
|
|
110
|
+
revoke: "revoke";
|
|
111
|
+
}>;
|
|
112
|
+
decision: z.ZodNumber;
|
|
113
|
+
status: z.ZodEnum<{
|
|
114
|
+
pending: "pending";
|
|
115
|
+
complete: "complete";
|
|
116
|
+
}>;
|
|
117
|
+
peopleReached: z.ZodNumber;
|
|
118
|
+
attemptCount: z.ZodNumber;
|
|
119
|
+
lastError: z.ZodNullable<z.ZodString>;
|
|
120
|
+
createdAt: z.ZodNumber;
|
|
121
|
+
completedAt: z.ZodNullable<z.ZodNumber>;
|
|
122
|
+
}, z.core.$strict>>;
|
|
123
|
+
}, z.core.$strict>;
|
|
124
|
+
export type AdminGetAwardGroupGrantStatusResult = z.infer<typeof AdminGetAwardGroupGrantStatusResultSchema>;
|
|
33
125
|
export declare const AdminDeleteAwardDefinitionInputSchema: z.ZodObject<{
|
|
34
126
|
awardId: z.ZodString;
|
|
35
127
|
}, z.core.$strict>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"awards.d.ts","sourceRoot":"","sources":["../../src/schemas/awards.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"awards.d.ts","sourceRoot":"","sources":["../../src/schemas/awards.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,iCAAiC;;;;kBAc3C,CAAC;AACJ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F,eAAO,MAAM,oBAAoB;;;;;;kBAEtB,CAAC;AACZ,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAKlE,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;kBASpC,CAAC;AACZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAI9F,eAAO,MAAM,gBAAgB;;;;;;kBAElB,CAAC;AACZ,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAK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
package/dist/schemas/awards.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
// Callable contracts for the award catalog, award grants, and the badges an account features.
|
|
2
2
|
//
|
|
3
3
|
// An award is created by its first badge's publication (the `award-badge` upload, ./uploads.ts), so
|
|
4
|
-
// no callable here creates one. Grants and revokes share one input —
|
|
5
|
-
// action discriminator (BACKEND-002) — like the role roster's.
|
|
4
|
+
// no callable here creates one. Grants and revokes to named accounts share one input — two named
|
|
5
|
+
// lists, never an action discriminator (BACKEND-002) — like the role roster's. A team's or a whole
|
|
6
|
+
// league's grant is its own decision, carried out a page of people at a time.
|
|
6
7
|
import { z } from 'zod';
|
|
7
8
|
import { MAX_AWARD_GRANT_TARGETS } from '../constants/business.js';
|
|
9
|
+
import { awardGroupGrantActionSchema, awardGroupGrantDecisionSchema, awardGroupGrantStatusSchema, awardGroupTypeSchema, } from '../doc-schemas/award-group-grant.js';
|
|
10
|
+
import { countSchema, documentIdSegmentSchema, epochMsSchema } from '../doc-schemas/atoms.js';
|
|
8
11
|
import { awardIdSchema } from '../doc-schemas/catalogs.js';
|
|
9
12
|
import { AWARD_GRANT_SKIP_REASON_KEYS, FEATURED_AWARD_SLOT_KEYS } from '../types/unions.js';
|
|
10
|
-
import {
|
|
13
|
+
import { userIdSchema } from './atoms.js';
|
|
11
14
|
const targetList = (atom) => z.array(atom).max(MAX_AWARD_GRANT_TARGETS).optional();
|
|
12
|
-
// An admin grants an award to
|
|
13
|
-
//
|
|
14
|
-
// and bounded by MAX_AWARD_GRANT_RECIPIENTS; ghosts hold no account and are skipped.
|
|
15
|
+
// An admin grants an award to named accounts and revokes it from named accounts, in one commit.
|
|
16
|
+
// Recipients are deduplicated on the server; a ghost holds no account and is skipped.
|
|
15
17
|
export const AdminUpdateAwardGrantsInputSchema = z
|
|
16
18
|
.object({
|
|
17
19
|
awardId: awardIdSchema,
|
|
18
20
|
grantUserIds: targetList(userIdSchema),
|
|
19
|
-
grantTeamIds: targetList(teamIdSchema),
|
|
20
|
-
grantLeagueIds: targetList(leagueIdSchema),
|
|
21
21
|
revokeUserIds: targetList(userIdSchema),
|
|
22
22
|
})
|
|
23
23
|
.strict()
|
|
24
|
-
.refine((input) => [input.grantUserIds, input.
|
|
24
|
+
.refine((input) => [input.grantUserIds, input.revokeUserIds].some((list) => list !== undefined && list.length > 0), { message: 'Name someone to grant the award to or revoke it from.' })
|
|
25
25
|
.refine((input) => !(input.grantUserIds ?? []).some((userId) => (input.revokeUserIds ?? []).includes(userId)), { message: 'An account cannot be granted and revoked the award in one change.', path: ['revokeUserIds'] });
|
|
26
26
|
export const AwardGrantSkipSchema = z
|
|
27
27
|
.object({ userId: userIdSchema, reason: z.enum(AWARD_GRANT_SKIP_REASON_KEYS) })
|
|
@@ -39,6 +39,46 @@ export const AdminUpdateAwardGrantsResultSchema = z
|
|
|
39
39
|
skipped: z.array(AwardGrantSkipSchema),
|
|
40
40
|
})
|
|
41
41
|
.strict();
|
|
42
|
+
// The group a group grant reaches: every active member of one team, or of one whole league.
|
|
43
|
+
// `groupId` is that team's or league's id.
|
|
44
|
+
export const AwardGroupSchema = z
|
|
45
|
+
.object({ groupType: awardGroupTypeSchema, groupId: documentIdSegmentSchema })
|
|
46
|
+
.strict();
|
|
47
|
+
// An admin grants an award to a group, or takes back what the group's grants gave. The decision opens
|
|
48
|
+
// at once and its people are reached a page at a time after the answer; a request the group's latest
|
|
49
|
+
// decision already settles (granting what is granted, taking back what is not) opens nothing.
|
|
50
|
+
export const AdminUpdateAwardGroupGrantInputSchema = z
|
|
51
|
+
.object({ awardId: awardIdSchema, action: awardGroupGrantActionSchema, group: AwardGroupSchema })
|
|
52
|
+
.strict();
|
|
53
|
+
// Where one decision on an award for a group stands. `peopleReached` is how many people it has dealt
|
|
54
|
+
// with so far: a grant's recorded people, or the people a revoke has taken the award back from or left
|
|
55
|
+
// holding it. A pending decision that failed carries its failure and how many times it has tried; the
|
|
56
|
+
// scheduled resume tries it again.
|
|
57
|
+
export const AwardGroupGrantProgressSchema = z
|
|
58
|
+
.object({
|
|
59
|
+
grantId: z.string().min(1),
|
|
60
|
+
action: awardGroupGrantActionSchema,
|
|
61
|
+
decision: awardGroupGrantDecisionSchema,
|
|
62
|
+
status: awardGroupGrantStatusSchema,
|
|
63
|
+
peopleReached: countSchema,
|
|
64
|
+
attemptCount: countSchema,
|
|
65
|
+
lastError: z.string().nullable(),
|
|
66
|
+
createdAt: epochMsSchema,
|
|
67
|
+
completedAt: epochMsSchema.nullable(),
|
|
68
|
+
})
|
|
69
|
+
.strict();
|
|
70
|
+
// `opened` is false when the group's latest decision already settled the request; `grant` is then that
|
|
71
|
+
// decision, or null when the group has none.
|
|
72
|
+
export const AdminUpdateAwardGroupGrantResultSchema = z
|
|
73
|
+
.object({ awardId: awardIdSchema, opened: z.boolean(), grant: AwardGroupGrantProgressSchema.nullable() })
|
|
74
|
+
.strict();
|
|
75
|
+
// An admin reads the latest decision on an award for a group, so the progress survives a closed page.
|
|
76
|
+
export const AdminGetAwardGroupGrantStatusInputSchema = z
|
|
77
|
+
.object({ awardId: awardIdSchema, group: AwardGroupSchema })
|
|
78
|
+
.strict();
|
|
79
|
+
export const AdminGetAwardGroupGrantStatusResultSchema = z
|
|
80
|
+
.object({ grant: AwardGroupGrantProgressSchema.nullable() })
|
|
81
|
+
.strict();
|
|
42
82
|
// An admin deletes an award nobody holds. Its badge's files are retired with it.
|
|
43
83
|
export const AdminDeleteAwardDefinitionInputSchema = z.object({ awardId: awardIdSchema }).strict();
|
|
44
84
|
// `deleted` is false when the award was already gone: nothing was written.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"awards.js","sourceRoot":"","sources":["../../src/schemas/awards.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,EAAE;AACF,oGAAoG;AACpG,gGAAgG;AAChG,+DAA+D;AAE/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAA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,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACtG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE;IAChF,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;CACjD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,MAAM,EAAE,YAAY;IACpB,cAAc,EAAE,aAAa,CAAC,QAAQ,EAAE;IACxC,gBAAgB,EAAE,aAAa,CAAC,QAAQ,EAAE;IAC1C,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the award catalog, award grants, and the badges an account features.\n//\n// An award is created by its first badge's publication (the `award-badge` upload, ./uploads.ts), so\n// no callable here creates one. Grants and revokes share one input — four named lists, never an\n// action discriminator (BACKEND-002) — like the role roster's.\n\nimport { z } from 'zod';\nimport { MAX_AWARD_GRANT_TARGETS } from '../constants/business.js';\nimport { awardIdSchema } from '../doc-schemas/catalogs.js';\nimport { AWARD_GRANT_SKIP_REASON_KEYS, FEATURED_AWARD_SLOT_KEYS } from '../types/unions.js';\nimport { leagueIdSchema, teamIdSchema, userIdSchema } from './atoms.js';\n\nconst targetList = <T extends z.ZodTypeAny>(atom: T) => z.array(atom).max(MAX_AWARD_GRANT_TARGETS).optional();\n\n// An admin grants an award to accounts — named directly, or as every active real member of a team\n// or of a league — and revokes it from accounts. Recipients are resolved on the server, deduplicated,\n// and bounded by MAX_AWARD_GRANT_RECIPIENTS; ghosts hold no account and are skipped.\nexport const AdminUpdateAwardGrantsInputSchema = z\n .object({\n awardId: awardIdSchema,\n grantUserIds: targetList(userIdSchema),\n grantTeamIds: targetList(teamIdSchema),\n grantLeagueIds: targetList(leagueIdSchema),\n revokeUserIds: targetList(userIdSchema),\n })\n .strict()\n .refine(\n (input) =>\n [input.grantUserIds, input.grantTeamIds, input.grantLeagueIds, input.revokeUserIds].some(\n (list) => list !== undefined && list.length > 0,\n ),\n { message: 'Name someone to grant the award to or revoke it from.' },\n )\n .refine(\n (input) => !(input.grantUserIds ?? []).some((userId) => (input.revokeUserIds ?? []).includes(userId)),\n { message: 'An account cannot be granted and revoked the award in one change.', path: ['revokeUserIds'] },\n );\nexport type AdminUpdateAwardGrantsInput = z.infer<typeof AdminUpdateAwardGrantsInputSchema>;\n\nexport const AwardGrantSkipSchema = z\n .object({ userId: userIdSchema, reason: z.enum(AWARD_GRANT_SKIP_REASON_KEYS) })\n .strict();\nexport type AwardGrantSkip = z.infer<typeof AwardGrantSkipSchema>;\n\n// What the change did for each account it reached: granted now, already held, revoked now, not held\n// to begin with, or skipped with its reason. A retried call reports the accounts its first call\n// changed as already held or not held, and writes nothing again.\nexport const AdminUpdateAwardGrantsResultSchema = z\n .object({\n awardId: awardIdSchema,\n granted: z.array(userIdSchema),\n alreadyHeld: z.array(userIdSchema),\n revoked: z.array(userIdSchema),\n notHeld: z.array(userIdSchema),\n skipped: z.array(AwardGrantSkipSchema),\n })\n .strict();\nexport type AdminUpdateAwardGrantsResult = z.infer<typeof AdminUpdateAwardGrantsResultSchema>;\n\n// An admin deletes an award nobody holds. Its badge's files are retired with it.\nexport const AdminDeleteAwardDefinitionInputSchema = z.object({ awardId: awardIdSchema }).strict();\nexport type AdminDeleteAwardDefinitionInput = z.infer<typeof AdminDeleteAwardDefinitionInputSchema>;\n\n// `deleted` is false when the award was already gone: nothing was written.\nexport const AdminDeleteAwardDefinitionResultSchema = z\n .object({ awardId: awardIdSchema, deleted: z.boolean() })\n .strict();\nexport type AdminDeleteAwardDefinitionResult = z.infer<typeof AdminDeleteAwardDefinitionResultSchema>;\n\n// The signed-in account chooses which of its own awards to show beside its name: a primary and a\n// secondary badge, each an award it holds, or none. The input is the one change the person made —\n// set a slot, clear a slot, or swap the two — and the core applies it to the pair as stored, so a\n// change to one slot never writes back a stale value of the other. No user id is ever sent.\nconst featuredAwardSlotSchema = z.enum(FEATURED_AWARD_SLOT_KEYS);\nexport const UpdateFeaturedAwardsInputSchema = z.discriminatedUnion('action', [\n z.object({ action: z.literal('set'), slot: featuredAwardSlotSchema, awardId: awardIdSchema }).strict(),\n z.object({ action: z.literal('clear'), slot: featuredAwardSlotSchema }).strict(),\n z.object({ action: z.literal('swap') }).strict(),\n]);\nexport type UpdateFeaturedAwardsInput = z.infer<typeof UpdateFeaturedAwardsInputSchema>;\n\nexport const UpdateFeaturedAwardsResultSchema = z\n .object({\n userId: userIdSchema,\n primaryAwardId: awardIdSchema.nullable(),\n secondaryAwardId: awardIdSchema.nullable(),\n changed: z.boolean(),\n })\n .strict();\nexport type UpdateFeaturedAwardsResult = z.infer<typeof UpdateFeaturedAwardsResultSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"awards.js","sourceRoot":"","sources":["../../src/schemas/awards.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,EAAE;AACF,oGAAoG;AACpG,iGAAiG;AACjG,mGAAmG;AACnG,8EAA8E;AAE9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,2BAA2B,EAC3B,oBAAoB,GACrB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,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O,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACtG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE;IAChF,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;CACjD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,MAAM,EAAE,YAAY;IACpB,cAAc,EAAE,aAAa,CAAC,QAAQ,EAAE;IACxC,gBAAgB,EAAE,aAAa,CAAC,QAAQ,EAAE;IAC1C,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for the award catalog, award grants, and the badges an account features.\n//\n// An award is created by its first badge's publication (the `award-badge` upload, ./uploads.ts), so\n// no callable here creates one. Grants and revokes to named accounts share one input — two named\n// lists, never an action discriminator (BACKEND-002) — like the role roster's. A team's or a whole\n// league's grant is its own decision, carried out a page of people at a time.\n\nimport { z } from 'zod';\nimport { MAX_AWARD_GRANT_TARGETS } from '../constants/business.js';\nimport {\n awardGroupGrantActionSchema,\n awardGroupGrantDecisionSchema,\n awardGroupGrantStatusSchema,\n awardGroupTypeSchema,\n} from '../doc-schemas/award-group-grant.js';\nimport { countSchema, documentIdSegmentSchema, epochMsSchema } from '../doc-schemas/atoms.js';\nimport { awardIdSchema } from '../doc-schemas/catalogs.js';\nimport { AWARD_GRANT_SKIP_REASON_KEYS, FEATURED_AWARD_SLOT_KEYS } from '../types/unions.js';\nimport { userIdSchema } from './atoms.js';\n\nconst targetList = <T extends z.ZodTypeAny>(atom: T) => z.array(atom).max(MAX_AWARD_GRANT_TARGETS).optional();\n\n// An admin grants an award to named accounts and revokes it from named accounts, in one commit.\n// Recipients are deduplicated on the server; a ghost holds no account and is skipped.\nexport const AdminUpdateAwardGrantsInputSchema = z\n .object({\n awardId: awardIdSchema,\n grantUserIds: targetList(userIdSchema),\n revokeUserIds: targetList(userIdSchema),\n })\n .strict()\n .refine(\n (input) => [input.grantUserIds, input.revokeUserIds].some((list) => list !== undefined && list.length > 0),\n { message: 'Name someone to grant the award to or revoke it from.' },\n )\n .refine(\n (input) => !(input.grantUserIds ?? []).some((userId) => (input.revokeUserIds ?? []).includes(userId)),\n { message: 'An account cannot be granted and revoked the award in one change.', path: ['revokeUserIds'] },\n );\nexport type AdminUpdateAwardGrantsInput = z.infer<typeof AdminUpdateAwardGrantsInputSchema>;\n\nexport const AwardGrantSkipSchema = z\n .object({ userId: userIdSchema, reason: z.enum(AWARD_GRANT_SKIP_REASON_KEYS) })\n .strict();\nexport type AwardGrantSkip = z.infer<typeof AwardGrantSkipSchema>;\n\n// What the change did for each account it reached: granted now, already held, revoked now, not held\n// to begin with, or skipped with its reason. A retried call reports the accounts its first call\n// changed as already held or not held, and writes nothing again.\nexport const AdminUpdateAwardGrantsResultSchema = z\n .object({\n awardId: awardIdSchema,\n granted: z.array(userIdSchema),\n alreadyHeld: z.array(userIdSchema),\n revoked: z.array(userIdSchema),\n notHeld: z.array(userIdSchema),\n skipped: z.array(AwardGrantSkipSchema),\n })\n .strict();\nexport type AdminUpdateAwardGrantsResult = z.infer<typeof AdminUpdateAwardGrantsResultSchema>;\n\n// The group a group grant reaches: every active member of one team, or of one whole league.\n// `groupId` is that team's or league's id.\nexport const AwardGroupSchema = z\n .object({ groupType: awardGroupTypeSchema, groupId: documentIdSegmentSchema })\n .strict();\nexport type AwardGroup = z.infer<typeof AwardGroupSchema>;\n\n// An admin grants an award to a group, or takes back what the group's grants gave. The decision opens\n// at once and its people are reached a page at a time after the answer; a request the group's latest\n// decision already settles (granting what is granted, taking back what is not) opens nothing.\nexport const AdminUpdateAwardGroupGrantInputSchema = z\n .object({ awardId: awardIdSchema, action: awardGroupGrantActionSchema, group: AwardGroupSchema })\n .strict();\nexport type AdminUpdateAwardGroupGrantInput = z.infer<typeof AdminUpdateAwardGroupGrantInputSchema>;\n\n// Where one decision on an award for a group stands. `peopleReached` is how many people it has dealt\n// with so far: a grant's recorded people, or the people a revoke has taken the award back from or left\n// holding it. A pending decision that failed carries its failure and how many times it has tried; the\n// scheduled resume tries it again.\nexport const AwardGroupGrantProgressSchema = z\n .object({\n grantId: z.string().min(1),\n action: awardGroupGrantActionSchema,\n decision: awardGroupGrantDecisionSchema,\n status: awardGroupGrantStatusSchema,\n peopleReached: countSchema,\n attemptCount: countSchema,\n lastError: z.string().nullable(),\n createdAt: epochMsSchema,\n completedAt: epochMsSchema.nullable(),\n })\n .strict();\nexport type AwardGroupGrantProgress = z.infer<typeof AwardGroupGrantProgressSchema>;\n\n// `opened` is false when the group's latest decision already settled the request; `grant` is then that\n// decision, or null when the group has none.\nexport const AdminUpdateAwardGroupGrantResultSchema = z\n .object({ awardId: awardIdSchema, opened: z.boolean(), grant: AwardGroupGrantProgressSchema.nullable() })\n .strict();\nexport type AdminUpdateAwardGroupGrantResult = z.infer<typeof AdminUpdateAwardGroupGrantResultSchema>;\n\n// An admin reads the latest decision on an award for a group, so the progress survives a closed page.\nexport const AdminGetAwardGroupGrantStatusInputSchema = z\n .object({ awardId: awardIdSchema, group: AwardGroupSchema })\n .strict();\nexport type AdminGetAwardGroupGrantStatusInput = z.infer<typeof AdminGetAwardGroupGrantStatusInputSchema>;\nexport const AdminGetAwardGroupGrantStatusResultSchema = z\n .object({ grant: AwardGroupGrantProgressSchema.nullable() })\n .strict();\nexport type AdminGetAwardGroupGrantStatusResult = z.infer<typeof AdminGetAwardGroupGrantStatusResultSchema>;\n\n// An admin deletes an award nobody holds. Its badge's files are retired with it.\nexport const AdminDeleteAwardDefinitionInputSchema = z.object({ awardId: awardIdSchema }).strict();\nexport type AdminDeleteAwardDefinitionInput = z.infer<typeof AdminDeleteAwardDefinitionInputSchema>;\n\n// `deleted` is false when the award was already gone: nothing was written.\nexport const AdminDeleteAwardDefinitionResultSchema = z\n .object({ awardId: awardIdSchema, deleted: z.boolean() })\n .strict();\nexport type AdminDeleteAwardDefinitionResult = z.infer<typeof AdminDeleteAwardDefinitionResultSchema>;\n\n// The signed-in account chooses which of its own awards to show beside its name: a primary and a\n// secondary badge, each an award it holds, or none. The input is the one change the person made —\n// set a slot, clear a slot, or swap the two — and the core applies it to the pair as stored, so a\n// change to one slot never writes back a stale value of the other. No user id is ever sent.\nconst featuredAwardSlotSchema = z.enum(FEATURED_AWARD_SLOT_KEYS);\nexport const UpdateFeaturedAwardsInputSchema = z.discriminatedUnion('action', [\n z.object({ action: z.literal('set'), slot: featuredAwardSlotSchema, awardId: awardIdSchema }).strict(),\n z.object({ action: z.literal('clear'), slot: featuredAwardSlotSchema }).strict(),\n z.object({ action: z.literal('swap') }).strict(),\n]);\nexport type UpdateFeaturedAwardsInput = z.infer<typeof UpdateFeaturedAwardsInputSchema>;\n\nexport const UpdateFeaturedAwardsResultSchema = z\n .object({\n userId: userIdSchema,\n primaryAwardId: awardIdSchema.nullable(),\n secondaryAwardId: awardIdSchema.nullable(),\n changed: z.boolean(),\n })\n .strict();\nexport type UpdateFeaturedAwardsResult = z.infer<typeof UpdateFeaturedAwardsResultSchema>;\n"]}
|
|
@@ -5,11 +5,11 @@ export declare const playoffCutoffSchema: z.ZodNumber;
|
|
|
5
5
|
export declare const LEAGUE_SETTINGS_FIELD_KEYS: readonly ["leagueTitle", "description", "leagueStartDate", "leagueEndDate", "playoffCutoff", "playoffCutoffComp", "playoffCutoffRec", "requiresWaiver", "waiverTemplateId"];
|
|
6
6
|
export type LeagueSettingsField = (typeof LEAGUE_SETTINGS_FIELD_KEYS)[number];
|
|
7
7
|
export declare const leagueSettingsFieldSchema: z.ZodEnum<{
|
|
8
|
+
playoffCutoff: "playoffCutoff";
|
|
8
9
|
description: "description";
|
|
9
10
|
leagueEndDate: "leagueEndDate";
|
|
10
11
|
waiverTemplateId: "waiverTemplateId";
|
|
11
12
|
leagueStartDate: "leagueStartDate";
|
|
12
|
-
playoffCutoff: "playoffCutoff";
|
|
13
13
|
playoffCutoffComp: "playoffCutoffComp";
|
|
14
14
|
playoffCutoffRec: "playoffCutoffRec";
|
|
15
15
|
leagueTitle: "leagueTitle";
|
|
@@ -59,11 +59,11 @@ export type AdminUpdateSportLeagueInput = z.infer<typeof AdminUpdateSportLeagueI
|
|
|
59
59
|
export declare const AdminUpdateSportLeagueResultSchema: z.ZodObject<{
|
|
60
60
|
leagueId: z.ZodString;
|
|
61
61
|
changedFields: z.ZodArray<z.ZodEnum<{
|
|
62
|
+
playoffCutoff: "playoffCutoff";
|
|
62
63
|
description: "description";
|
|
63
64
|
leagueEndDate: "leagueEndDate";
|
|
64
65
|
waiverTemplateId: "waiverTemplateId";
|
|
65
66
|
leagueStartDate: "leagueStartDate";
|
|
66
|
-
playoffCutoff: "playoffCutoff";
|
|
67
67
|
playoffCutoffComp: "playoffCutoffComp";
|
|
68
68
|
playoffCutoffRec: "playoffCutoffRec";
|
|
69
69
|
leagueTitle: "leagueTitle";
|
|
@@ -123,8 +123,8 @@ export declare const MigrationActionPageResultSchema: z.ZodObject<{
|
|
|
123
123
|
updatedAt: z.ZodNumber;
|
|
124
124
|
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
125
125
|
status: z.ZodEnum<{
|
|
126
|
-
running: "running";
|
|
127
126
|
complete: "complete";
|
|
127
|
+
running: "running";
|
|
128
128
|
stopped: "stopped";
|
|
129
129
|
}>;
|
|
130
130
|
pages: z.ZodNumber;
|
|
@@ -426,8 +426,8 @@ export declare const MigrationStepStateSchema: z.ZodObject<{
|
|
|
426
426
|
updatedAt: z.ZodNumber;
|
|
427
427
|
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
428
428
|
status: z.ZodEnum<{
|
|
429
|
-
running: "running";
|
|
430
429
|
complete: "complete";
|
|
430
|
+
running: "running";
|
|
431
431
|
stopped: "stopped";
|
|
432
432
|
}>;
|
|
433
433
|
pages: z.ZodNumber;
|
|
@@ -461,8 +461,8 @@ export declare const MigrationStepStateSchema: z.ZodObject<{
|
|
|
461
461
|
updatedAt: z.ZodNumber;
|
|
462
462
|
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
463
463
|
status: z.ZodEnum<{
|
|
464
|
-
running: "running";
|
|
465
464
|
complete: "complete";
|
|
465
|
+
running: "running";
|
|
466
466
|
stopped: "stopped";
|
|
467
467
|
}>;
|
|
468
468
|
pages: z.ZodNumber;
|
|
@@ -870,8 +870,8 @@ export declare const GetMigrationConsoleResultSchema: z.ZodObject<{
|
|
|
870
870
|
updatedAt: z.ZodNumber;
|
|
871
871
|
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
872
872
|
status: z.ZodEnum<{
|
|
873
|
-
running: "running";
|
|
874
873
|
complete: "complete";
|
|
874
|
+
running: "running";
|
|
875
875
|
stopped: "stopped";
|
|
876
876
|
}>;
|
|
877
877
|
pages: z.ZodNumber;
|
|
@@ -905,8 +905,8 @@ export declare const GetMigrationConsoleResultSchema: z.ZodObject<{
|
|
|
905
905
|
updatedAt: z.ZodNumber;
|
|
906
906
|
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
907
907
|
status: z.ZodEnum<{
|
|
908
|
-
running: "running";
|
|
909
908
|
complete: "complete";
|
|
909
|
+
running: "running";
|
|
910
910
|
stopped: "stopped";
|
|
911
911
|
}>;
|
|
912
912
|
pages: z.ZodNumber;
|
|
@@ -1318,8 +1318,8 @@ export declare const RecordMigrationStepResultSchema: z.ZodObject<{
|
|
|
1318
1318
|
updatedAt: z.ZodNumber;
|
|
1319
1319
|
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
1320
1320
|
status: z.ZodEnum<{
|
|
1321
|
-
running: "running";
|
|
1322
1321
|
complete: "complete";
|
|
1322
|
+
running: "running";
|
|
1323
1323
|
stopped: "stopped";
|
|
1324
1324
|
}>;
|
|
1325
1325
|
pages: z.ZodNumber;
|
|
@@ -1353,8 +1353,8 @@ export declare const RecordMigrationStepResultSchema: z.ZodObject<{
|
|
|
1353
1353
|
updatedAt: z.ZodNumber;
|
|
1354
1354
|
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
1355
1355
|
status: z.ZodEnum<{
|
|
1356
|
-
running: "running";
|
|
1357
1356
|
complete: "complete";
|
|
1357
|
+
running: "running";
|
|
1358
1358
|
stopped: "stopped";
|
|
1359
1359
|
}>;
|
|
1360
1360
|
pages: z.ZodNumber;
|