@ttt-productions/q-core 0.1.50 → 0.1.52

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.
Files changed (63) hide show
  1. package/dist/constants/business.d.ts +3 -5
  2. package/dist/constants/business.d.ts.map +1 -1
  3. package/dist/constants/business.js +3 -5
  4. package/dist/constants/business.js.map +1 -1
  5. package/dist/constants/text-fields.d.ts +1 -1
  6. package/dist/constants/text-fields.d.ts.map +1 -1
  7. package/dist/constants/text-fields.js +2 -2
  8. package/dist/constants/text-fields.js.map +1 -1
  9. package/dist/doc-schemas/audit-event.d.ts +0 -2
  10. package/dist/doc-schemas/audit-event.d.ts.map +1 -1
  11. package/dist/doc-schemas/index.d.ts +0 -1
  12. package/dist/doc-schemas/index.d.ts.map +1 -1
  13. package/dist/doc-schemas/index.js +0 -1
  14. package/dist/doc-schemas/index.js.map +1 -1
  15. package/dist/doc-schemas/registry.d.ts +0 -39
  16. package/dist/doc-schemas/registry.d.ts.map +1 -1
  17. package/dist/doc-schemas/registry.js +0 -5
  18. package/dist/doc-schemas/registry.js.map +1 -1
  19. package/dist/ids/index.d.ts +0 -1
  20. package/dist/ids/index.d.ts.map +1 -1
  21. package/dist/ids/index.js +0 -1
  22. package/dist/ids/index.js.map +1 -1
  23. package/dist/paths/collection-groups.d.ts +0 -1
  24. package/dist/paths/collection-groups.d.ts.map +1 -1
  25. package/dist/paths/collection-groups.js +1 -2
  26. package/dist/paths/collection-groups.js.map +1 -1
  27. package/dist/paths/collection-refs.d.ts +0 -1
  28. package/dist/paths/collection-refs.d.ts.map +1 -1
  29. package/dist/paths/collection-refs.js +0 -1
  30. package/dist/paths/collection-refs.js.map +1 -1
  31. package/dist/paths/collections.d.ts +0 -4
  32. package/dist/paths/collections.d.ts.map +1 -1
  33. package/dist/paths/collections.js +0 -4
  34. package/dist/paths/collections.js.map +1 -1
  35. package/dist/paths/path-builders.d.ts +0 -3
  36. package/dist/paths/path-builders.d.ts.map +1 -1
  37. package/dist/paths/path-builders.js +1 -13
  38. package/dist/paths/path-builders.js.map +1 -1
  39. package/dist/schemas/awards.d.ts +5 -75
  40. package/dist/schemas/awards.d.ts.map +1 -1
  41. package/dist/schemas/awards.js +6 -30
  42. package/dist/schemas/awards.js.map +1 -1
  43. package/dist/types/audit.d.ts +1 -1
  44. package/dist/types/audit.d.ts.map +1 -1
  45. package/dist/types/audit.js +0 -1
  46. package/dist/types/audit.js.map +1 -1
  47. package/dist/types/schedules.d.ts +1 -1
  48. package/dist/types/schedules.d.ts.map +1 -1
  49. package/dist/types/schedules.js +1 -2
  50. package/dist/types/schedules.js.map +1 -1
  51. package/dist/types/unions.d.ts +0 -6
  52. package/dist/types/unions.d.ts.map +1 -1
  53. package/dist/types/unions.js +0 -3
  54. package/dist/types/unions.js.map +1 -1
  55. package/package.json +1 -1
  56. package/dist/doc-schemas/award-group-grant.d.ts +0 -54
  57. package/dist/doc-schemas/award-group-grant.d.ts.map +0 -1
  58. package/dist/doc-schemas/award-group-grant.js +0 -55
  59. package/dist/doc-schemas/award-group-grant.js.map +0 -1
  60. package/dist/ids/award-grant-ids.d.ts +0 -9
  61. package/dist/ids/award-grant-ids.d.ts.map +0 -1
  62. package/dist/ids/award-grant-ids.js +0 -10
  63. package/dist/ids/award-grant-ids.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"unions.js","sourceRoot":"","sources":["../../src/types/unions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,SAAS,CAAU,CAAC;AAG9D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAE9D,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAA6B,CAAC;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAA6B,CAAC;AAEhE,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,eAAe,EAAE,YAAY,CAAU,CAAC;AAE5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,KAAK;IACL,OAAO;IACP,UAAU;IACV,SAAS;IACT,MAAM;IACN,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,OAAO;IACP,MAAM;IACN,OAAO;IACP,QAAQ;IACR,SAAS;IACT,UAAU;IACV,UAAU;IACV,SAAS;IACT,OAAO;CACC,CAAC;AAGX,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAGhE,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,gBAAgB;IAChB,cAAc;IACd,uBAAuB;IACvB,kBAAkB;IAClB,gBAAgB;IAChB,qBAAqB;IACrB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,qBAAqB;IACrB,+BAA+B;CACvB,CAAC;AACX,MAAM,CAAC,MAAM,oCAAoC,GAAG;IAClD,mBAAmB;IACnB,qBAAqB;IACrB,uBAAuB;IACvB,4BAA4B;CACpB,CAAC;AACX,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,GAAG,+BAA+B;IAClC,GAAG,oCAAoC;CAC/B,CAAC","sourcesContent":["export const SYSTEM_ROLE_KEYS = ['admin', 'referee'] as const;\nexport type SystemRole = (typeof SYSTEM_ROLE_KEYS)[number];\n\nexport const USER_STATUS_KEYS = ['active', 'banned'] as const;\nexport type UserStatus = (typeof USER_STATUS_KEYS)[number];\nexport const ACTIVE_USER_STATUS = 'active' satisfies UserStatus;\nexport const BANNED_USER_STATUS = 'banned' satisfies UserStatus;\n\nexport const STATUS_RECONCILE_QUEUE_AUTH_EFFECTS = ['accountStatus', 'roleClaims'] as const;\nexport type StatusReconcileQueueAuthEffect = (typeof STATUS_RECONCILE_QUEUE_AUTH_EFFECTS)[number];\nexport const ACCOUNT_STATUS_AUTH_EFFECT =\n 'accountStatus' as const satisfies StatusReconcileQueueAuthEffect;\nexport const ROLE_CLAIMS_EFFECT = 'roleClaims' as const satisfies StatusReconcileQueueAuthEffect;\n\nexport const TEAM_ROLE_KEYS = ['captain', 'coCaptain', 'player'] as const;\nexport type TeamRole = (typeof TEAM_ROLE_KEYS)[number];\n\n// The roles that carry captain authority. `firestore.rules` restates this list, because a rules file\n// cannot import it.\nexport const CAPTAIN_TEAM_ROLES = ['captain', 'coCaptain'] as const satisfies readonly TeamRole[];\n\nexport const TEAM_CAPTAIN_ROLE = 'captain' as const satisfies TeamRole;\n\nexport const TEAM_CO_CAPTAIN_ROLE = 'coCaptain' as const satisfies TeamRole;\nexport const TEAM_PLAYER_ROLE = 'player' as const satisfies TeamRole;\n\nexport const MEMBER_ASSIGNABLE_TEAM_ROLES = [\n TEAM_CO_CAPTAIN_ROLE,\n TEAM_PLAYER_ROLE,\n] as const satisfies readonly TeamRole[];\nexport type MemberAssignableTeamRole = (typeof MEMBER_ASSIGNABLE_TEAM_ROLES)[number];\n\n// `TEAM_ROLE_KEYS` runs from the highest role down.\nexport function higherTeamRole(left: TeamRole, right: TeamRole): TeamRole {\n return TEAM_ROLE_KEYS.indexOf(left) <= TEAM_ROLE_KEYS.indexOf(right) ? left : right;\n}\n\nexport const TEAM_MEMBERSHIP_STATUS_KEYS = ['active'] as const;\nexport type TeamMembershipStatus = (typeof TEAM_MEMBERSHIP_STATUS_KEYS)[number];\n\nexport const ACTIVE_TEAM_MEMBERSHIP_STATUS = 'active' as const satisfies TeamMembershipStatus;\n\nexport const TEAM_JOIN_METHOD_KEYS = [\n 'teamCreation',\n 'invite',\n 'joinRequest',\n 'freeAgent',\n 'ghostAdd',\n] as const;\nexport type TeamJoinMethod = (typeof TEAM_JOIN_METHOD_KEYS)[number];\n\nexport const LEAGUE_STATUS_KEYS = ['pending', 'upcoming', 'active', 'closed'] as const;\nexport type LeagueStatus = (typeof LEAGUE_STATUS_KEYS)[number];\n\nexport const LEAGUE_STATUS_ON_CREATE = 'pending' as const satisfies LeagueStatus;\n\nexport const CLOSED_LEAGUE_STATUS = 'closed' as const satisfies LeagueStatus;\n\nexport const UPCOMING_LEAGUE_STATUS = 'upcoming' as const satisfies LeagueStatus;\nexport const ACTIVE_LEAGUE_STATUS = 'active' as const satisfies LeagueStatus;\n\nexport const LEAGUE_STATUS_TRANSITIONS: Readonly<Record<LeagueStatus, readonly LeagueStatus[]>> = {\n pending: ['upcoming', 'closed'],\n upcoming: ['active', 'closed'],\n active: ['closed'],\n closed: [],\n};\n\nexport const OPEN_LEAGUE_STATUS_KEYS: readonly Exclude<\n LeagueStatus,\n typeof CLOSED_LEAGUE_STATUS\n>[] = LEAGUE_STATUS_KEYS.filter(\n (status): status is Exclude<LeagueStatus, typeof CLOSED_LEAGUE_STATUS> =>\n status !== CLOSED_LEAGUE_STATUS,\n);\n\nexport const CURRENT_LEAGUE_STATUS_KEYS = [\n UPCOMING_LEAGUE_STATUS,\n ACTIVE_LEAGUE_STATUS,\n] as const satisfies readonly LeagueStatus[];\n\nexport const LEAGUE_MODE_KEYS = ['Regular', 'Competitive/Recreational'] as const;\nexport type LeagueMode = (typeof LEAGUE_MODE_KEYS)[number];\n\nexport const TEAM_TYPE_KEYS = ['Competitive', 'Recreational'] as const;\nexport type TeamType = (typeof TEAM_TYPE_KEYS)[number];\n\nexport const TEAM_TYPED_LEAGUE_MODE = 'Competitive/Recreational' as const satisfies LeagueMode;\n\nexport const TEAM_TYPE_ON_MODE_SWITCH = 'Recreational' as const satisfies TeamType;\n\nexport const GAME_STATUS_KEYS = ['scheduled', 'inprogress', 'completed'] as const;\nexport type GameStatus = (typeof GAME_STATUS_KEYS)[number];\n\nexport const COMPLETED_GAME_STATUS = 'completed' as const satisfies GameStatus;\n\nexport const GAME_STATUS_ON_CREATE = 'scheduled' as const satisfies GameStatus;\n\nexport const GAME_STATUS_ON_REOPEN = 'inprogress' as const satisfies GameStatus;\n\n// Only a pending invitation or join request exists: answering, withdrawing, or the person joining\n// the team deletes it.\nexport const TEAM_INVITATION_STATUS_KEYS = ['pending'] as const;\nexport type TeamInvitationStatus = (typeof TEAM_INVITATION_STATUS_KEYS)[number];\n\nexport const PENDING_TEAM_INVITATION_STATUS = 'pending' as const satisfies TeamInvitationStatus;\n\nexport const TEAM_JOIN_REQUEST_STATUS_KEYS = ['pending'] as const;\nexport type TeamJoinRequestStatus = (typeof TEAM_JOIN_REQUEST_STATUS_KEYS)[number];\n\nexport const PENDING_TEAM_JOIN_REQUEST_STATUS = 'pending' as const satisfies TeamJoinRequestStatus;\n\nexport const HARDWARE_LOAN_CONTRACT_STATUS_KEYS = ['pending', 'loaned', 'returned'] as const;\nexport type HardwareLoanContractStatus = (typeof HARDWARE_LOAN_CONTRACT_STATUS_KEYS)[number];\nexport const AWARD_GRANT_SKIP_REASON_KEYS = ['noProfile', 'ghost'] as const;\nexport type AwardGrantSkipReason = (typeof AWARD_GRANT_SKIP_REASON_KEYS)[number];\n\nexport const FEATURED_AWARD_SLOT_KEYS = ['primary', 'secondary'] as const;\nexport type FeaturedAwardSlot = (typeof FEATURED_AWARD_SLOT_KEYS)[number];\n\nexport const AWARD_GROUP_TYPE_KEYS = ['team', 'league'] as const;\nexport type AwardGroupType = (typeof AWARD_GROUP_TYPE_KEYS)[number];\n\nexport const AWARD_GROUP_GRANT_ACTION_KEYS = ['grant', 'revoke'] as const;\nexport type AwardGroupGrantAction = (typeof AWARD_GROUP_GRANT_ACTION_KEYS)[number];\n\nexport const AWARD_GROUP_GRANT_STATUS_KEYS = ['pending', 'complete'] as const;\nexport type AwardGroupGrantStatus = (typeof AWARD_GROUP_GRANT_STATUS_KEYS)[number];\n\nexport const AWARD_GROUP_REVOKE_SKIP_KEYS = ['heldBefore', 'heldByAnotherGrant'] as const;\nexport type AwardGroupRevokeSkip = (typeof AWARD_GROUP_REVOKE_SKIP_KEYS)[number];\n\nexport const PENDING_HARDWARE_LOAN_CONTRACT_STATUS =\n 'pending' as const satisfies HardwareLoanContractStatus;\nexport const LOANED_HARDWARE_LOAN_CONTRACT_STATUS =\n 'loaned' as const satisfies HardwareLoanContractStatus;\nexport const RETURNED_HARDWARE_LOAN_CONTRACT_STATUS =\n 'returned' as const satisfies HardwareLoanContractStatus;\n\nexport const WAIVER_TEMPLATE_DELETE_OUTCOME_KEYS = ['deleted', 'retired'] as const;\nexport type WaiverTemplateDeleteOutcome = (typeof WAIVER_TEMPLATE_DELETE_OUTCOME_KEYS)[number];\n\nexport const STATS_BEACON_ACTION_KEYS = [\n 'finalize',\n 'reopen',\n 'recalculate',\n 'correct',\n 'historical-update',\n 'link',\n] as const;\nexport type StatsBeaconAction = (typeof STATS_BEACON_ACTION_KEYS)[number];\n\nexport const GAME_SCOPED_STATS_BEACON_ACTION_KEYS = [\n 'finalize',\n 'reopen',\n] as const satisfies readonly StatsBeaconAction[];\nexport type GameScopedStatsBeaconAction = (typeof GAME_SCOPED_STATS_BEACON_ACTION_KEYS)[number];\n\n// Listed explicitly, so a status added later is closed until it is named here, never open by default.\nexport const OPEN_GAME_STATUS_KEYS = [\n 'scheduled',\n 'inprogress',\n] as const satisfies readonly GameStatus[];\nexport type OpenGameStatus = (typeof OPEN_GAME_STATUS_KEYS)[number];\n\nexport function isOpenGameStatus(status: GameStatus): status is OpenGameStatus {\n return (OPEN_GAME_STATUS_KEYS as readonly GameStatus[]).includes(status);\n}\n\nexport const WAIVER_WITNESS_AUTHORITY_KEYS = ['captain', 'coCaptain', 'admin', 'referee'] as const;\nexport type WaiverWitnessAuthority = (typeof WAIVER_WITNESS_AUTHORITY_KEYS)[number];\n\nexport const WAIVER_SIGNING_REFUSAL_KEYS = ['waiverChanged'] as const;\nexport type WaiverSigningRefusal = (typeof WAIVER_SIGNING_REFUSAL_KEYS)[number];\n\nexport const WAIVER_TEMPLATE_EDIT_REFUSAL_KEYS = ['templateVersionChanged'] as const;\nexport type WaiverTemplateEditRefusal = (typeof WAIVER_TEMPLATE_EDIT_REFUSAL_KEYS)[number];\n\nexport const TEAM_ICON_KEYS = [\n 'Shield',\n 'Swords',\n 'Skull',\n 'Ghost',\n 'Cat',\n 'Dog',\n 'Bird',\n 'Fish',\n 'Rabbit',\n 'Snail',\n 'Turtle',\n 'Cherry',\n 'Apple',\n 'Grape',\n 'Rocket',\n 'Plane',\n 'Ship',\n 'Train',\n 'Car',\n 'Bike',\n 'Bolt',\n 'Star',\n 'Sun',\n 'Moon',\n 'Cloud',\n 'Crown',\n 'Diamond',\n 'Gem',\n 'Anchor',\n // Appended — the set only grows, and no stored key is ever renamed or removed.\n 'TreePine',\n 'Trees',\n 'TreeDeciduous',\n 'TreePalm',\n 'Snowflake',\n 'MountainSnow',\n 'Gift',\n 'PartyPopper',\n 'CandyCane',\n 'Candy',\n 'Lollipop',\n 'Cake',\n 'Egg',\n 'Clover',\n 'Heart',\n 'Flower',\n 'Flower2',\n 'Rose',\n 'Leaf',\n 'Sprout',\n 'Wheat',\n 'Sunrise',\n 'Rainbow',\n 'Bell',\n 'Trophy',\n 'Medal',\n 'Award',\n 'Ribbon',\n 'Flag',\n 'Target',\n 'Crosshair',\n 'Goal',\n 'Dumbbell',\n 'Footprints',\n 'Zap',\n 'Flame',\n 'FlameKindling',\n 'Bomb',\n 'Atom',\n 'Orbit',\n 'Sparkles',\n 'WandSparkles',\n 'Mountain',\n 'Tornado',\n 'Wind',\n 'Droplet',\n 'CloudLightning',\n 'MoonStar',\n 'Sword',\n 'Axe',\n 'Hammer',\n 'Pickaxe',\n 'ShieldHalf',\n 'Castle',\n 'Squirrel',\n 'Rat',\n 'Panda',\n 'Shrimp',\n 'Worm',\n 'Bug',\n 'Shell',\n 'PawPrint',\n 'Feather',\n 'Bone',\n 'Origami',\n 'Citrus',\n 'Banana',\n 'Carrot',\n 'Pizza',\n 'Cookie',\n 'Donut',\n 'Coffee',\n 'Dices',\n 'Puzzle',\n 'Gamepad2',\n 'Spade',\n 'Club',\n 'Music',\n 'Guitar',\n 'Hexagon',\n 'Triangle',\n 'Sailboat',\n 'Tractor',\n 'Truck',\n] as const;\nexport type TeamIcon = (typeof TEAM_ICON_KEYS)[number];\n\nexport const PICTURE_VARIANT_KEYS = ['sm', 'md', 'lg'] as const;\nexport type PictureVariantKey = (typeof PICTURE_VARIANT_KEYS)[number];\n\nexport const GAME_TIER_DISCREPANCY_KIND_KEYS = [\n 'gameUnreadable',\n 'invalidEvent',\n 'eventSequenceMismatch',\n 'eventSequenceGap',\n 'rollupMismatch',\n 'scoreMirrorMismatch',\n 'unrosteredStatLine',\n 'fantasyPointsStale',\n 'finalRecordMissing',\n 'finalRecordMismatch',\n 'participationSnapshotMismatch',\n] as const;\nexport const AGGREGATE_TIER_DISCREPANCY_KIND_KEYS = [\n 'aggregateMismatch',\n 'aggregateEntryStale',\n 'aggregateEntryMissing',\n 'hallOfFameLifetimeMismatch',\n] as const;\nexport const STATS_DISCREPANCY_KIND_KEYS = [\n ...GAME_TIER_DISCREPANCY_KIND_KEYS,\n ...AGGREGATE_TIER_DISCREPANCY_KIND_KEYS,\n] as const;\nexport type StatsDiscrepancyKind = (typeof STATS_DISCREPANCY_KIND_KEYS)[number];\n"]}
1
+ {"version":3,"file":"unions.js","sourceRoot":"","sources":["../../src/types/unions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,SAAS,CAAU,CAAC;AAG9D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAE9D,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAA6B,CAAC;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAA6B,CAAC;AAEhE,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,eAAe,EAAE,YAAY,CAAU,CAAC;AAE5F,MAAM,CAAC,MAAM,0BAA0B,GACrC,eAAiE,CAAC;AACpE,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAA8D,CAAC;AAEjG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,Q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BAA+B,GAAG;IAC7C,gBAAgB;IAChB,cAAc;IACd,uBAAuB;IACvB,kBAAkB;IAClB,gBAAgB;IAChB,qBAAqB;IACrB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,qBAAqB;IACrB,+BAA+B;CACvB,CAAC;AACX,MAAM,CAAC,MAAM,oCAAoC,GAAG;IAClD,mBAAmB;IACnB,qBAAqB;IACrB,uBAAuB;IACvB,4BAA4B;CACpB,CAAC;AACX,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,GAAG,+BAA+B;IAClC,GAAG,oCAAoC;CAC/B,CAAC","sourcesContent":["export const SYSTEM_ROLE_KEYS = ['admin', 'referee'] as const;\nexport type SystemRole = (typeof SYSTEM_ROLE_KEYS)[number];\n\nexport const USER_STATUS_KEYS = ['active', 'banned'] as const;\nexport type UserStatus = (typeof USER_STATUS_KEYS)[number];\nexport const ACTIVE_USER_STATUS = 'active' satisfies UserStatus;\nexport const BANNED_USER_STATUS = 'banned' satisfies UserStatus;\n\nexport const STATUS_RECONCILE_QUEUE_AUTH_EFFECTS = ['accountStatus', 'roleClaims'] as const;\nexport type StatusReconcileQueueAuthEffect = (typeof STATUS_RECONCILE_QUEUE_AUTH_EFFECTS)[number];\nexport const ACCOUNT_STATUS_AUTH_EFFECT =\n 'accountStatus' as const satisfies StatusReconcileQueueAuthEffect;\nexport const ROLE_CLAIMS_EFFECT = 'roleClaims' as const satisfies StatusReconcileQueueAuthEffect;\n\nexport const TEAM_ROLE_KEYS = ['captain', 'coCaptain', 'player'] as const;\nexport type TeamRole = (typeof TEAM_ROLE_KEYS)[number];\n\n// The roles that carry captain authority. `firestore.rules` restates this list, because a rules file\n// cannot import it.\nexport const CAPTAIN_TEAM_ROLES = ['captain', 'coCaptain'] as const satisfies readonly TeamRole[];\n\nexport const TEAM_CAPTAIN_ROLE = 'captain' as const satisfies TeamRole;\n\nexport const TEAM_CO_CAPTAIN_ROLE = 'coCaptain' as const satisfies TeamRole;\nexport const TEAM_PLAYER_ROLE = 'player' as const satisfies TeamRole;\n\nexport const MEMBER_ASSIGNABLE_TEAM_ROLES = [\n TEAM_CO_CAPTAIN_ROLE,\n TEAM_PLAYER_ROLE,\n] as const satisfies readonly TeamRole[];\nexport type MemberAssignableTeamRole = (typeof MEMBER_ASSIGNABLE_TEAM_ROLES)[number];\n\n// `TEAM_ROLE_KEYS` runs from the highest role down.\nexport function higherTeamRole(left: TeamRole, right: TeamRole): TeamRole {\n return TEAM_ROLE_KEYS.indexOf(left) <= TEAM_ROLE_KEYS.indexOf(right) ? left : right;\n}\n\nexport const TEAM_MEMBERSHIP_STATUS_KEYS = ['active'] as const;\nexport type TeamMembershipStatus = (typeof TEAM_MEMBERSHIP_STATUS_KEYS)[number];\n\nexport const ACTIVE_TEAM_MEMBERSHIP_STATUS = 'active' as const satisfies TeamMembershipStatus;\n\nexport const TEAM_JOIN_METHOD_KEYS = [\n 'teamCreation',\n 'invite',\n 'joinRequest',\n 'freeAgent',\n 'ghostAdd',\n] as const;\nexport type TeamJoinMethod = (typeof TEAM_JOIN_METHOD_KEYS)[number];\n\nexport const LEAGUE_STATUS_KEYS = ['pending', 'upcoming', 'active', 'closed'] as const;\nexport type LeagueStatus = (typeof LEAGUE_STATUS_KEYS)[number];\n\nexport const LEAGUE_STATUS_ON_CREATE = 'pending' as const satisfies LeagueStatus;\n\nexport const CLOSED_LEAGUE_STATUS = 'closed' as const satisfies LeagueStatus;\n\nexport const UPCOMING_LEAGUE_STATUS = 'upcoming' as const satisfies LeagueStatus;\nexport const ACTIVE_LEAGUE_STATUS = 'active' as const satisfies LeagueStatus;\n\nexport const LEAGUE_STATUS_TRANSITIONS: Readonly<Record<LeagueStatus, readonly LeagueStatus[]>> = {\n pending: ['upcoming', 'closed'],\n upcoming: ['active', 'closed'],\n active: ['closed'],\n closed: [],\n};\n\nexport const OPEN_LEAGUE_STATUS_KEYS: readonly Exclude<\n LeagueStatus,\n typeof CLOSED_LEAGUE_STATUS\n>[] = LEAGUE_STATUS_KEYS.filter(\n (status): status is Exclude<LeagueStatus, typeof CLOSED_LEAGUE_STATUS> =>\n status !== CLOSED_LEAGUE_STATUS,\n);\n\nexport const CURRENT_LEAGUE_STATUS_KEYS = [\n UPCOMING_LEAGUE_STATUS,\n ACTIVE_LEAGUE_STATUS,\n] as const satisfies readonly LeagueStatus[];\n\nexport const LEAGUE_MODE_KEYS = ['Regular', 'Competitive/Recreational'] as const;\nexport type LeagueMode = (typeof LEAGUE_MODE_KEYS)[number];\n\nexport const TEAM_TYPE_KEYS = ['Competitive', 'Recreational'] as const;\nexport type TeamType = (typeof TEAM_TYPE_KEYS)[number];\n\nexport const TEAM_TYPED_LEAGUE_MODE = 'Competitive/Recreational' as const satisfies LeagueMode;\n\nexport const TEAM_TYPE_ON_MODE_SWITCH = 'Recreational' as const satisfies TeamType;\n\nexport const GAME_STATUS_KEYS = ['scheduled', 'inprogress', 'completed'] as const;\nexport type GameStatus = (typeof GAME_STATUS_KEYS)[number];\n\nexport const COMPLETED_GAME_STATUS = 'completed' as const satisfies GameStatus;\n\nexport const GAME_STATUS_ON_CREATE = 'scheduled' as const satisfies GameStatus;\n\nexport const GAME_STATUS_ON_REOPEN = 'inprogress' as const satisfies GameStatus;\n\n// Only a pending invitation or join request exists: answering, withdrawing, or the person joining\n// the team deletes it.\nexport const TEAM_INVITATION_STATUS_KEYS = ['pending'] as const;\nexport type TeamInvitationStatus = (typeof TEAM_INVITATION_STATUS_KEYS)[number];\n\nexport const PENDING_TEAM_INVITATION_STATUS = 'pending' as const satisfies TeamInvitationStatus;\n\nexport const TEAM_JOIN_REQUEST_STATUS_KEYS = ['pending'] as const;\nexport type TeamJoinRequestStatus = (typeof TEAM_JOIN_REQUEST_STATUS_KEYS)[number];\n\nexport const PENDING_TEAM_JOIN_REQUEST_STATUS = 'pending' as const satisfies TeamJoinRequestStatus;\n\nexport const HARDWARE_LOAN_CONTRACT_STATUS_KEYS = ['pending', 'loaned', 'returned'] as const;\nexport type HardwareLoanContractStatus = (typeof HARDWARE_LOAN_CONTRACT_STATUS_KEYS)[number];\nexport const AWARD_GRANT_SKIP_REASON_KEYS = ['noProfile', 'ghost'] as const;\nexport type AwardGrantSkipReason = (typeof AWARD_GRANT_SKIP_REASON_KEYS)[number];\n\nexport const FEATURED_AWARD_SLOT_KEYS = ['primary', 'secondary'] as const;\nexport type FeaturedAwardSlot = (typeof FEATURED_AWARD_SLOT_KEYS)[number];\n\nexport const AWARD_GROUP_TYPE_KEYS = ['team', 'league'] as const;\nexport type AwardGroupType = (typeof AWARD_GROUP_TYPE_KEYS)[number];\n\nexport const PENDING_HARDWARE_LOAN_CONTRACT_STATUS =\n 'pending' as const satisfies HardwareLoanContractStatus;\nexport const LOANED_HARDWARE_LOAN_CONTRACT_STATUS =\n 'loaned' as const satisfies HardwareLoanContractStatus;\nexport const RETURNED_HARDWARE_LOAN_CONTRACT_STATUS =\n 'returned' as const satisfies HardwareLoanContractStatus;\n\nexport const WAIVER_TEMPLATE_DELETE_OUTCOME_KEYS = ['deleted', 'retired'] as const;\nexport type WaiverTemplateDeleteOutcome = (typeof WAIVER_TEMPLATE_DELETE_OUTCOME_KEYS)[number];\n\nexport const STATS_BEACON_ACTION_KEYS = [\n 'finalize',\n 'reopen',\n 'recalculate',\n 'correct',\n 'historical-update',\n 'link',\n] as const;\nexport type StatsBeaconAction = (typeof STATS_BEACON_ACTION_KEYS)[number];\n\nexport const GAME_SCOPED_STATS_BEACON_ACTION_KEYS = [\n 'finalize',\n 'reopen',\n] as const satisfies readonly StatsBeaconAction[];\nexport type GameScopedStatsBeaconAction = (typeof GAME_SCOPED_STATS_BEACON_ACTION_KEYS)[number];\n\n// Listed explicitly, so a status added later is closed until it is named here, never open by default.\nexport const OPEN_GAME_STATUS_KEYS = [\n 'scheduled',\n 'inprogress',\n] as const satisfies readonly GameStatus[];\nexport type OpenGameStatus = (typeof OPEN_GAME_STATUS_KEYS)[number];\n\nexport function isOpenGameStatus(status: GameStatus): status is OpenGameStatus {\n return (OPEN_GAME_STATUS_KEYS as readonly GameStatus[]).includes(status);\n}\n\nexport const WAIVER_WITNESS_AUTHORITY_KEYS = ['captain', 'coCaptain', 'admin', 'referee'] as const;\nexport type WaiverWitnessAuthority = (typeof WAIVER_WITNESS_AUTHORITY_KEYS)[number];\n\nexport const WAIVER_SIGNING_REFUSAL_KEYS = ['waiverChanged'] as const;\nexport type WaiverSigningRefusal = (typeof WAIVER_SIGNING_REFUSAL_KEYS)[number];\n\nexport const WAIVER_TEMPLATE_EDIT_REFUSAL_KEYS = ['templateVersionChanged'] as const;\nexport type WaiverTemplateEditRefusal = (typeof WAIVER_TEMPLATE_EDIT_REFUSAL_KEYS)[number];\n\nexport const TEAM_ICON_KEYS = [\n 'Shield',\n 'Swords',\n 'Skull',\n 'Ghost',\n 'Cat',\n 'Dog',\n 'Bird',\n 'Fish',\n 'Rabbit',\n 'Snail',\n 'Turtle',\n 'Cherry',\n 'Apple',\n 'Grape',\n 'Rocket',\n 'Plane',\n 'Ship',\n 'Train',\n 'Car',\n 'Bike',\n 'Bolt',\n 'Star',\n 'Sun',\n 'Moon',\n 'Cloud',\n 'Crown',\n 'Diamond',\n 'Gem',\n 'Anchor',\n // Appended — the set only grows, and no stored key is ever renamed or removed.\n 'TreePine',\n 'Trees',\n 'TreeDeciduous',\n 'TreePalm',\n 'Snowflake',\n 'MountainSnow',\n 'Gift',\n 'PartyPopper',\n 'CandyCane',\n 'Candy',\n 'Lollipop',\n 'Cake',\n 'Egg',\n 'Clover',\n 'Heart',\n 'Flower',\n 'Flower2',\n 'Rose',\n 'Leaf',\n 'Sprout',\n 'Wheat',\n 'Sunrise',\n 'Rainbow',\n 'Bell',\n 'Trophy',\n 'Medal',\n 'Award',\n 'Ribbon',\n 'Flag',\n 'Target',\n 'Crosshair',\n 'Goal',\n 'Dumbbell',\n 'Footprints',\n 'Zap',\n 'Flame',\n 'FlameKindling',\n 'Bomb',\n 'Atom',\n 'Orbit',\n 'Sparkles',\n 'WandSparkles',\n 'Mountain',\n 'Tornado',\n 'Wind',\n 'Droplet',\n 'CloudLightning',\n 'MoonStar',\n 'Sword',\n 'Axe',\n 'Hammer',\n 'Pickaxe',\n 'ShieldHalf',\n 'Castle',\n 'Squirrel',\n 'Rat',\n 'Panda',\n 'Shrimp',\n 'Worm',\n 'Bug',\n 'Shell',\n 'PawPrint',\n 'Feather',\n 'Bone',\n 'Origami',\n 'Citrus',\n 'Banana',\n 'Carrot',\n 'Pizza',\n 'Cookie',\n 'Donut',\n 'Coffee',\n 'Dices',\n 'Puzzle',\n 'Gamepad2',\n 'Spade',\n 'Club',\n 'Music',\n 'Guitar',\n 'Hexagon',\n 'Triangle',\n 'Sailboat',\n 'Tractor',\n 'Truck',\n] as const;\nexport type TeamIcon = (typeof TEAM_ICON_KEYS)[number];\n\nexport const PICTURE_VARIANT_KEYS = ['sm', 'md', 'lg'] as const;\nexport type PictureVariantKey = (typeof PICTURE_VARIANT_KEYS)[number];\n\nexport const GAME_TIER_DISCREPANCY_KIND_KEYS = [\n 'gameUnreadable',\n 'invalidEvent',\n 'eventSequenceMismatch',\n 'eventSequenceGap',\n 'rollupMismatch',\n 'scoreMirrorMismatch',\n 'unrosteredStatLine',\n 'fantasyPointsStale',\n 'finalRecordMissing',\n 'finalRecordMismatch',\n 'participationSnapshotMismatch',\n] as const;\nexport const AGGREGATE_TIER_DISCREPANCY_KIND_KEYS = [\n 'aggregateMismatch',\n 'aggregateEntryStale',\n 'aggregateEntryMissing',\n 'hallOfFameLifetimeMismatch',\n] as const;\nexport const STATS_DISCREPANCY_KIND_KEYS = [\n ...GAME_TIER_DISCREPANCY_KIND_KEYS,\n ...AGGREGATE_TIER_DISCREPANCY_KIND_KEYS,\n] as const;\nexport type StatsDiscrepancyKind = (typeof STATS_DISCREPANCY_KIND_KEYS)[number];\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttt-productions/q-core",
3
- "version": "0.1.50",
3
+ "version": "0.1.52",
4
4
  "description": "Core types, Firestore path constants, zod schemas, and shared constants for Q-Sports",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,54 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const awardGroupTypeSchema: z.ZodEnum<{
3
- team: "team";
4
- league: "league";
5
- }>;
6
- export declare const awardGroupGrantActionSchema: z.ZodEnum<{
7
- grant: "grant";
8
- revoke: "revoke";
9
- }>;
10
- export declare const awardGroupGrantStatusSchema: z.ZodEnum<{
11
- complete: "complete";
12
- pending: "pending";
13
- }>;
14
- export declare const awardGroupGrantDecisionSchema: z.ZodNumber;
15
- export declare const AwardGroupGrantSchema: z.ZodObject<{
16
- grantId: z.ZodString;
17
- action: z.ZodEnum<{
18
- grant: "grant";
19
- revoke: "revoke";
20
- }>;
21
- awardId: z.ZodString;
22
- groupType: z.ZodEnum<{
23
- team: "team";
24
- league: "league";
25
- }>;
26
- groupId: z.ZodString;
27
- targetKey: z.ZodString;
28
- decision: z.ZodNumber;
29
- actorUid: z.ZodString;
30
- status: z.ZodEnum<{
31
- complete: "complete";
32
- pending: "pending";
33
- }>;
34
- createdAt: z.ZodNumber;
35
- completedAt: z.ZodOptional<z.ZodNumber>;
36
- attemptCount: z.ZodNumber;
37
- nextAttemptAt: z.ZodNumber;
38
- lastError: z.ZodOptional<z.ZodString>;
39
- }, z.core.$strip>;
40
- export type AwardGroupGrant = z.infer<typeof AwardGroupGrantSchema>;
41
- export declare function awardGroupGrantOpens(latest: Pick<AwardGroupGrant, 'action'> | null, action: AwardGroupGrant['action']): boolean;
42
- export declare const AwardGroupGrantPersonSchema: z.ZodObject<{
43
- userId: z.ZodString;
44
- heldBefore: z.ZodBoolean;
45
- recordedAt: z.ZodNumber;
46
- revoked: z.ZodBoolean;
47
- revokedAt: z.ZodOptional<z.ZodNumber>;
48
- revokeSkipped: z.ZodOptional<z.ZodEnum<{
49
- heldBefore: "heldBefore";
50
- heldByAnotherGrant: "heldByAnotherGrant";
51
- }>>;
52
- }, z.core.$strip>;
53
- export type AwardGroupGrantPerson = z.infer<typeof AwardGroupGrantPersonSchema>;
54
- //# sourceMappingURL=award-group-grant.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"award-group-grant.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/award-group-grant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,oBAAoB;;;EAAgC,CAAC;AAClE,eAAO,MAAM,2BAA2B;;;EAAwC,CAAC;AACjF,eAAO,MAAM,2BAA2B;;;EAAwC,CAAC;AAEjF,eAAO,MAAM,6BAA6B,aAAiB,CAAC;AAE5D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;iBAiC9B,CAAC;AACL,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,GAAG,IAAI,EAC9C,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,GAChC,OAAO,CAET;AAED,eAAO,MAAM,2BAA2B;;;;;;;;;;iBAOtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
@@ -1,55 +0,0 @@
1
- import { z } from 'zod';
2
- import { buildAwardGroupGrantId, buildAwardGroupGrantTargetKey } from '../ids/award-grant-ids.js';
3
- import { AWARD_GROUP_GRANT_ACTION_KEYS, AWARD_GROUP_GRANT_STATUS_KEYS, AWARD_GROUP_REVOKE_SKIP_KEYS, AWARD_GROUP_TYPE_KEYS, } from '../types/unions.js';
4
- import { countSchema, documentIdSegmentSchema, epochMsSchema, revisionSchema, userIdSchema, } from './atoms.js';
5
- import { awardIdSchema } from './catalogs.js';
6
- export const awardGroupTypeSchema = z.enum(AWARD_GROUP_TYPE_KEYS);
7
- export const awardGroupGrantActionSchema = z.enum(AWARD_GROUP_GRANT_ACTION_KEYS);
8
- export const awardGroupGrantStatusSchema = z.enum(AWARD_GROUP_GRANT_STATUS_KEYS);
9
- export const awardGroupGrantDecisionSchema = revisionSchema;
10
- export const AwardGroupGrantSchema = z
11
- .object({
12
- grantId: z.string().min(1),
13
- action: awardGroupGrantActionSchema,
14
- awardId: awardIdSchema,
15
- groupType: awardGroupTypeSchema,
16
- groupId: documentIdSegmentSchema,
17
- targetKey: z.string().min(1),
18
- decision: awardGroupGrantDecisionSchema,
19
- actorUid: userIdSchema,
20
- status: awardGroupGrantStatusSchema,
21
- createdAt: epochMsSchema,
22
- completedAt: epochMsSchema.optional(),
23
- attemptCount: countSchema,
24
- nextAttemptAt: epochMsSchema,
25
- lastError: z.string().optional(),
26
- })
27
- .superRefine((grant, ctx) => {
28
- const targetKey = buildAwardGroupGrantTargetKey(grant);
29
- if (grant.targetKey !== targetKey) {
30
- ctx.addIssue({
31
- code: 'custom',
32
- path: ['targetKey'],
33
- message: 'targetKey must be the award and group target key.',
34
- });
35
- }
36
- if (grant.grantId !== buildAwardGroupGrantId(targetKey, grant.decision)) {
37
- ctx.addIssue({
38
- code: 'custom',
39
- path: ['grantId'],
40
- message: 'grantId must be the target key and the decision.',
41
- });
42
- }
43
- });
44
- export function awardGroupGrantOpens(latest, action) {
45
- return action === 'grant' ? latest?.action !== 'grant' : latest?.action === 'grant';
46
- }
47
- export const AwardGroupGrantPersonSchema = z.object({
48
- userId: userIdSchema,
49
- heldBefore: z.boolean(),
50
- recordedAt: epochMsSchema,
51
- revoked: z.boolean(),
52
- revokedAt: epochMsSchema.optional(),
53
- revokeSkipped: z.enum(AWARD_GROUP_REVOKE_SKIP_KEYS).optional(),
54
- });
55
- //# sourceMappingURL=award-group-grant.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"award-group-grant.js","sourceRoot":"","sources":["../../src/doc-schemas/award-group-grant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC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AC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAC1B,MAAM,SAAS,GAAG,6BAA6B,CAAC,KAAK,CAAC,CAAC;IACvD,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QAClC,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,WAAW,CAAC;YACnB,OAAO,EAAE,mDAAmD;SAC7D,CAAC,CAAC;IACL,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,KAAK,sBAAsB,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxE,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,SAAS,CAAC;YACjB,OAAO,EAAE,kDAAkD;SAC5D,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC;AAGL,MAAM,UAAU,oBAAoB,CAClC,MAA8C,EAC9C,MAAiC;IAEjC,OAAO,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;AACtF,CAAC;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,MAAM,EAAE,YAAY;IACpB,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE;IACvB,UAAU,EAAE,aAAa;IACzB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,SAAS,EAAE,aAAa,CAAC,QAAQ,EAAE;IACnC,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,QAAQ,EAAE;CAC/D,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { buildAwardGroupGrantId, buildAwardGroupGrantTargetKey } from '../ids/award-grant-ids.js';\nimport {\n AWARD_GROUP_GRANT_ACTION_KEYS,\n AWARD_GROUP_GRANT_STATUS_KEYS,\n AWARD_GROUP_REVOKE_SKIP_KEYS,\n AWARD_GROUP_TYPE_KEYS,\n} from '../types/unions.js';\nimport {\n countSchema,\n documentIdSegmentSchema,\n epochMsSchema,\n revisionSchema,\n userIdSchema,\n} from './atoms.js';\nimport { awardIdSchema } from './catalogs.js';\n\nexport const awardGroupTypeSchema = z.enum(AWARD_GROUP_TYPE_KEYS);\nexport const awardGroupGrantActionSchema = z.enum(AWARD_GROUP_GRANT_ACTION_KEYS);\nexport const awardGroupGrantStatusSchema = z.enum(AWARD_GROUP_GRANT_STATUS_KEYS);\n\nexport const awardGroupGrantDecisionSchema = revisionSchema;\n\nexport const AwardGroupGrantSchema = z\n .object({\n grantId: z.string().min(1),\n action: awardGroupGrantActionSchema,\n awardId: awardIdSchema,\n groupType: awardGroupTypeSchema,\n groupId: documentIdSegmentSchema,\n targetKey: z.string().min(1),\n decision: awardGroupGrantDecisionSchema,\n actorUid: userIdSchema,\n status: awardGroupGrantStatusSchema,\n createdAt: epochMsSchema,\n completedAt: epochMsSchema.optional(),\n attemptCount: countSchema,\n nextAttemptAt: epochMsSchema,\n lastError: z.string().optional(),\n })\n .superRefine((grant, ctx) => {\n const targetKey = buildAwardGroupGrantTargetKey(grant);\n if (grant.targetKey !== targetKey) {\n ctx.addIssue({\n code: 'custom',\n path: ['targetKey'],\n message: 'targetKey must be the award and group target key.',\n });\n }\n if (grant.grantId !== buildAwardGroupGrantId(targetKey, grant.decision)) {\n ctx.addIssue({\n code: 'custom',\n path: ['grantId'],\n message: 'grantId must be the target key and the decision.',\n });\n }\n });\nexport type AwardGroupGrant = z.infer<typeof AwardGroupGrantSchema>;\n\nexport function awardGroupGrantOpens(\n latest: Pick<AwardGroupGrant, 'action'> | null,\n action: AwardGroupGrant['action'],\n): boolean {\n return action === 'grant' ? latest?.action !== 'grant' : latest?.action === 'grant';\n}\n\nexport const AwardGroupGrantPersonSchema = z.object({\n userId: userIdSchema,\n heldBefore: z.boolean(),\n recordedAt: epochMsSchema,\n revoked: z.boolean(),\n revokedAt: epochMsSchema.optional(),\n revokeSkipped: z.enum(AWARD_GROUP_REVOKE_SKIP_KEYS).optional(),\n});\nexport type AwardGroupGrantPerson = z.infer<typeof AwardGroupGrantPersonSchema>;\n"]}
@@ -1,9 +0,0 @@
1
- import type { AwardGroupType } from '../types/unions.js';
2
- export interface AwardGroupGrantTarget {
3
- readonly awardId: string;
4
- readonly groupType: AwardGroupType;
5
- readonly groupId: string;
6
- }
7
- export declare function buildAwardGroupGrantTargetKey(target: AwardGroupGrantTarget): string;
8
- export declare function buildAwardGroupGrantId(targetKey: string, decision: number): string;
9
- //# sourceMappingURL=award-grant-ids.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"award-grant-ids.d.ts","sourceRoot":"","sources":["../../src/ids/award-grant-ids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAOD,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,CAEnF;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElF"}
@@ -1,10 +0,0 @@
1
- // A part prefixed by its length, so parts that contain any character still decode one way.
2
- const lengthPrefixed = (part) => `${part.length}:${part}`;
3
- const DECISION_SEPARATOR = '~';
4
- export function buildAwardGroupGrantTargetKey(target) {
5
- return [target.awardId, target.groupType, target.groupId].map(lengthPrefixed).join('');
6
- }
7
- export function buildAwardGroupGrantId(targetKey, decision) {
8
- return `${targetKey}${DECISION_SEPARATOR}${decision}`;
9
- }
10
- //# sourceMappingURL=award-grant-ids.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"award-grant-ids.js","sourceRoot":"","sources":["../../src/ids/award-grant-ids.ts"],"names":[],"mappings":"AAQA,2FAA2F;AAC3F,MAAM,cAAc,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;AAE1E,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B,MAAM,UAAU,6BAA6B,CAAC,MAA6B;IACzE,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzF,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,SAAiB,EAAE,QAAgB;IACxE,OAAO,GAAG,SAAS,GAAG,kBAAkB,GAAG,QAAQ,EAAE,CAAC;AACxD,CAAC","sourcesContent":["import type { AwardGroupType } from '../types/unions.js';\n\nexport interface AwardGroupGrantTarget {\n readonly awardId: string;\n readonly groupType: AwardGroupType;\n readonly groupId: string;\n}\n\n// A part prefixed by its length, so parts that contain any character still decode one way.\nconst lengthPrefixed = (part: string): string => `${part.length}:${part}`;\n\nconst DECISION_SEPARATOR = '~';\n\nexport function buildAwardGroupGrantTargetKey(target: AwardGroupGrantTarget): string {\n return [target.awardId, target.groupType, target.groupId].map(lengthPrefixed).join('');\n}\n\nexport function buildAwardGroupGrantId(targetKey: string, decision: number): string {\n return `${targetKey}${DECISION_SEPARATOR}${decision}`;\n}\n"]}