@ttt-productions/q-core 0.1.49 → 0.1.51

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 (173) hide show
  1. package/dist/constants/business.d.ts +3 -4
  2. package/dist/constants/business.d.ts.map +1 -1
  3. package/dist/constants/business.js +3 -4
  4. package/dist/constants/business.js.map +1 -1
  5. package/dist/constants/sports.d.ts +0 -13
  6. package/dist/constants/sports.d.ts.map +1 -1
  7. package/dist/constants/sports.js +0 -13
  8. package/dist/constants/sports.js.map +1 -1
  9. package/dist/constants/text-fields.d.ts +0 -6
  10. package/dist/constants/text-fields.d.ts.map +1 -1
  11. package/dist/constants/text-fields.js +0 -6
  12. package/dist/constants/text-fields.js.map +1 -1
  13. package/dist/doc-schemas/admin-notifications.d.ts +1 -1
  14. package/dist/doc-schemas/atoms.d.ts.map +1 -1
  15. package/dist/doc-schemas/atoms.js +1 -1
  16. package/dist/doc-schemas/atoms.js.map +1 -1
  17. package/dist/doc-schemas/audit-event.d.ts +4 -8
  18. package/dist/doc-schemas/audit-event.d.ts.map +1 -1
  19. package/dist/doc-schemas/game-stat-history.d.ts +0 -1
  20. package/dist/doc-schemas/game-stat-history.d.ts.map +1 -1
  21. package/dist/doc-schemas/game-stats.d.ts +0 -2
  22. package/dist/doc-schemas/game-stats.d.ts.map +1 -1
  23. package/dist/doc-schemas/game-stats.js +1 -2
  24. package/dist/doc-schemas/game-stats.js.map +1 -1
  25. package/dist/doc-schemas/index.d.ts +2 -2
  26. package/dist/doc-schemas/index.d.ts.map +1 -1
  27. package/dist/doc-schemas/index.js +2 -2
  28. package/dist/doc-schemas/index.js.map +1 -1
  29. package/dist/doc-schemas/migration-console.d.ts +6 -20
  30. package/dist/doc-schemas/migration-console.d.ts.map +1 -1
  31. package/dist/doc-schemas/migration-console.js +2 -7
  32. package/dist/doc-schemas/migration-console.js.map +1 -1
  33. package/dist/doc-schemas/pending-media.d.ts +35 -55
  34. package/dist/doc-schemas/pending-media.d.ts.map +1 -1
  35. package/dist/doc-schemas/registry.d.ts +49 -229
  36. package/dist/doc-schemas/registry.d.ts.map +1 -1
  37. package/dist/doc-schemas/registry.js +3 -7
  38. package/dist/doc-schemas/registry.js.map +1 -1
  39. package/dist/doc-schemas/stats-changes.d.ts +21 -0
  40. package/dist/doc-schemas/stats-changes.d.ts.map +1 -0
  41. package/dist/doc-schemas/stats-changes.js +19 -0
  42. package/dist/doc-schemas/stats-changes.js.map +1 -0
  43. package/dist/doc-schemas/stats-job.d.ts +36 -0
  44. package/dist/doc-schemas/stats-job.d.ts.map +1 -0
  45. package/dist/doc-schemas/stats-job.js +26 -0
  46. package/dist/doc-schemas/stats-job.js.map +1 -0
  47. package/dist/doc-schemas/system.d.ts +1 -1
  48. package/dist/doc-schemas/system.d.ts.map +1 -1
  49. package/dist/doc-schemas/system.js +2 -2
  50. package/dist/doc-schemas/system.js.map +1 -1
  51. package/dist/domain-events/domain-events.d.ts +16 -24
  52. package/dist/domain-events/domain-events.d.ts.map +1 -1
  53. package/dist/domain-events/domain-events.js +11 -11
  54. package/dist/domain-events/domain-events.js.map +1 -1
  55. package/dist/ids/index.d.ts +2 -1
  56. package/dist/ids/index.d.ts.map +1 -1
  57. package/dist/ids/index.js +2 -1
  58. package/dist/ids/index.js.map +1 -1
  59. package/dist/ids/notification-ids.d.ts +2 -4
  60. package/dist/ids/notification-ids.d.ts.map +1 -1
  61. package/dist/ids/notification-ids.js +3 -12
  62. package/dist/ids/notification-ids.js.map +1 -1
  63. package/dist/ids/request-job-ids.d.ts +7 -0
  64. package/dist/ids/request-job-ids.d.ts.map +1 -0
  65. package/dist/ids/request-job-ids.js +18 -0
  66. package/dist/ids/request-job-ids.js.map +1 -0
  67. package/dist/ids/stats-ids.d.ts +7 -0
  68. package/dist/ids/stats-ids.d.ts.map +1 -0
  69. package/dist/ids/stats-ids.js +17 -0
  70. package/dist/ids/stats-ids.js.map +1 -0
  71. package/dist/migration-console/action-ids.d.ts +1 -3
  72. package/dist/migration-console/action-ids.d.ts.map +1 -1
  73. package/dist/migration-console/action-ids.js +1 -3
  74. package/dist/migration-console/action-ids.js.map +1 -1
  75. package/dist/migration-console/manifest.d.ts +1 -2
  76. package/dist/migration-console/manifest.d.ts.map +1 -1
  77. package/dist/migration-console/manifest.js +12 -43
  78. package/dist/migration-console/manifest.js.map +1 -1
  79. package/dist/paths/collection-groups.d.ts +0 -1
  80. package/dist/paths/collection-groups.d.ts.map +1 -1
  81. package/dist/paths/collection-groups.js +1 -2
  82. package/dist/paths/collection-groups.js.map +1 -1
  83. package/dist/paths/collection-refs.d.ts +1 -2
  84. package/dist/paths/collection-refs.d.ts.map +1 -1
  85. package/dist/paths/collection-refs.js +1 -2
  86. package/dist/paths/collection-refs.js.map +1 -1
  87. package/dist/paths/collections.d.ts +1 -5
  88. package/dist/paths/collections.d.ts.map +1 -1
  89. package/dist/paths/collections.js +1 -5
  90. package/dist/paths/collections.js.map +1 -1
  91. package/dist/paths/path-builders.d.ts +1 -4
  92. package/dist/paths/path-builders.d.ts.map +1 -1
  93. package/dist/paths/path-builders.js +2 -17
  94. package/dist/paths/path-builders.js.map +1 -1
  95. package/dist/schemas/admin-notifications.d.ts +1 -1
  96. package/dist/schemas/awards.d.ts +5 -75
  97. package/dist/schemas/awards.d.ts.map +1 -1
  98. package/dist/schemas/awards.js +6 -30
  99. package/dist/schemas/awards.js.map +1 -1
  100. package/dist/schemas/dead-letters.d.ts +7 -1
  101. package/dist/schemas/dead-letters.d.ts.map +1 -1
  102. package/dist/schemas/dead-letters.js +2 -1
  103. package/dist/schemas/dead-letters.js.map +1 -1
  104. package/dist/schemas/migration-console.d.ts +16 -57
  105. package/dist/schemas/migration-console.d.ts.map +1 -1
  106. package/dist/schemas/migration-console.js +3 -10
  107. package/dist/schemas/migration-console.js.map +1 -1
  108. package/dist/schemas/pictures.d.ts +21 -33
  109. package/dist/schemas/pictures.d.ts.map +1 -1
  110. package/dist/schemas/scoring.d.ts +6 -12
  111. package/dist/schemas/scoring.d.ts.map +1 -1
  112. package/dist/schemas/scoring.js +9 -5
  113. package/dist/schemas/scoring.js.map +1 -1
  114. package/dist/schemas/stats.d.ts +66 -101
  115. package/dist/schemas/stats.d.ts.map +1 -1
  116. package/dist/schemas/stats.js +39 -72
  117. package/dist/schemas/stats.js.map +1 -1
  118. package/dist/sports/basketball-scoring.d.ts.map +1 -1
  119. package/dist/sports/basketball-scoring.js +16 -7
  120. package/dist/sports/basketball-scoring.js.map +1 -1
  121. package/dist/sports/bulk-entry.d.ts +7 -2
  122. package/dist/sports/bulk-entry.d.ts.map +1 -1
  123. package/dist/sports/bulk-entry.js.map +1 -1
  124. package/dist/sports/football-scoring.d.ts.map +1 -1
  125. package/dist/sports/football-scoring.js +13 -10
  126. package/dist/sports/football-scoring.js.map +1 -1
  127. package/dist/sports/replay.d.ts.map +1 -1
  128. package/dist/sports/replay.js +16 -1
  129. package/dist/sports/replay.js.map +1 -1
  130. package/dist/sports/scoring.d.ts +18 -2
  131. package/dist/sports/scoring.d.ts.map +1 -1
  132. package/dist/sports/scoring.js.map +1 -1
  133. package/dist/sports/store-driver.d.ts +2 -1
  134. package/dist/sports/store-driver.d.ts.map +1 -1
  135. package/dist/sports/store-driver.js +30 -15
  136. package/dist/sports/store-driver.js.map +1 -1
  137. package/dist/types/audit.d.ts +1 -1
  138. package/dist/types/audit.d.ts.map +1 -1
  139. package/dist/types/audit.js +1 -3
  140. package/dist/types/audit.js.map +1 -1
  141. package/dist/types/schedules.d.ts +1 -1
  142. package/dist/types/schedules.d.ts.map +1 -1
  143. package/dist/types/schedules.js +1 -2
  144. package/dist/types/schedules.js.map +1 -1
  145. package/dist/types/stats.d.ts +13 -13
  146. package/dist/types/stats.d.ts.map +1 -1
  147. package/dist/types/stats.js +13 -33
  148. package/dist/types/stats.js.map +1 -1
  149. package/dist/types/unions.d.ts +0 -6
  150. package/dist/types/unions.d.ts.map +1 -1
  151. package/dist/types/unions.js +0 -3
  152. package/dist/types/unions.js.map +1 -1
  153. package/dist/utils/index.d.ts +0 -1
  154. package/dist/utils/index.d.ts.map +1 -1
  155. package/dist/utils/index.js +0 -1
  156. package/dist/utils/index.js.map +1 -1
  157. package/package.json +1 -1
  158. package/dist/doc-schemas/award-group-grant.d.ts +0 -54
  159. package/dist/doc-schemas/award-group-grant.d.ts.map +0 -1
  160. package/dist/doc-schemas/award-group-grant.js +0 -55
  161. package/dist/doc-schemas/award-group-grant.js.map +0 -1
  162. package/dist/doc-schemas/stats-operation.d.ts +0 -348
  163. package/dist/doc-schemas/stats-operation.d.ts.map +0 -1
  164. package/dist/doc-schemas/stats-operation.js +0 -92
  165. package/dist/doc-schemas/stats-operation.js.map +0 -1
  166. package/dist/ids/award-grant-ids.d.ts +0 -9
  167. package/dist/ids/award-grant-ids.d.ts.map +0 -1
  168. package/dist/ids/award-grant-ids.js +0 -10
  169. package/dist/ids/award-grant-ids.js.map +0 -1
  170. package/dist/utils/stats-operation-request.d.ts +0 -20
  171. package/dist/utils/stats-operation-request.d.ts.map +0 -1
  172. package/dist/utils/stats-operation-request.js +0 -10
  173. package/dist/utils/stats-operation-request.js.map +0 -1
@@ -8,6 +8,5 @@ export * from './schedules.js';
8
8
  export * from './team-member-actions.js';
9
9
  export * from './league-mode.js';
10
10
  export * from './league-joining.js';
11
- export * from './stats-operation-request.js';
12
11
  export * from './text-field.js';
13
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './display-name.js';\nexport * from './app-config.js';\nexport * from './league-calendar.js';\nexport * from './team-creation.js';\nexport * from './account-status.js';\nexport * from './league-join-warning.js';\nexport * from './schedules.js';\nexport * from './team-member-actions.js';\nexport * from './league-mode.js';\nexport * from './league-joining.js';\nexport * from './stats-operation-request.js';\nexport * from './text-field.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './display-name.js';\nexport * from './app-config.js';\nexport * from './league-calendar.js';\nexport * from './team-creation.js';\nexport * from './account-status.js';\nexport * from './league-join-warning.js';\nexport * from './schedules.js';\nexport * from './team-member-actions.js';\nexport * from './league-mode.js';\nexport * from './league-joining.js';\nexport * from './text-field.js';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttt-productions/q-core",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
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,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAClG,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,aAAa,EACb,cAAc,EACd,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,M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AAC,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,348 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const StatsOperationCountsSchema: z.ZodObject<{
3
- read: z.ZodNumber;
4
- changed: z.ZodNumber;
5
- skipped: z.ZodNumber;
6
- }, z.core.$strip>;
7
- export type StatsOperationCounts = z.infer<typeof StatsOperationCountsSchema>;
8
- export declare const LeagueStatsRebuildOperationSchema: z.ZodObject<{
9
- kind: z.ZodLiteral<"leagueStatsRebuild">;
10
- scope: z.ZodObject<{
11
- leagueId: z.ZodOptional<z.ZodString>;
12
- }, z.core.$strip>;
13
- reason: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
14
- startedByUserId: z.ZodString;
15
- startedAt: z.ZodNumber;
16
- updatedAt: z.ZodNumber;
17
- status: z.ZodEnum<{
18
- running: "running";
19
- complete: "complete";
20
- stopped: "stopped";
21
- }>;
22
- resumeAfter: z.ZodOptional<z.ZodString>;
23
- counts: z.ZodObject<{
24
- read: z.ZodNumber;
25
- changed: z.ZodNumber;
26
- skipped: z.ZodNumber;
27
- }, z.core.$strip>;
28
- }, z.core.$strip>;
29
- export declare const LifetimeStatsRebuildOperationSchema: z.ZodObject<{
30
- kind: z.ZodLiteral<"lifetimeStatsRebuild">;
31
- scope: z.ZodObject<{
32
- userId: z.ZodOptional<z.ZodString>;
33
- }, z.core.$strip>;
34
- reason: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
35
- startedByUserId: z.ZodString;
36
- startedAt: z.ZodNumber;
37
- updatedAt: z.ZodNumber;
38
- status: z.ZodEnum<{
39
- running: "running";
40
- complete: "complete";
41
- stopped: "stopped";
42
- }>;
43
- resumeAfter: z.ZodOptional<z.ZodString>;
44
- counts: z.ZodObject<{
45
- read: z.ZodNumber;
46
- changed: z.ZodNumber;
47
- skipped: z.ZodNumber;
48
- }, z.core.$strip>;
49
- }, z.core.$strip>;
50
- export declare const HallOfFameRebuildOperationSchema: z.ZodObject<{
51
- kind: z.ZodLiteral<"hallOfFameRebuild">;
52
- scope: z.ZodObject<{
53
- sportKey: z.ZodEnum<{
54
- basketball: "basketball";
55
- curling: "curling";
56
- football: "football";
57
- }>;
58
- userId: z.ZodOptional<z.ZodString>;
59
- }, z.core.$strip>;
60
- reason: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
61
- startedByUserId: z.ZodString;
62
- startedAt: z.ZodNumber;
63
- updatedAt: z.ZodNumber;
64
- status: z.ZodEnum<{
65
- running: "running";
66
- complete: "complete";
67
- stopped: "stopped";
68
- }>;
69
- resumeAfter: z.ZodOptional<z.ZodString>;
70
- counts: z.ZodObject<{
71
- read: z.ZodNumber;
72
- changed: z.ZodNumber;
73
- skipped: z.ZodNumber;
74
- }, z.core.$strip>;
75
- }, z.core.$strip>;
76
- export declare const StatsValidationOperationSchema: z.ZodObject<{
77
- kind: z.ZodLiteral<"statsValidation">;
78
- scope: z.ZodObject<{
79
- gameId: z.ZodOptional<z.ZodString>;
80
- leagueId: z.ZodOptional<z.ZodString>;
81
- }, z.core.$strip>;
82
- phase: z.ZodEnum<{
83
- games: "games";
84
- destinations: "destinations";
85
- }>;
86
- startedByUserId: z.ZodString;
87
- startedAt: z.ZodNumber;
88
- updatedAt: z.ZodNumber;
89
- status: z.ZodEnum<{
90
- running: "running";
91
- complete: "complete";
92
- stopped: "stopped";
93
- }>;
94
- resumeAfter: z.ZodOptional<z.ZodString>;
95
- counts: z.ZodObject<{
96
- read: z.ZodNumber;
97
- changed: z.ZodNumber;
98
- skipped: z.ZodNumber;
99
- }, z.core.$strip>;
100
- }, z.core.$strip>;
101
- export declare const GameStatsCorrectionOperationSchema: z.ZodObject<{
102
- kind: z.ZodLiteral<"gameStatsCorrection">;
103
- scope: z.ZodObject<{
104
- gameId: z.ZodString;
105
- }, z.core.$strip>;
106
- reason: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
107
- requestHash: z.ZodOptional<z.ZodString>;
108
- startedByUserId: z.ZodString;
109
- startedAt: z.ZodNumber;
110
- updatedAt: z.ZodNumber;
111
- status: z.ZodEnum<{
112
- running: "running";
113
- complete: "complete";
114
- stopped: "stopped";
115
- }>;
116
- resumeAfter: z.ZodOptional<z.ZodString>;
117
- counts: z.ZodObject<{
118
- read: z.ZodNumber;
119
- changed: z.ZodNumber;
120
- skipped: z.ZodNumber;
121
- }, z.core.$strip>;
122
- }, z.core.$strip>;
123
- export declare const GameStatsRecalculationOperationSchema: z.ZodObject<{
124
- kind: z.ZodLiteral<"gameStatsRecalculation">;
125
- scope: z.ZodObject<{
126
- gameId: z.ZodString;
127
- }, z.core.$strip>;
128
- reason: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
129
- startedByUserId: z.ZodString;
130
- startedAt: z.ZodNumber;
131
- updatedAt: z.ZodNumber;
132
- status: z.ZodEnum<{
133
- running: "running";
134
- complete: "complete";
135
- stopped: "stopped";
136
- }>;
137
- resumeAfter: z.ZodOptional<z.ZodString>;
138
- counts: z.ZodObject<{
139
- read: z.ZodNumber;
140
- changed: z.ZodNumber;
141
- skipped: z.ZodNumber;
142
- }, z.core.$strip>;
143
- }, z.core.$strip>;
144
- export declare const HistoricalStatsUpdateOperationSchema: z.ZodObject<{
145
- kind: z.ZodLiteral<"historicalStatsUpdate">;
146
- scope: z.ZodObject<{
147
- userId: z.ZodString;
148
- sportKey: z.ZodEnum<{
149
- basketball: "basketball";
150
- curling: "curling";
151
- football: "football";
152
- }>;
153
- }, z.core.$strip>;
154
- reason: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
155
- requestHash: z.ZodOptional<z.ZodString>;
156
- startedByUserId: z.ZodString;
157
- startedAt: z.ZodNumber;
158
- updatedAt: z.ZodNumber;
159
- status: z.ZodEnum<{
160
- running: "running";
161
- complete: "complete";
162
- stopped: "stopped";
163
- }>;
164
- resumeAfter: z.ZodOptional<z.ZodString>;
165
- counts: z.ZodObject<{
166
- read: z.ZodNumber;
167
- changed: z.ZodNumber;
168
- skipped: z.ZodNumber;
169
- }, z.core.$strip>;
170
- }, z.core.$strip>;
171
- export declare const GhostRemovedFinishedEntrySchema: z.ZodObject<{
172
- gameId: z.ZodString;
173
- wasAbsent: z.ZodBoolean;
174
- wasNonScoring: z.ZodBoolean;
175
- }, z.core.$strip>;
176
- export type GhostRemovedFinishedEntry = z.infer<typeof GhostRemovedFinishedEntrySchema>;
177
- export declare const GhostLinkedGameSchema: z.ZodObject<{
178
- gameId: z.ZodString;
179
- completed: z.ZodBoolean;
180
- merged: z.ZodBoolean;
181
- }, z.core.$strip>;
182
- export type GhostLinkedGame = z.infer<typeof GhostLinkedGameSchema>;
183
- export declare const StatsDestinationChangeSchema: z.ZodObject<{
184
- ref: z.ZodString;
185
- field: z.ZodString;
186
- before: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNumber>>;
187
- after: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNumber>>;
188
- }, z.core.$strip>;
189
- export type StatsDestinationChange = z.infer<typeof StatsDestinationChangeSchema>;
190
- export declare const StatsOperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
191
- kind: z.ZodLiteral<"leagueStatsRebuild">;
192
- scope: z.ZodObject<{
193
- leagueId: z.ZodOptional<z.ZodString>;
194
- }, z.core.$strip>;
195
- reason: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
196
- startedByUserId: z.ZodString;
197
- startedAt: z.ZodNumber;
198
- updatedAt: z.ZodNumber;
199
- status: z.ZodEnum<{
200
- running: "running";
201
- complete: "complete";
202
- stopped: "stopped";
203
- }>;
204
- resumeAfter: z.ZodOptional<z.ZodString>;
205
- counts: z.ZodObject<{
206
- read: z.ZodNumber;
207
- changed: z.ZodNumber;
208
- skipped: z.ZodNumber;
209
- }, z.core.$strip>;
210
- }, z.core.$strip>, z.ZodObject<{
211
- kind: z.ZodLiteral<"lifetimeStatsRebuild">;
212
- scope: z.ZodObject<{
213
- userId: z.ZodOptional<z.ZodString>;
214
- }, z.core.$strip>;
215
- reason: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
216
- startedByUserId: z.ZodString;
217
- startedAt: z.ZodNumber;
218
- updatedAt: z.ZodNumber;
219
- status: z.ZodEnum<{
220
- running: "running";
221
- complete: "complete";
222
- stopped: "stopped";
223
- }>;
224
- resumeAfter: z.ZodOptional<z.ZodString>;
225
- counts: z.ZodObject<{
226
- read: z.ZodNumber;
227
- changed: z.ZodNumber;
228
- skipped: z.ZodNumber;
229
- }, z.core.$strip>;
230
- }, z.core.$strip>, z.ZodObject<{
231
- kind: z.ZodLiteral<"hallOfFameRebuild">;
232
- scope: z.ZodObject<{
233
- sportKey: z.ZodEnum<{
234
- basketball: "basketball";
235
- curling: "curling";
236
- football: "football";
237
- }>;
238
- userId: z.ZodOptional<z.ZodString>;
239
- }, z.core.$strip>;
240
- reason: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
241
- startedByUserId: z.ZodString;
242
- startedAt: z.ZodNumber;
243
- updatedAt: z.ZodNumber;
244
- status: z.ZodEnum<{
245
- running: "running";
246
- complete: "complete";
247
- stopped: "stopped";
248
- }>;
249
- resumeAfter: z.ZodOptional<z.ZodString>;
250
- counts: z.ZodObject<{
251
- read: z.ZodNumber;
252
- changed: z.ZodNumber;
253
- skipped: z.ZodNumber;
254
- }, z.core.$strip>;
255
- }, z.core.$strip>, z.ZodObject<{
256
- kind: z.ZodLiteral<"statsValidation">;
257
- scope: z.ZodObject<{
258
- gameId: z.ZodOptional<z.ZodString>;
259
- leagueId: z.ZodOptional<z.ZodString>;
260
- }, z.core.$strip>;
261
- phase: z.ZodEnum<{
262
- games: "games";
263
- destinations: "destinations";
264
- }>;
265
- startedByUserId: z.ZodString;
266
- startedAt: z.ZodNumber;
267
- updatedAt: z.ZodNumber;
268
- status: z.ZodEnum<{
269
- running: "running";
270
- complete: "complete";
271
- stopped: "stopped";
272
- }>;
273
- resumeAfter: z.ZodOptional<z.ZodString>;
274
- counts: z.ZodObject<{
275
- read: z.ZodNumber;
276
- changed: z.ZodNumber;
277
- skipped: z.ZodNumber;
278
- }, z.core.$strip>;
279
- }, z.core.$strip>, z.ZodObject<{
280
- kind: z.ZodLiteral<"gameStatsCorrection">;
281
- scope: z.ZodObject<{
282
- gameId: z.ZodString;
283
- }, z.core.$strip>;
284
- reason: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
285
- requestHash: z.ZodOptional<z.ZodString>;
286
- startedByUserId: z.ZodString;
287
- startedAt: z.ZodNumber;
288
- updatedAt: z.ZodNumber;
289
- status: z.ZodEnum<{
290
- running: "running";
291
- complete: "complete";
292
- stopped: "stopped";
293
- }>;
294
- resumeAfter: z.ZodOptional<z.ZodString>;
295
- counts: z.ZodObject<{
296
- read: z.ZodNumber;
297
- changed: z.ZodNumber;
298
- skipped: z.ZodNumber;
299
- }, z.core.$strip>;
300
- }, z.core.$strip>, z.ZodObject<{
301
- kind: z.ZodLiteral<"gameStatsRecalculation">;
302
- scope: z.ZodObject<{
303
- gameId: z.ZodString;
304
- }, z.core.$strip>;
305
- reason: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
306
- startedByUserId: z.ZodString;
307
- startedAt: z.ZodNumber;
308
- updatedAt: z.ZodNumber;
309
- status: z.ZodEnum<{
310
- running: "running";
311
- complete: "complete";
312
- stopped: "stopped";
313
- }>;
314
- resumeAfter: z.ZodOptional<z.ZodString>;
315
- counts: z.ZodObject<{
316
- read: z.ZodNumber;
317
- changed: z.ZodNumber;
318
- skipped: z.ZodNumber;
319
- }, z.core.$strip>;
320
- }, z.core.$strip>, z.ZodObject<{
321
- kind: z.ZodLiteral<"historicalStatsUpdate">;
322
- scope: z.ZodObject<{
323
- userId: z.ZodString;
324
- sportKey: z.ZodEnum<{
325
- basketball: "basketball";
326
- curling: "curling";
327
- football: "football";
328
- }>;
329
- }, z.core.$strip>;
330
- reason: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
331
- requestHash: z.ZodOptional<z.ZodString>;
332
- startedByUserId: z.ZodString;
333
- startedAt: z.ZodNumber;
334
- updatedAt: z.ZodNumber;
335
- status: z.ZodEnum<{
336
- running: "running";
337
- complete: "complete";
338
- stopped: "stopped";
339
- }>;
340
- resumeAfter: z.ZodOptional<z.ZodString>;
341
- counts: z.ZodObject<{
342
- read: z.ZodNumber;
343
- changed: z.ZodNumber;
344
- skipped: z.ZodNumber;
345
- }, z.core.$strip>;
346
- }, z.core.$strip>], "kind">;
347
- export type StatsOperation = z.infer<typeof StatsOperationSchema>;
348
- //# sourceMappingURL=stats-operation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stats-operation.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/stats-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,0BAA0B;;;;iBAIrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAsB9E,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;iBAI5C,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;iBAI9C,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;iBAI3C,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;iBAKzC,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;iBAM7C,CAAC;AAEH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;iBAKhD,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;iBAM/C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;iBAI1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,eAAO,MAAM,qBAAqB;;;;iBAIhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,4BAA4B;;;;;iBAKvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAQ/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,92 +0,0 @@
1
- import { z } from 'zod';
2
- import { STATS_OPERATION_STATUS_KEYS, STATS_VALIDATION_PHASE_KEYS } from '../types/stats.js';
3
- import { countSchema, epochMsSchema, gameIdSchema, leagueIdSchema, repairReasonSchema, sportKeySchema, userIdSchema, } from './atoms.js';
4
- import { StatsValidationScopeSchema } from './system.js';
5
- export const StatsOperationCountsSchema = z.object({
6
- read: countSchema,
7
- changed: countSchema,
8
- skipped: countSchema,
9
- });
10
- const operationBase = {
11
- startedByUserId: userIdSchema,
12
- startedAt: epochMsSchema,
13
- updatedAt: epochMsSchema,
14
- status: z.enum(STATS_OPERATION_STATUS_KEYS),
15
- resumeAfter: z.string().min(1).optional(),
16
- counts: StatsOperationCountsSchema,
17
- };
18
- const rebuildFields = {
19
- ...operationBase,
20
- reason: repairReasonSchema,
21
- };
22
- const gameScope = z.object({ gameId: gameIdSchema });
23
- // `hashStatsOperationRequest` of the values the operation was opened with. Optional: an operation
24
- // stored before it existed still resumes.
25
- const requestHashSchema = z.string().regex(/^[0-9a-f]{64}$/);
26
- export const LeagueStatsRebuildOperationSchema = z.object({
27
- ...rebuildFields,
28
- kind: z.literal('leagueStatsRebuild'),
29
- scope: z.object({ leagueId: leagueIdSchema.optional() }),
30
- });
31
- export const LifetimeStatsRebuildOperationSchema = z.object({
32
- ...rebuildFields,
33
- kind: z.literal('lifetimeStatsRebuild'),
34
- scope: z.object({ userId: userIdSchema.optional() }),
35
- });
36
- export const HallOfFameRebuildOperationSchema = z.object({
37
- ...rebuildFields,
38
- kind: z.literal('hallOfFameRebuild'),
39
- scope: z.object({ sportKey: sportKeySchema, userId: userIdSchema.optional() }),
40
- });
41
- export const StatsValidationOperationSchema = z.object({
42
- ...operationBase,
43
- kind: z.literal('statsValidation'),
44
- scope: StatsValidationScopeSchema,
45
- phase: z.enum(STATS_VALIDATION_PHASE_KEYS),
46
- });
47
- export const GameStatsCorrectionOperationSchema = z.object({
48
- ...operationBase,
49
- kind: z.literal('gameStatsCorrection'),
50
- scope: gameScope,
51
- reason: repairReasonSchema,
52
- requestHash: requestHashSchema.optional(),
53
- });
54
- export const GameStatsRecalculationOperationSchema = z.object({
55
- ...operationBase,
56
- kind: z.literal('gameStatsRecalculation'),
57
- scope: gameScope,
58
- reason: repairReasonSchema,
59
- });
60
- export const HistoricalStatsUpdateOperationSchema = z.object({
61
- ...operationBase,
62
- kind: z.literal('historicalStatsUpdate'),
63
- scope: z.object({ userId: userIdSchema, sportKey: sportKeySchema }),
64
- reason: repairReasonSchema,
65
- requestHash: requestHashSchema.optional(),
66
- });
67
- export const GhostRemovedFinishedEntrySchema = z.object({
68
- gameId: gameIdSchema,
69
- wasAbsent: z.boolean(),
70
- wasNonScoring: z.boolean(),
71
- });
72
- export const GhostLinkedGameSchema = z.object({
73
- gameId: gameIdSchema,
74
- completed: z.boolean(),
75
- merged: z.boolean(),
76
- });
77
- export const StatsDestinationChangeSchema = z.object({
78
- ref: z.string().min(1),
79
- field: z.string().min(1),
80
- before: z.record(z.string(), z.number()).nullable(),
81
- after: z.record(z.string(), z.number()).nullable(),
82
- });
83
- export const StatsOperationSchema = z.discriminatedUnion('kind', [
84
- LeagueStatsRebuildOperationSchema,
85
- LifetimeStatsRebuildOperationSchema,
86
- HallOfFameRebuildOperationSchema,
87
- StatsValidationOperationSchema,
88
- GameStatsCorrectionOperationSchema,
89
- GameStatsRecalculationOperationSchema,
90
- HistoricalStatsUpdateOperationSchema,
91
- ]);
92
- //# sourceMappingURL=stats-operation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stats-operation.js","sourceRoot":"","sources":["../../src/doc-schemas/stats-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAE7F,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,WAAW;CACrB,CAAC,CAAC;AAGH,MAAM,aAAa,GAAG;IACpB,eAAe,EAAE,YAAY;IAC7B,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;IACxB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC;IAC3C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACzC,MAAM,EAAE,0BAA0B;CACnC,CAAC;AAEF,MAAM,aAAa,GAAG;IACpB,GAAG,aAAa;IAChB,MAAM,EAAE,kBAAkB;CAC3B,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;AAErD,kGAAkG;AAClG,0CAA0C;AAC1C,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAE7D,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,GAAG,aAAa;IACh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E,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC/D,iCAAiC;IACjC,mCAAmC;IACnC,gCAAgC;IAChC,8BAA8B;IAC9B,kCAAkC;IAClC,qCAAqC;IACrC,oCAAoC;CACrC,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { STATS_OPERATION_STATUS_KEYS, STATS_VALIDATION_PHASE_KEYS } from '../types/stats.js';\nimport type { StatsOperationKind } from '../types/stats.js';\nimport {\n countSchema,\n epochMsSchema,\n gameIdSchema,\n leagueIdSchema,\n repairReasonSchema,\n sportKeySchema,\n userIdSchema,\n} from './atoms.js';\nimport { StatsValidationScopeSchema } from './system.js';\n\nexport const StatsOperationCountsSchema = z.object({\n read: countSchema,\n changed: countSchema,\n skipped: countSchema,\n});\nexport type StatsOperationCounts = z.infer<typeof StatsOperationCountsSchema>;\n\nconst operationBase = {\n startedByUserId: userIdSchema,\n startedAt: epochMsSchema,\n updatedAt: epochMsSchema,\n status: z.enum(STATS_OPERATION_STATUS_KEYS),\n resumeAfter: z.string().min(1).optional(),\n counts: StatsOperationCountsSchema,\n};\n\nconst rebuildFields = {\n ...operationBase,\n reason: repairReasonSchema,\n};\n\nconst gameScope = z.object({ gameId: gameIdSchema });\n\n// `hashStatsOperationRequest` of the values the operation was opened with. Optional: an operation\n// stored before it existed still resumes.\nconst requestHashSchema = z.string().regex(/^[0-9a-f]{64}$/);\n\nexport const LeagueStatsRebuildOperationSchema = z.object({\n ...rebuildFields,\n kind: z.literal('leagueStatsRebuild' satisfies StatsOperationKind),\n scope: z.object({ leagueId: leagueIdSchema.optional() }),\n});\n\nexport const LifetimeStatsRebuildOperationSchema = z.object({\n ...rebuildFields,\n kind: z.literal('lifetimeStatsRebuild' satisfies StatsOperationKind),\n scope: z.object({ userId: userIdSchema.optional() }),\n});\n\nexport const HallOfFameRebuildOperationSchema = z.object({\n ...rebuildFields,\n kind: z.literal('hallOfFameRebuild' satisfies StatsOperationKind),\n scope: z.object({ sportKey: sportKeySchema, userId: userIdSchema.optional() }),\n});\n\nexport const StatsValidationOperationSchema = z.object({\n ...operationBase,\n kind: z.literal('statsValidation' satisfies StatsOperationKind),\n scope: StatsValidationScopeSchema,\n phase: z.enum(STATS_VALIDATION_PHASE_KEYS),\n});\n\nexport const GameStatsCorrectionOperationSchema = z.object({\n ...operationBase,\n kind: z.literal('gameStatsCorrection' satisfies StatsOperationKind),\n scope: gameScope,\n reason: repairReasonSchema,\n requestHash: requestHashSchema.optional(),\n});\n\nexport const GameStatsRecalculationOperationSchema = z.object({\n ...operationBase,\n kind: z.literal('gameStatsRecalculation' satisfies StatsOperationKind),\n scope: gameScope,\n reason: repairReasonSchema,\n});\n\nexport const HistoricalStatsUpdateOperationSchema = z.object({\n ...operationBase,\n kind: z.literal('historicalStatsUpdate' satisfies StatsOperationKind),\n scope: z.object({ userId: userIdSchema, sportKey: sportKeySchema }),\n reason: repairReasonSchema,\n requestHash: requestHashSchema.optional(),\n});\n\nexport const GhostRemovedFinishedEntrySchema = z.object({\n gameId: gameIdSchema,\n wasAbsent: z.boolean(),\n wasNonScoring: z.boolean(),\n});\nexport type GhostRemovedFinishedEntry = z.infer<typeof GhostRemovedFinishedEntrySchema>;\n\nexport const GhostLinkedGameSchema = z.object({\n gameId: gameIdSchema,\n completed: z.boolean(),\n merged: z.boolean(),\n});\nexport type GhostLinkedGame = z.infer<typeof GhostLinkedGameSchema>;\n\nexport const StatsDestinationChangeSchema = z.object({\n ref: z.string().min(1),\n field: z.string().min(1),\n before: z.record(z.string(), z.number()).nullable(),\n after: z.record(z.string(), z.number()).nullable(),\n});\nexport type StatsDestinationChange = z.infer<typeof StatsDestinationChangeSchema>;\n\nexport const StatsOperationSchema = z.discriminatedUnion('kind', [\n LeagueStatsRebuildOperationSchema,\n LifetimeStatsRebuildOperationSchema,\n HallOfFameRebuildOperationSchema,\n StatsValidationOperationSchema,\n GameStatsCorrectionOperationSchema,\n GameStatsRecalculationOperationSchema,\n HistoricalStatsUpdateOperationSchema,\n]);\nexport type StatsOperation = z.infer<typeof StatsOperationSchema>;\n"]}
@@ -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"]}
@@ -1,20 +0,0 @@
1
- import type { HistoricalStats } from '../doc-schemas/user-profile.js';
2
- import type { GameStatsCorrectionTarget } from '../schemas/stats.js';
3
- import type { SportKey } from '../types/sports.js';
4
- export type StatsOperationRequest = {
5
- kind: 'gameStatsCorrection';
6
- scope: {
7
- gameId: string;
8
- };
9
- targets?: readonly GameStatsCorrectionTarget[];
10
- keepStored?: true;
11
- } | {
12
- kind: 'historicalStatsUpdate';
13
- scope: {
14
- userId: string;
15
- sportKey: SportKey;
16
- };
17
- stats: HistoricalStats;
18
- };
19
- export declare function hashStatsOperationRequest(request: StatsOperationRequest): Promise<string>;
20
- //# sourceMappingURL=stats-operation-request.d.ts.map