@aneuhold/core-ts-db-lib 4.0.4 → 4.1.0

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 (140) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/lib/browser.d.ts +36 -4
  3. package/lib/browser.d.ts.map +1 -1
  4. package/lib/browser.js +23 -2
  5. package/lib/browser.js.map +1 -1
  6. package/lib/browser.ts +126 -4
  7. package/lib/documents/BaseDocument.d.ts +8 -0
  8. package/lib/documents/BaseDocument.d.ts.map +1 -1
  9. package/lib/documents/BaseDocument.js +10 -0
  10. package/lib/documents/BaseDocument.js.map +1 -1
  11. package/lib/documents/BaseDocument.ts +18 -0
  12. package/lib/documents/common/User.d.ts +1 -0
  13. package/lib/documents/common/User.d.ts.map +1 -1
  14. package/lib/documents/common/User.js +4 -2
  15. package/lib/documents/common/User.js.map +1 -1
  16. package/lib/documents/common/User.ts +4 -2
  17. package/lib/documents/dashboard/NonogramKatanaItem.d.ts +1 -1
  18. package/lib/documents/dashboard/NonogramKatanaItem.js +1 -1
  19. package/lib/documents/dashboard/NonogramKatanaItem.js.map +1 -1
  20. package/lib/documents/dashboard/NonogramKatanaItem.ts +1 -1
  21. package/lib/documents/dashboard/NonogramKatanaUpgrade.d.ts +1 -1
  22. package/lib/documents/dashboard/NonogramKatanaUpgrade.js +1 -1
  23. package/lib/documents/dashboard/NonogramKatanaUpgrade.js.map +1 -1
  24. package/lib/documents/dashboard/NonogramKatanaUpgrade.ts +1 -1
  25. package/lib/documents/workout/README.md +557 -0
  26. package/lib/documents/workout/WorkoutEquipmentType.d.ts +22 -0
  27. package/lib/documents/workout/WorkoutEquipmentType.d.ts.map +1 -0
  28. package/lib/documents/workout/WorkoutEquipmentType.js +31 -0
  29. package/lib/documents/workout/WorkoutEquipmentType.js.map +1 -0
  30. package/lib/documents/workout/WorkoutEquipmentType.ts +40 -0
  31. package/lib/documents/workout/WorkoutExercise.d.ts +82 -0
  32. package/lib/documents/workout/WorkoutExercise.d.ts.map +1 -0
  33. package/lib/documents/workout/WorkoutExercise.js +124 -0
  34. package/lib/documents/workout/WorkoutExercise.js.map +1 -0
  35. package/lib/documents/workout/WorkoutExercise.ts +143 -0
  36. package/lib/documents/workout/WorkoutExerciseCalibration.d.ts +43 -0
  37. package/lib/documents/workout/WorkoutExerciseCalibration.d.ts.map +1 -0
  38. package/lib/documents/workout/WorkoutExerciseCalibration.js +45 -0
  39. package/lib/documents/workout/WorkoutExerciseCalibration.js.map +1 -0
  40. package/lib/documents/workout/WorkoutExerciseCalibration.ts +74 -0
  41. package/lib/documents/workout/WorkoutMesocycle.d.ts +49 -0
  42. package/lib/documents/workout/WorkoutMesocycle.d.ts.map +1 -0
  43. package/lib/documents/workout/WorkoutMesocycle.js +84 -0
  44. package/lib/documents/workout/WorkoutMesocycle.js.map +1 -0
  45. package/lib/documents/workout/WorkoutMesocycle.ts +102 -0
  46. package/lib/documents/workout/WorkoutMicrocycle.d.ts +27 -0
  47. package/lib/documents/workout/WorkoutMicrocycle.d.ts.map +1 -0
  48. package/lib/documents/workout/WorkoutMicrocycle.js +42 -0
  49. package/lib/documents/workout/WorkoutMicrocycle.js.map +1 -0
  50. package/lib/documents/workout/WorkoutMicrocycle.ts +55 -0
  51. package/lib/documents/workout/WorkoutMuscleGroup.d.ts +22 -0
  52. package/lib/documents/workout/WorkoutMuscleGroup.d.ts.map +1 -0
  53. package/lib/documents/workout/WorkoutMuscleGroup.js +25 -0
  54. package/lib/documents/workout/WorkoutMuscleGroup.js.map +1 -0
  55. package/lib/documents/workout/WorkoutMuscleGroup.ts +34 -0
  56. package/lib/documents/workout/WorkoutSession.d.ts +39 -0
  57. package/lib/documents/workout/WorkoutSession.d.ts.map +1 -0
  58. package/lib/documents/workout/WorkoutSession.js +66 -0
  59. package/lib/documents/workout/WorkoutSession.js.map +1 -0
  60. package/lib/documents/workout/WorkoutSession.ts +79 -0
  61. package/lib/documents/workout/WorkoutSessionExercise.d.ts +39 -0
  62. package/lib/documents/workout/WorkoutSessionExercise.d.ts.map +1 -0
  63. package/lib/documents/workout/WorkoutSessionExercise.js +66 -0
  64. package/lib/documents/workout/WorkoutSessionExercise.js.map +1 -0
  65. package/lib/documents/workout/WorkoutSessionExercise.ts +79 -0
  66. package/lib/documents/workout/WorkoutSet.d.ts +41 -0
  67. package/lib/documents/workout/WorkoutSet.d.ts.map +1 -0
  68. package/lib/documents/workout/WorkoutSet.js +69 -0
  69. package/lib/documents/workout/WorkoutSet.js.map +1 -0
  70. package/lib/documents/workout/WorkoutSet.ts +90 -0
  71. package/lib/embedded-types/workout/Fatigue.d.ts +16 -0
  72. package/lib/embedded-types/workout/Fatigue.d.ts.map +1 -0
  73. package/lib/embedded-types/workout/Fatigue.js +34 -0
  74. package/lib/embedded-types/workout/Fatigue.js.map +1 -0
  75. package/lib/embedded-types/workout/Fatigue.ts +41 -0
  76. package/lib/embedded-types/workout/Rsm.d.ts +17 -0
  77. package/lib/embedded-types/workout/Rsm.d.ts.map +1 -0
  78. package/lib/embedded-types/workout/Rsm.js +34 -0
  79. package/lib/embedded-types/workout/Rsm.js.map +1 -0
  80. package/lib/embedded-types/workout/Rsm.ts +42 -0
  81. package/lib/services/DocumentService.d.ts +19 -0
  82. package/lib/services/DocumentService.d.ts.map +1 -1
  83. package/lib/services/DocumentService.js.map +1 -1
  84. package/lib/services/DocumentService.ts +20 -0
  85. package/lib/services/workout/EquipmentType/WorkoutEquipmentTypeService.d.ts +35 -0
  86. package/lib/services/workout/EquipmentType/WorkoutEquipmentTypeService.d.ts.map +1 -0
  87. package/lib/services/workout/EquipmentType/WorkoutEquipmentTypeService.js +74 -0
  88. package/lib/services/workout/EquipmentType/WorkoutEquipmentTypeService.js.map +1 -0
  89. package/lib/services/workout/EquipmentType/WorkoutEquipmentTypeService.ts +90 -0
  90. package/lib/services/workout/Exercise/WorkoutExerciseService.d.ts +55 -0
  91. package/lib/services/workout/Exercise/WorkoutExerciseService.d.ts.map +1 -0
  92. package/lib/services/workout/Exercise/WorkoutExerciseService.js +133 -0
  93. package/lib/services/workout/Exercise/WorkoutExerciseService.js.map +1 -0
  94. package/lib/services/workout/Exercise/WorkoutExerciseService.ts +173 -0
  95. package/lib/services/workout/ExerciseCalibration/WorkoutExerciseCalibrationService.d.ts +35 -0
  96. package/lib/services/workout/ExerciseCalibration/WorkoutExerciseCalibrationService.d.ts.map +1 -0
  97. package/lib/services/workout/ExerciseCalibration/WorkoutExerciseCalibrationService.js +42 -0
  98. package/lib/services/workout/ExerciseCalibration/WorkoutExerciseCalibrationService.js.map +1 -0
  99. package/lib/services/workout/ExerciseCalibration/WorkoutExerciseCalibrationService.ts +45 -0
  100. package/lib/services/workout/Mesocycle/WorkoutMesocyclePlanContext.d.ts +90 -0
  101. package/lib/services/workout/Mesocycle/WorkoutMesocyclePlanContext.d.ts.map +1 -0
  102. package/lib/services/workout/Mesocycle/WorkoutMesocyclePlanContext.js +131 -0
  103. package/lib/services/workout/Mesocycle/WorkoutMesocyclePlanContext.js.map +1 -0
  104. package/lib/services/workout/Mesocycle/WorkoutMesocyclePlanContext.ts +159 -0
  105. package/lib/services/workout/Mesocycle/WorkoutMesocycleService.d.ts +52 -0
  106. package/lib/services/workout/Mesocycle/WorkoutMesocycleService.d.ts.map +1 -0
  107. package/lib/services/workout/Mesocycle/WorkoutMesocycleService.js +180 -0
  108. package/lib/services/workout/Mesocycle/WorkoutMesocycleService.js.map +1 -0
  109. package/lib/services/workout/Mesocycle/WorkoutMesocycleService.ts +274 -0
  110. package/lib/services/workout/Microcycle/WorkoutMicrocycleService.d.ts +28 -0
  111. package/lib/services/workout/Microcycle/WorkoutMicrocycleService.d.ts.map +1 -0
  112. package/lib/services/workout/Microcycle/WorkoutMicrocycleService.js +172 -0
  113. package/lib/services/workout/Microcycle/WorkoutMicrocycleService.js.map +1 -0
  114. package/lib/services/workout/Microcycle/WorkoutMicrocycleService.ts +236 -0
  115. package/lib/services/workout/Session/WorkoutSessionService.d.ts +49 -0
  116. package/lib/services/workout/Session/WorkoutSessionService.d.ts.map +1 -0
  117. package/lib/services/workout/Session/WorkoutSessionService.js +95 -0
  118. package/lib/services/workout/Session/WorkoutSessionService.js.map +1 -0
  119. package/lib/services/workout/Session/WorkoutSessionService.ts +136 -0
  120. package/lib/services/workout/SessionExercise/WorkoutSessionExerciseService.d.ts +45 -0
  121. package/lib/services/workout/SessionExercise/WorkoutSessionExerciseService.d.ts.map +1 -0
  122. package/lib/services/workout/SessionExercise/WorkoutSessionExerciseService.js +69 -0
  123. package/lib/services/workout/SessionExercise/WorkoutSessionExerciseService.js.map +1 -0
  124. package/lib/services/workout/SessionExercise/WorkoutSessionExerciseService.ts +77 -0
  125. package/lib/services/workout/Set/WorkoutSetService.d.ts +36 -0
  126. package/lib/services/workout/Set/WorkoutSetService.d.ts.map +1 -0
  127. package/lib/services/workout/Set/WorkoutSetService.js +90 -0
  128. package/lib/services/workout/Set/WorkoutSetService.js.map +1 -0
  129. package/lib/services/workout/Set/WorkoutSetService.ts +153 -0
  130. package/lib/services/workout/util/SFR/WorkoutSFRService.d.ts +29 -0
  131. package/lib/services/workout/util/SFR/WorkoutSFRService.d.ts.map +1 -0
  132. package/lib/services/workout/util/SFR/WorkoutSFRService.js +50 -0
  133. package/lib/services/workout/util/SFR/WorkoutSFRService.js.map +1 -0
  134. package/lib/services/workout/util/SFR/WorkoutSFRService.ts +61 -0
  135. package/lib/services/workout/util/VolumePlanning/WorkoutVolumePlanningService.d.ts +48 -0
  136. package/lib/services/workout/util/VolumePlanning/WorkoutVolumePlanningService.d.ts.map +1 -0
  137. package/lib/services/workout/util/VolumePlanning/WorkoutVolumePlanningService.js +261 -0
  138. package/lib/services/workout/util/VolumePlanning/WorkoutVolumePlanningService.js.map +1 -0
  139. package/lib/services/workout/util/VolumePlanning/WorkoutVolumePlanningService.ts +339 -0
  140. package/package.json +5 -4
@@ -0,0 +1,84 @@
1
+ import { z } from 'zod';
2
+ import { RequiredUserIdSchema } from '../../schemas/required-refs/RequiredUserId.js';
3
+ import { BaseDocumentWithTypeSchema, BaseDocumentWithUpdatedAndCreatedDatesSchema } from '../BaseDocument.js';
4
+ /**
5
+ * The type of mesocycle.
6
+ *
7
+ * - MuscleGain: Automatic recommendations will be made for muscle gain
8
+ * - Resensitization: Automatic recommendations for MV training (maintenance)
9
+ * - Cut: Automatic recommendations for fat loss while maintaining muscle
10
+ * - FreeForm: No automatic recommendations, user has full control
11
+ */
12
+ export var CycleType;
13
+ (function (CycleType) {
14
+ CycleType["MuscleGain"] = "MuscleGain";
15
+ CycleType["Resensitization"] = "Resensitization";
16
+ CycleType["Cut"] = "Cut";
17
+ CycleType["FreeForm"] = "FreeForm";
18
+ })(CycleType || (CycleType = {}));
19
+ /**
20
+ * The docType value for WorkoutMesocycle documents.
21
+ */
22
+ export const WorkoutMesocycle_docType = 'workoutMesocycle';
23
+ /**
24
+ * The schema for {@link WorkoutMesocycle} documents.
25
+ */
26
+ export const WorkoutMesocycleSchema = z
27
+ .object({
28
+ ...BaseDocumentWithTypeSchema.shape,
29
+ ...RequiredUserIdSchema.shape,
30
+ ...BaseDocumentWithUpdatedAndCreatedDatesSchema.shape,
31
+ docType: z.literal(WorkoutMesocycle_docType).default(WorkoutMesocycle_docType),
32
+ /**
33
+ * An optional title for this mesocycle.
34
+ */
35
+ title: z.string().nullish(),
36
+ /**
37
+ * The IDs of WorkoutExerciseCalibration documents used for this mesocycle.
38
+ *
39
+ * This locks which calibration was used for a mesocycle so historical 1RM
40
+ * values remain accurate even if calibrations are changed later.
41
+ */
42
+ calibratedExercises: z.array(z.uuidv7().transform((val) => val)).default([]),
43
+ /**
44
+ * The type of this mesocycle. See {@link CycleType} for details.
45
+ */
46
+ cycleType: z.enum(CycleType),
47
+ /**
48
+ * The planned number of workout sessions per microcycle.
49
+ */
50
+ plannedSessionCountPerMicrocycle: z.int().positive(),
51
+ /**
52
+ * The planned length of each microcycle in days.
53
+ *
54
+ * Typically 7 days (one week), but can vary.
55
+ */
56
+ plannedMicrocycleLengthInDays: z.int().positive(),
57
+ /**
58
+ * The planned rest days within each microcycle, represented as day indices.
59
+ *
60
+ * For example, [0, 3] would indicate rest on the first and fourth days of
61
+ * the microcycle.
62
+ */
63
+ plannedMicrocycleRestDays: z.array(z.int().nonnegative()).default([]),
64
+ /**
65
+ * The planned total number of microcycles including accumulation and deload.
66
+ *
67
+ * Should typically be 5-9 microcycles (4-8 accumulation weeks + 1 deload week).
68
+ */
69
+ plannedMicrocycleCount: z.int().min(2).max(20).nullish(),
70
+ /**
71
+ * The date this mesocycle was completed.
72
+ *
73
+ * This should be set after the user gets a "success" completion screen and
74
+ * has buttoned up any last prompts. This should guide them into the next
75
+ * mesocycle.
76
+ */
77
+ completedDate: z.date().nullish()
78
+ })
79
+ .refine((data) => data.calibratedExercises.length >= data.plannedSessionCountPerMicrocycle, {
80
+ message: 'Number of calibrated exercises must be at least equal to planned sessions per microcycle.' +
81
+ ' Create a slight variation of an existing exercise if needed.',
82
+ path: ['calibratedExercises']
83
+ });
84
+ //# sourceMappingURL=WorkoutMesocycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkoutMesocycle.js","sourceRoot":"","sources":["../../../src/documents/workout/WorkoutMesocycle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EACL,0BAA0B,EAC1B,4CAA4C,EAC7C,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,sCAAyB,CAAA;IACzB,gDAAmC,CAAA;IACnC,wBAAW,CAAA;IACX,kCAAqB,CAAA;AACvB,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAE3D;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC;KACpC,MAAM,CAAC;IACN,GAAG,0BAA0B,CAAC,KAAK;IACnC,GAAG,oBAAoB,CAAC,KAAK;IAC7B,GAAG,4CAA4C,CAAC,KAAK;IACrD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,OAAO,CAAC,wBAAwB,CAAC;IAC9E;;OAEG;IACH,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAC3B;;;;;OAKG;IACH,mBAAmB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACpF;;OAEG;IACH,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;IAC5B;;OAEG;IACH,gCAAgC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACpD;;;;OAIG;IACH,6BAA6B,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACjD;;;;;OAKG;IACH,yBAAyB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACrE;;;;OAIG;IACH,sBAAsB,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE;IACxD;;;;;;OAMG;IACH,aAAa,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE;CAClC,CAAC;KACD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,MAAM,IAAI,IAAI,CAAC,gCAAgC,EAAE;IAC1F,OAAO,EACL,2FAA2F;QAC3F,+DAA+D;IACjE,IAAI,EAAE,CAAC,qBAAqB,CAAC;CAC9B,CAAC,CAAC"}
@@ -0,0 +1,102 @@
1
+ import type { UUID } from 'crypto';
2
+ import { z } from 'zod';
3
+ import { RequiredUserIdSchema } from '../../schemas/required-refs/RequiredUserId.js';
4
+ import {
5
+ BaseDocumentWithTypeSchema,
6
+ BaseDocumentWithUpdatedAndCreatedDatesSchema
7
+ } from '../BaseDocument.js';
8
+
9
+ /**
10
+ * The type of mesocycle.
11
+ *
12
+ * - MuscleGain: Automatic recommendations will be made for muscle gain
13
+ * - Resensitization: Automatic recommendations for MV training (maintenance)
14
+ * - Cut: Automatic recommendations for fat loss while maintaining muscle
15
+ * - FreeForm: No automatic recommendations, user has full control
16
+ */
17
+ export enum CycleType {
18
+ MuscleGain = 'MuscleGain',
19
+ Resensitization = 'Resensitization',
20
+ Cut = 'Cut',
21
+ FreeForm = 'FreeForm'
22
+ }
23
+
24
+ /**
25
+ * The docType value for WorkoutMesocycle documents.
26
+ */
27
+ export const WorkoutMesocycle_docType = 'workoutMesocycle';
28
+
29
+ /**
30
+ * The schema for {@link WorkoutMesocycle} documents.
31
+ */
32
+ export const WorkoutMesocycleSchema = z
33
+ .object({
34
+ ...BaseDocumentWithTypeSchema.shape,
35
+ ...RequiredUserIdSchema.shape,
36
+ ...BaseDocumentWithUpdatedAndCreatedDatesSchema.shape,
37
+ docType: z.literal(WorkoutMesocycle_docType).default(WorkoutMesocycle_docType),
38
+ /**
39
+ * An optional title for this mesocycle.
40
+ */
41
+ title: z.string().nullish(),
42
+ /**
43
+ * The IDs of WorkoutExerciseCalibration documents used for this mesocycle.
44
+ *
45
+ * This locks which calibration was used for a mesocycle so historical 1RM
46
+ * values remain accurate even if calibrations are changed later.
47
+ */
48
+ calibratedExercises: z.array(z.uuidv7().transform((val) => val as UUID)).default([]),
49
+ /**
50
+ * The type of this mesocycle. See {@link CycleType} for details.
51
+ */
52
+ cycleType: z.enum(CycleType),
53
+ /**
54
+ * The planned number of workout sessions per microcycle.
55
+ */
56
+ plannedSessionCountPerMicrocycle: z.int().positive(),
57
+ /**
58
+ * The planned length of each microcycle in days.
59
+ *
60
+ * Typically 7 days (one week), but can vary.
61
+ */
62
+ plannedMicrocycleLengthInDays: z.int().positive(),
63
+ /**
64
+ * The planned rest days within each microcycle, represented as day indices.
65
+ *
66
+ * For example, [0, 3] would indicate rest on the first and fourth days of
67
+ * the microcycle.
68
+ */
69
+ plannedMicrocycleRestDays: z.array(z.int().nonnegative()).default([]),
70
+ /**
71
+ * The planned total number of microcycles including accumulation and deload.
72
+ *
73
+ * Should typically be 5-9 microcycles (4-8 accumulation weeks + 1 deload week).
74
+ */
75
+ plannedMicrocycleCount: z.int().min(2).max(20).nullish(),
76
+ /**
77
+ * The date this mesocycle was completed.
78
+ *
79
+ * This should be set after the user gets a "success" completion screen and
80
+ * has buttoned up any last prompts. This should guide them into the next
81
+ * mesocycle.
82
+ */
83
+ completedDate: z.date().nullish()
84
+ })
85
+ .refine((data) => data.calibratedExercises.length >= data.plannedSessionCountPerMicrocycle, {
86
+ message:
87
+ 'Number of calibrated exercises must be at least equal to planned sessions per microcycle.' +
88
+ ' Create a slight variation of an existing exercise if needed.',
89
+ path: ['calibratedExercises']
90
+ });
91
+
92
+ /**
93
+ * Represents a mesocycle - an organized sequence of microcycles ordered to
94
+ * elicit a set of distinct training adaptations.
95
+ *
96
+ * A typical mesocycle is composed of two distinct phases:
97
+ * 1. Accumulation phase: Progress from MEV towards MRV
98
+ * 2. Deload phase: Shorter recovery period
99
+ *
100
+ * The accumulation phase should last 4-8 weeks, followed by a deload phase.
101
+ */
102
+ export type WorkoutMesocycle = z.infer<typeof WorkoutMesocycleSchema>;
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The docType value for WorkoutMicrocycle documents.
4
+ */
5
+ export declare const WorkoutMicrocycle_docType = "workoutMicrocycle";
6
+ /**
7
+ * The schema for {@link WorkoutMicrocycle} documents.
8
+ */
9
+ export declare const WorkoutMicrocycleSchema: z.ZodObject<{
10
+ docType: z.ZodDefault<z.ZodLiteral<"workoutMicrocycle">>;
11
+ workoutMesocycleId: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUUID, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>>>;
12
+ startDate: z.ZodDate;
13
+ endDate: z.ZodDate;
14
+ sessionOrder: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodUUID, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>>>;
15
+ createdDate: z.ZodDefault<z.ZodDate>;
16
+ lastUpdatedDate: z.ZodDefault<z.ZodDate>;
17
+ _id: z.ZodPipe<z.ZodDefault<z.ZodUUID>, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>;
18
+ userId: z.ZodPipe<z.ZodUUID, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>;
19
+ }, z.core.$strip>;
20
+ /**
21
+ * Represents a microcycle - the shortest cycle of training that includes all
22
+ * workout sessions and rest days and is repeated.
23
+ *
24
+ * Typically, but not always, this is a week (7 days).
25
+ */
26
+ export type WorkoutMicrocycle = z.infer<typeof WorkoutMicrocycleSchema>;
27
+ //# sourceMappingURL=WorkoutMicrocycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkoutMicrocycle.d.ts","sourceRoot":"","sources":["../../../src/documents/workout/WorkoutMicrocycle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;GAEG;AACH,eAAO,MAAM,yBAAyB,sBAAsB,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;iBA8BlC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { z } from 'zod';
2
+ import { RequiredUserIdSchema } from '../../schemas/required-refs/RequiredUserId.js';
3
+ import { BaseDocumentWithTypeSchema, BaseDocumentWithUpdatedAndCreatedDatesSchema } from '../BaseDocument.js';
4
+ /**
5
+ * The docType value for WorkoutMicrocycle documents.
6
+ */
7
+ export const WorkoutMicrocycle_docType = 'workoutMicrocycle';
8
+ /**
9
+ * The schema for {@link WorkoutMicrocycle} documents.
10
+ */
11
+ export const WorkoutMicrocycleSchema = z.object({
12
+ ...BaseDocumentWithTypeSchema.shape,
13
+ ...RequiredUserIdSchema.shape,
14
+ ...BaseDocumentWithUpdatedAndCreatedDatesSchema.shape,
15
+ docType: z.literal(WorkoutMicrocycle_docType).default(WorkoutMicrocycle_docType),
16
+ /**
17
+ * The ID of the mesocycle this microcycle belongs to.
18
+ *
19
+ * This is optional because users can track workouts outside of a mesocycle.
20
+ */
21
+ workoutMesocycleId: z
22
+ .uuidv7()
23
+ .transform((val) => val)
24
+ .nullish(),
25
+ /**
26
+ * The start date of this microcycle.
27
+ */
28
+ startDate: z.date(),
29
+ /**
30
+ * The end date of this microcycle.
31
+ */
32
+ endDate: z.date(),
33
+ /**
34
+ * The order of sessions in this microcycle, represented as an array of
35
+ * WorkoutSession IDs.
36
+ *
37
+ * This makes it easier to reason about the order of sessions before dates
38
+ * are assigned.
39
+ */
40
+ sessionOrder: z.array(z.uuidv7().transform((val) => val)).default([])
41
+ });
42
+ //# sourceMappingURL=WorkoutMicrocycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkoutMicrocycle.js","sourceRoot":"","sources":["../../../src/documents/workout/WorkoutMicrocycle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EACL,0BAA0B,EAC1B,4CAA4C,EAC7C,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,mBAAmB,CAAC;AAE7D;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,GAAG,0BAA0B,CAAC,KAAK;IACnC,GAAG,oBAAoB,CAAC,KAAK;IAC7B,GAAG,4CAA4C,CAAC,KAAK;IACrD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAAC,yBAAyB,CAAC;IAChF;;;;OAIG;IACH,kBAAkB,EAAE,CAAC;SAClB,MAAM,EAAE;SACR,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAW,CAAC;SAC/B,OAAO,EAAE;IACZ;;OAEG;IACH,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE;IACnB;;OAEG;IACH,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE;IACjB;;;;;;OAMG;IACH,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CAC9E,CAAC,CAAC"}
@@ -0,0 +1,55 @@
1
+ import type { UUID } from 'crypto';
2
+ import { z } from 'zod';
3
+ import { RequiredUserIdSchema } from '../../schemas/required-refs/RequiredUserId.js';
4
+ import {
5
+ BaseDocumentWithTypeSchema,
6
+ BaseDocumentWithUpdatedAndCreatedDatesSchema
7
+ } from '../BaseDocument.js';
8
+
9
+ /**
10
+ * The docType value for WorkoutMicrocycle documents.
11
+ */
12
+ export const WorkoutMicrocycle_docType = 'workoutMicrocycle';
13
+
14
+ /**
15
+ * The schema for {@link WorkoutMicrocycle} documents.
16
+ */
17
+ export const WorkoutMicrocycleSchema = z.object({
18
+ ...BaseDocumentWithTypeSchema.shape,
19
+ ...RequiredUserIdSchema.shape,
20
+ ...BaseDocumentWithUpdatedAndCreatedDatesSchema.shape,
21
+ docType: z.literal(WorkoutMicrocycle_docType).default(WorkoutMicrocycle_docType),
22
+ /**
23
+ * The ID of the mesocycle this microcycle belongs to.
24
+ *
25
+ * This is optional because users can track workouts outside of a mesocycle.
26
+ */
27
+ workoutMesocycleId: z
28
+ .uuidv7()
29
+ .transform((val) => val as UUID)
30
+ .nullish(),
31
+ /**
32
+ * The start date of this microcycle.
33
+ */
34
+ startDate: z.date(),
35
+ /**
36
+ * The end date of this microcycle.
37
+ */
38
+ endDate: z.date(),
39
+ /**
40
+ * The order of sessions in this microcycle, represented as an array of
41
+ * WorkoutSession IDs.
42
+ *
43
+ * This makes it easier to reason about the order of sessions before dates
44
+ * are assigned.
45
+ */
46
+ sessionOrder: z.array(z.uuidv7().transform((val) => val as UUID)).default([])
47
+ });
48
+
49
+ /**
50
+ * Represents a microcycle - the shortest cycle of training that includes all
51
+ * workout sessions and rest days and is repeated.
52
+ *
53
+ * Typically, but not always, this is a week (7 days).
54
+ */
55
+ export type WorkoutMicrocycle = z.infer<typeof WorkoutMicrocycleSchema>;
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The docType value for WorkoutMuscleGroup documents.
4
+ */
5
+ export declare const WorkoutMuscleGroup_docType = "workoutMuscleGroup";
6
+ /**
7
+ * The schema for {@link WorkoutMuscleGroup} documents.
8
+ */
9
+ export declare const WorkoutMuscleGroupSchema: z.ZodObject<{
10
+ docType: z.ZodDefault<z.ZodLiteral<"workoutMuscleGroup">>;
11
+ name: z.ZodString;
12
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
+ createdDate: z.ZodDefault<z.ZodDate>;
14
+ lastUpdatedDate: z.ZodDefault<z.ZodDate>;
15
+ _id: z.ZodPipe<z.ZodDefault<z.ZodUUID>, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>;
16
+ userId: z.ZodPipe<z.ZodUUID, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>;
17
+ }, z.core.$strip>;
18
+ /**
19
+ * Represents a muscle group that can be targeted by exercises.
20
+ */
21
+ export type WorkoutMuscleGroup = z.infer<typeof WorkoutMuscleGroupSchema>;
22
+ //# sourceMappingURL=WorkoutMuscleGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkoutMuscleGroup.d.ts","sourceRoot":"","sources":["../../../src/documents/workout/WorkoutMuscleGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;GAEG;AACH,eAAO,MAAM,0BAA0B,uBAAuB,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;iBAanC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ import { RequiredUserIdSchema } from '../../schemas/required-refs/RequiredUserId.js';
3
+ import { BaseDocumentWithTypeSchema, BaseDocumentWithUpdatedAndCreatedDatesSchema } from '../BaseDocument.js';
4
+ /**
5
+ * The docType value for WorkoutMuscleGroup documents.
6
+ */
7
+ export const WorkoutMuscleGroup_docType = 'workoutMuscleGroup';
8
+ /**
9
+ * The schema for {@link WorkoutMuscleGroup} documents.
10
+ */
11
+ export const WorkoutMuscleGroupSchema = z.object({
12
+ ...BaseDocumentWithTypeSchema.shape,
13
+ ...RequiredUserIdSchema.shape,
14
+ ...BaseDocumentWithUpdatedAndCreatedDatesSchema.shape,
15
+ docType: z.literal(WorkoutMuscleGroup_docType).default(WorkoutMuscleGroup_docType),
16
+ /**
17
+ * The name of the muscle group.
18
+ */
19
+ name: z.string(),
20
+ /**
21
+ * An optional description of the muscle group.
22
+ */
23
+ description: z.string().nullish()
24
+ });
25
+ //# sourceMappingURL=WorkoutMuscleGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkoutMuscleGroup.js","sourceRoot":"","sources":["../../../src/documents/workout/WorkoutMuscleGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EACL,0BAA0B,EAC1B,4CAA4C,EAC7C,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAAoB,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,GAAG,0BAA0B,CAAC,KAAK;IACnC,GAAG,oBAAoB,CAAC,KAAK;IAC7B,GAAG,4CAA4C,CAAC,KAAK;IACrD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC;IAClF;;OAEG;IACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB;;OAEG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;CAClC,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ import { RequiredUserIdSchema } from '../../schemas/required-refs/RequiredUserId.js';
3
+ import {
4
+ BaseDocumentWithTypeSchema,
5
+ BaseDocumentWithUpdatedAndCreatedDatesSchema
6
+ } from '../BaseDocument.js';
7
+
8
+ /**
9
+ * The docType value for WorkoutMuscleGroup documents.
10
+ */
11
+ export const WorkoutMuscleGroup_docType = 'workoutMuscleGroup';
12
+
13
+ /**
14
+ * The schema for {@link WorkoutMuscleGroup} documents.
15
+ */
16
+ export const WorkoutMuscleGroupSchema = z.object({
17
+ ...BaseDocumentWithTypeSchema.shape,
18
+ ...RequiredUserIdSchema.shape,
19
+ ...BaseDocumentWithUpdatedAndCreatedDatesSchema.shape,
20
+ docType: z.literal(WorkoutMuscleGroup_docType).default(WorkoutMuscleGroup_docType),
21
+ /**
22
+ * The name of the muscle group.
23
+ */
24
+ name: z.string(),
25
+ /**
26
+ * An optional description of the muscle group.
27
+ */
28
+ description: z.string().nullish()
29
+ });
30
+
31
+ /**
32
+ * Represents a muscle group that can be targeted by exercises.
33
+ */
34
+ export type WorkoutMuscleGroup = z.infer<typeof WorkoutMuscleGroupSchema>;
@@ -0,0 +1,39 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The docType value for WorkoutSession documents.
4
+ */
5
+ export declare const WorkoutSession_docType = "workoutSession";
6
+ /**
7
+ * The schema for {@link WorkoutSession} documents.
8
+ */
9
+ export declare const WorkoutSessionSchema: z.ZodObject<{
10
+ docType: z.ZodDefault<z.ZodLiteral<"workoutSession">>;
11
+ workoutMicrocycleId: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUUID, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>>>;
12
+ title: z.ZodString;
13
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
+ startTime: z.ZodDate;
15
+ complete: z.ZodDefault<z.ZodBoolean>;
16
+ sessionExerciseOrder: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodUUID, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>>>;
17
+ rsm: z.ZodOptional<z.ZodNullable<z.ZodObject<{
18
+ mindMuscleConnection: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
19
+ pump: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
20
+ disruption: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
21
+ }, z.core.$strip>>>;
22
+ fatigue: z.ZodOptional<z.ZodNullable<z.ZodObject<{
23
+ jointAndTissueDisruption: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
24
+ perceivedEffort: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
25
+ unusedMusclePerformance: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
26
+ }, z.core.$strip>>>;
27
+ createdDate: z.ZodDefault<z.ZodDate>;
28
+ lastUpdatedDate: z.ZodDefault<z.ZodDate>;
29
+ _id: z.ZodPipe<z.ZodDefault<z.ZodUUID>, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>;
30
+ userId: z.ZodPipe<z.ZodUUID, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>;
31
+ }, z.core.$strip>;
32
+ /**
33
+ * Represents a workout session containing one or more exercises.
34
+ *
35
+ * A session can be part of a microcycle (which may be part of a mesocycle) or
36
+ * can be tracked independently for free-form workout tracking.
37
+ */
38
+ export type WorkoutSession = z.infer<typeof WorkoutSessionSchema>;
39
+ //# sourceMappingURL=WorkoutSession.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkoutSession.d.ts","sourceRoot":"","sources":["../../../src/documents/workout/WorkoutSession.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;GAEG;AACH,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;iBAoD/B,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,66 @@
1
+ import { z } from 'zod';
2
+ import { FatigueSchema } from '../../embedded-types/workout/Fatigue.js';
3
+ import { RsmSchema } from '../../embedded-types/workout/Rsm.js';
4
+ import { RequiredUserIdSchema } from '../../schemas/required-refs/RequiredUserId.js';
5
+ import { BaseDocumentWithTypeSchema, BaseDocumentWithUpdatedAndCreatedDatesSchema } from '../BaseDocument.js';
6
+ /**
7
+ * The docType value for WorkoutSession documents.
8
+ */
9
+ export const WorkoutSession_docType = 'workoutSession';
10
+ /**
11
+ * The schema for {@link WorkoutSession} documents.
12
+ */
13
+ export const WorkoutSessionSchema = z.object({
14
+ ...BaseDocumentWithTypeSchema.shape,
15
+ ...RequiredUserIdSchema.shape,
16
+ ...BaseDocumentWithUpdatedAndCreatedDatesSchema.shape,
17
+ docType: z.literal(WorkoutSession_docType).default(WorkoutSession_docType),
18
+ /**
19
+ * The ID of the microcycle this session belongs to.
20
+ *
21
+ * This is optional because users can track workouts outside of a microcycle.
22
+ */
23
+ workoutMicrocycleId: z
24
+ .uuidv7()
25
+ .transform((val) => val)
26
+ .nullish(),
27
+ /**
28
+ * The title of this workout session.
29
+ */
30
+ title: z.string(),
31
+ /**
32
+ * An optional description of this workout session.
33
+ */
34
+ description: z.string().nullish(),
35
+ /**
36
+ * The start time of this workout session.
37
+ */
38
+ startTime: z.date(),
39
+ /**
40
+ * Whether this workout session has been completed.
41
+ */
42
+ complete: z.boolean().default(false),
43
+ /**
44
+ * The order of exercises in this session, represented as an array of
45
+ * WorkoutSessionExercise IDs.
46
+ *
47
+ * This was chosen as a compromise for querying efficiency in order to quickly
48
+ * get metrics like "Last time you did this exercise when it was preceded by
49
+ * these 4 other exercises, you did this".
50
+ */
51
+ sessionExerciseOrder: z.array(z.uuidv7().transform((val) => val)).default([]),
52
+ /**
53
+ * The Raw Stimulus Magnitude for this session.
54
+ *
55
+ * This is the sum of mindMuscleConnection, pump, and disruption (0-9).
56
+ */
57
+ rsm: RsmSchema.nullish(),
58
+ /**
59
+ * The fatigue measurement for this session.
60
+ *
61
+ * The total fatigue score is the sum of all three components (0-9).
62
+ * The Stimulus to Fatigue Ratio (SFR) can be calculated as RSM total / Fatigue total.
63
+ */
64
+ fatigue: FatigueSchema.nullish()
65
+ });
66
+ //# sourceMappingURL=WorkoutSession.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkoutSession.js","sourceRoot":"","sources":["../../../src/documents/workout/WorkoutSession.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EACL,0BAA0B,EAC1B,4CAA4C,EAC7C,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AAEvD;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,GAAG,0BAA0B,CAAC,KAAK;IACnC,GAAG,oBAAoB,CAAC,KAAK;IAC7B,GAAG,4CAA4C,CAAC,KAAK;IACrD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC;IAC1E;;;;OAIG;IACH,mBAAmB,EAAE,CAAC;SACnB,MAAM,EAAE;SACR,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAW,CAAC;SAC/B,OAAO,EAAE;IACZ;;OAEG;IACH,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB;;OAEG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IACjC;;OAEG;IACH,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE;IACnB;;OAEG;IACH,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACpC;;;;;;;OAOG;IACH,oBAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACrF;;;;OAIG;IACH,GAAG,EAAE,SAAS,CAAC,OAAO,EAAE;IACxB;;;;;OAKG;IACH,OAAO,EAAE,aAAa,CAAC,OAAO,EAAE;CACjC,CAAC,CAAC"}
@@ -0,0 +1,79 @@
1
+ import type { UUID } from 'crypto';
2
+ import { z } from 'zod';
3
+ import { FatigueSchema } from '../../embedded-types/workout/Fatigue.js';
4
+ import { RsmSchema } from '../../embedded-types/workout/Rsm.js';
5
+ import { RequiredUserIdSchema } from '../../schemas/required-refs/RequiredUserId.js';
6
+ import {
7
+ BaseDocumentWithTypeSchema,
8
+ BaseDocumentWithUpdatedAndCreatedDatesSchema
9
+ } from '../BaseDocument.js';
10
+
11
+ /**
12
+ * The docType value for WorkoutSession documents.
13
+ */
14
+ export const WorkoutSession_docType = 'workoutSession';
15
+
16
+ /**
17
+ * The schema for {@link WorkoutSession} documents.
18
+ */
19
+ export const WorkoutSessionSchema = z.object({
20
+ ...BaseDocumentWithTypeSchema.shape,
21
+ ...RequiredUserIdSchema.shape,
22
+ ...BaseDocumentWithUpdatedAndCreatedDatesSchema.shape,
23
+ docType: z.literal(WorkoutSession_docType).default(WorkoutSession_docType),
24
+ /**
25
+ * The ID of the microcycle this session belongs to.
26
+ *
27
+ * This is optional because users can track workouts outside of a microcycle.
28
+ */
29
+ workoutMicrocycleId: z
30
+ .uuidv7()
31
+ .transform((val) => val as UUID)
32
+ .nullish(),
33
+ /**
34
+ * The title of this workout session.
35
+ */
36
+ title: z.string(),
37
+ /**
38
+ * An optional description of this workout session.
39
+ */
40
+ description: z.string().nullish(),
41
+ /**
42
+ * The start time of this workout session.
43
+ */
44
+ startTime: z.date(),
45
+ /**
46
+ * Whether this workout session has been completed.
47
+ */
48
+ complete: z.boolean().default(false),
49
+ /**
50
+ * The order of exercises in this session, represented as an array of
51
+ * WorkoutSessionExercise IDs.
52
+ *
53
+ * This was chosen as a compromise for querying efficiency in order to quickly
54
+ * get metrics like "Last time you did this exercise when it was preceded by
55
+ * these 4 other exercises, you did this".
56
+ */
57
+ sessionExerciseOrder: z.array(z.uuidv7().transform((val) => val as UUID)).default([]),
58
+ /**
59
+ * The Raw Stimulus Magnitude for this session.
60
+ *
61
+ * This is the sum of mindMuscleConnection, pump, and disruption (0-9).
62
+ */
63
+ rsm: RsmSchema.nullish(),
64
+ /**
65
+ * The fatigue measurement for this session.
66
+ *
67
+ * The total fatigue score is the sum of all three components (0-9).
68
+ * The Stimulus to Fatigue Ratio (SFR) can be calculated as RSM total / Fatigue total.
69
+ */
70
+ fatigue: FatigueSchema.nullish()
71
+ });
72
+
73
+ /**
74
+ * Represents a workout session containing one or more exercises.
75
+ *
76
+ * A session can be part of a microcycle (which may be part of a mesocycle) or
77
+ * can be tracked independently for free-form workout tracking.
78
+ */
79
+ export type WorkoutSession = z.infer<typeof WorkoutSessionSchema>;
@@ -0,0 +1,39 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The docType value for WorkoutSessionExercise documents.
4
+ */
5
+ export declare const WorkoutSessionExercise_docType = "workoutSessionExercise";
6
+ /**
7
+ * The schema for {@link WorkoutSessionExercise} documents.
8
+ */
9
+ export declare const WorkoutSessionExerciseSchema: z.ZodObject<{
10
+ docType: z.ZodDefault<z.ZodLiteral<"workoutSessionExercise">>;
11
+ workoutSessionId: z.ZodPipe<z.ZodUUID, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>;
12
+ workoutExerciseId: z.ZodPipe<z.ZodUUID, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>;
13
+ setOrder: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodUUID, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>>>;
14
+ rsm: z.ZodOptional<z.ZodNullable<z.ZodObject<{
15
+ mindMuscleConnection: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
16
+ pump: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
17
+ disruption: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
18
+ }, z.core.$strip>>>;
19
+ fatigue: z.ZodOptional<z.ZodNullable<z.ZodObject<{
20
+ jointAndTissueDisruption: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
21
+ perceivedEffort: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
22
+ unusedMusclePerformance: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
23
+ }, z.core.$strip>>>;
24
+ sorenessScore: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
25
+ performanceScore: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
26
+ isRecoveryExercise: z.ZodDefault<z.ZodBoolean>;
27
+ createdDate: z.ZodDefault<z.ZodDate>;
28
+ lastUpdatedDate: z.ZodDefault<z.ZodDate>;
29
+ _id: z.ZodPipe<z.ZodDefault<z.ZodUUID>, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>;
30
+ userId: z.ZodPipe<z.ZodUUID, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>;
31
+ }, z.core.$strip>;
32
+ /**
33
+ * Represents a specific exercise performed within a workout session.
34
+ *
35
+ * This is a join entity that connects a WorkoutSession to a WorkoutExercise
36
+ * and contains the sets performed for that exercise in that session.
37
+ */
38
+ export type WorkoutSessionExercise = z.infer<typeof WorkoutSessionExerciseSchema>;
39
+ //# sourceMappingURL=WorkoutSessionExercise.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkoutSessionExercise.d.ts","sourceRoot":"","sources":["../../../src/documents/workout/WorkoutSessionExercise.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;GAEG;AACH,eAAO,MAAM,8BAA8B,2BAA2B,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;iBAoDvC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}