@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,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 WorkoutSessionExercise documents.
8
+ */
9
+ export const WorkoutSessionExercise_docType = 'workoutSessionExercise';
10
+ /**
11
+ * The schema for {@link WorkoutSessionExercise} documents.
12
+ */
13
+ export const WorkoutSessionExerciseSchema = z.object({
14
+ ...BaseDocumentWithTypeSchema.shape,
15
+ ...RequiredUserIdSchema.shape,
16
+ ...BaseDocumentWithUpdatedAndCreatedDatesSchema.shape,
17
+ docType: z.literal(WorkoutSessionExercise_docType).default(WorkoutSessionExercise_docType),
18
+ /**
19
+ * The ID of the workout session this exercise belongs to.
20
+ */
21
+ workoutSessionId: z.uuidv7().transform((val) => val),
22
+ /**
23
+ * The ID of the workout exercise being performed.
24
+ */
25
+ workoutExerciseId: z.uuidv7().transform((val) => val),
26
+ /**
27
+ * The order of sets for this exercise, represented as an array of WorkoutSet IDs.
28
+ */
29
+ setOrder: z.array(z.uuidv7().transform((val) => val)).default([]),
30
+ /**
31
+ * The Raw Stimulus Magnitude for this specific exercise within the session.
32
+ *
33
+ * This is the sum of mindMuscleConnection, pump, and disruption (0-9).
34
+ */
35
+ rsm: RsmSchema.nullish(),
36
+ /**
37
+ * The fatigue measurement for this specific exercise within the session.
38
+ *
39
+ * The total fatigue score is the sum of all three components (0-9).
40
+ */
41
+ fatigue: FatigueSchema.nullish(),
42
+ /**
43
+ * The soreness score for this session exercise (0-3).
44
+ *
45
+ * - 0: You did not get at all sore in the target muscles
46
+ * - 1: You got stiff for a few hours after training and had mild soreness that resolved by next session
47
+ * - 2: You got DOMS that resolved just in time for the next session
48
+ * - 3: You got DOMS that remained for the next session
49
+ */
50
+ sorenessScore: z.int().min(0).max(3).nullish(),
51
+ /**
52
+ * The performance score for this session exercise (0-3).
53
+ *
54
+ * - 0: You hit your target reps, but had to do 2+ more reps than planned to hit target RIR, or hit target reps at 2+ reps before target RIR
55
+ * - 1: You hit your target reps, but had to do 0-1 more reps than planned to hit target RIR, or hit target reps at 1 rep before target RIR
56
+ * - 2: You hit your target reps after your target RIR
57
+ * - 3: You could not match last week's reps at any RIR
58
+ */
59
+ performanceScore: z.int().min(0).max(3).nullish(),
60
+ /**
61
+ * Determines if this exercise is being used as a recovery exercise, due to high soreness / low
62
+ * performance in the previous microcycle for this exercise.
63
+ */
64
+ isRecoveryExercise: z.boolean().default(false)
65
+ });
66
+ //# sourceMappingURL=WorkoutSessionExercise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkoutSessionExercise.js","sourceRoot":"","sources":["../../../src/documents/workout/WorkoutSessionExercise.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,8BAA8B,GAAG,wBAAwB,CAAC;AAEvE;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,GAAG,0BAA0B,CAAC,KAAK;IACnC,GAAG,oBAAoB,CAAC,KAAK;IAC7B,GAAG,4CAA4C,CAAC,KAAK;IACrD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC,OAAO,CAAC,8BAA8B,CAAC;IAC1F;;OAEG;IACH,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAW,CAAC;IAC5D;;OAEG;IACH,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAW,CAAC;IAC7D;;OAEG;IACH,QAAQ,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;IACzE;;;;OAIG;IACH,GAAG,EAAE,SAAS,CAAC,OAAO,EAAE;IACxB;;;;OAIG;IACH,OAAO,EAAE,aAAa,CAAC,OAAO,EAAE;IAChC;;;;;;;OAOG;IACH,aAAa,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;IAC9C;;;;;;;OAOG;IACH,gBAAgB,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;IACjD;;;OAGG;IACH,kBAAkB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CAC/C,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 WorkoutSessionExercise documents.
13
+ */
14
+ export const WorkoutSessionExercise_docType = 'workoutSessionExercise';
15
+
16
+ /**
17
+ * The schema for {@link WorkoutSessionExercise} documents.
18
+ */
19
+ export const WorkoutSessionExerciseSchema = z.object({
20
+ ...BaseDocumentWithTypeSchema.shape,
21
+ ...RequiredUserIdSchema.shape,
22
+ ...BaseDocumentWithUpdatedAndCreatedDatesSchema.shape,
23
+ docType: z.literal(WorkoutSessionExercise_docType).default(WorkoutSessionExercise_docType),
24
+ /**
25
+ * The ID of the workout session this exercise belongs to.
26
+ */
27
+ workoutSessionId: z.uuidv7().transform((val) => val as UUID),
28
+ /**
29
+ * The ID of the workout exercise being performed.
30
+ */
31
+ workoutExerciseId: z.uuidv7().transform((val) => val as UUID),
32
+ /**
33
+ * The order of sets for this exercise, represented as an array of WorkoutSet IDs.
34
+ */
35
+ setOrder: z.array(z.uuidv7().transform((val) => val as UUID)).default([]),
36
+ /**
37
+ * The Raw Stimulus Magnitude for this specific exercise within the session.
38
+ *
39
+ * This is the sum of mindMuscleConnection, pump, and disruption (0-9).
40
+ */
41
+ rsm: RsmSchema.nullish(),
42
+ /**
43
+ * The fatigue measurement for this specific exercise within the session.
44
+ *
45
+ * The total fatigue score is the sum of all three components (0-9).
46
+ */
47
+ fatigue: FatigueSchema.nullish(),
48
+ /**
49
+ * The soreness score for this session exercise (0-3).
50
+ *
51
+ * - 0: You did not get at all sore in the target muscles
52
+ * - 1: You got stiff for a few hours after training and had mild soreness that resolved by next session
53
+ * - 2: You got DOMS that resolved just in time for the next session
54
+ * - 3: You got DOMS that remained for the next session
55
+ */
56
+ sorenessScore: z.int().min(0).max(3).nullish(),
57
+ /**
58
+ * The performance score for this session exercise (0-3).
59
+ *
60
+ * - 0: You hit your target reps, but had to do 2+ more reps than planned to hit target RIR, or hit target reps at 2+ reps before target RIR
61
+ * - 1: You hit your target reps, but had to do 0-1 more reps than planned to hit target RIR, or hit target reps at 1 rep before target RIR
62
+ * - 2: You hit your target reps after your target RIR
63
+ * - 3: You could not match last week's reps at any RIR
64
+ */
65
+ performanceScore: z.int().min(0).max(3).nullish(),
66
+ /**
67
+ * Determines if this exercise is being used as a recovery exercise, due to high soreness / low
68
+ * performance in the previous microcycle for this exercise.
69
+ */
70
+ isRecoveryExercise: z.boolean().default(false)
71
+ });
72
+
73
+ /**
74
+ * Represents a specific exercise performed within a workout session.
75
+ *
76
+ * This is a join entity that connects a WorkoutSession to a WorkoutExercise
77
+ * and contains the sets performed for that exercise in that session.
78
+ */
79
+ export type WorkoutSessionExercise = z.infer<typeof WorkoutSessionExerciseSchema>;
@@ -0,0 +1,41 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The docType value for WorkoutSet documents.
4
+ */
5
+ export declare const WorkoutSet_docType = "workoutSet";
6
+ /**
7
+ * The schema for {@link WorkoutSet} documents.
8
+ */
9
+ export declare const WorkoutSetSchema: z.ZodObject<{
10
+ docType: z.ZodDefault<z.ZodLiteral<"workoutSet">>;
11
+ workoutExerciseId: z.ZodPipe<z.ZodUUID, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>;
12
+ workoutSessionId: z.ZodPipe<z.ZodUUID, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>;
13
+ workoutSessionExerciseId: z.ZodPipe<z.ZodUUID, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>;
14
+ plannedReps: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
15
+ plannedWeight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
16
+ plannedRir: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
17
+ actualReps: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
18
+ actualWeight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
19
+ rir: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
20
+ exerciseProperties: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
21
+ createdDate: z.ZodDefault<z.ZodDate>;
22
+ lastUpdatedDate: z.ZodDefault<z.ZodDate>;
23
+ _id: z.ZodPipe<z.ZodDefault<z.ZodUUID>, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>;
24
+ userId: z.ZodPipe<z.ZodUUID, z.ZodTransform<`${string}-${string}-${string}-${string}-${string}`, string>>;
25
+ }, z.core.$strip>;
26
+ /**
27
+ * Represents a single set of an exercise performed during a workout session.
28
+ *
29
+ * Sets track both planned and actual performance data, allowing for comparison
30
+ * between programming and execution. This is crucial for algorithm-based
31
+ * progression and adaptation.
32
+ *
33
+ * Effective sets are defined as sets with:
34
+ * - 5-30 reps
35
+ * - 0-5 RIR (Reps in Reserve)
36
+ * - Weight between 30% and 85% of 1RM per rep
37
+ *
38
+ * The recommended average RIR is 2-3 to balance stimulus and fatigue.
39
+ */
40
+ export type WorkoutSet = z.infer<typeof WorkoutSetSchema>;
41
+ //# sourceMappingURL=WorkoutSet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkoutSet.d.ts","sourceRoot":"","sources":["../../../src/documents/workout/WorkoutSet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;GAEG;AACH,eAAO,MAAM,kBAAkB,eAAe,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;iBAyD3B,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,69 @@
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 WorkoutSet documents.
6
+ */
7
+ export const WorkoutSet_docType = 'workoutSet';
8
+ /**
9
+ * The schema for {@link WorkoutSet} documents.
10
+ */
11
+ export const WorkoutSetSchema = z.object({
12
+ ...BaseDocumentWithTypeSchema.shape,
13
+ ...RequiredUserIdSchema.shape,
14
+ ...BaseDocumentWithUpdatedAndCreatedDatesSchema.shape,
15
+ docType: z.literal(WorkoutSet_docType).default(WorkoutSet_docType),
16
+ /**
17
+ * The ID of the workout exercise this set belongs to.
18
+ */
19
+ workoutExerciseId: z.uuidv7().transform((val) => val),
20
+ /**
21
+ * The ID of the workout session this set was performed in.
22
+ */
23
+ workoutSessionId: z.uuidv7().transform((val) => val),
24
+ /**
25
+ * The ID of the workout session exercise this set belongs to.
26
+ */
27
+ workoutSessionExerciseId: z.uuidv7().transform((val) => val),
28
+ /**
29
+ * The planned number of reps for this set.
30
+ */
31
+ plannedReps: z.int().positive().nullish(),
32
+ /**
33
+ * The planned weight for this set.
34
+ */
35
+ plannedWeight: z.number().nullish(),
36
+ /**
37
+ * The planned Reps in Reserve (RIR) for this set.
38
+ *
39
+ * RIR is the set's proximity to muscle failure - how many reps you have left
40
+ * before you completely fail to produce the movement.
41
+ *
42
+ * Recommended range is 2-3 RIR on average, with 0-5 RIR being the effective range.
43
+ */
44
+ plannedRir: z.int().nonnegative().nullish(),
45
+ /**
46
+ * The actual number of reps performed in this set.
47
+ */
48
+ actualReps: z.int().nonnegative().nullish(),
49
+ /**
50
+ * The actual weight used for this set.
51
+ */
52
+ actualWeight: z.number().nullish(),
53
+ /**
54
+ * The actual Reps in Reserve (RIR) for this set.
55
+ *
56
+ * This should be recorded to track proximity to failure and adjust future
57
+ * programming.
58
+ */
59
+ rir: z.int().nullish(),
60
+ /**
61
+ * Custom exercise properties for this set.
62
+ *
63
+ * This is populated from WorkoutExercise.customProperties at creation time.
64
+ * When customProperties are changed on the exercise, they should be updated
65
+ * on all existing WorkoutSet documents with that WorkoutExercise linked to it.
66
+ */
67
+ exerciseProperties: z.record(z.string(), z.unknown()).nullish()
68
+ });
69
+ //# sourceMappingURL=WorkoutSet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkoutSet.js","sourceRoot":"","sources":["../../../src/documents/workout/WorkoutSet.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,kBAAkB,GAAG,YAAY,CAAC;AAE/C;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,GAAG,0BAA0B,CAAC,KAAK;IACnC,GAAG,oBAAoB,CAAC,KAAK;IAC7B,GAAG,4CAA4C,CAAC,KAAK;IACrD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;IAClE;;OAEG;IACH,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAW,CAAC;IAC7D;;OAEG;IACH,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAW,CAAC;IAC5D;;OAEG;IACH,wBAAwB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAW,CAAC;IACpE;;OAEG;IACH,WAAW,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE;IACzC;;OAEG;IACH,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IACnC;;;;;;;OAOG;IACH,UAAU,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE;IAC3C;;OAEG;IACH,UAAU,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE;IAC3C;;OAEG;IACH,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAClC;;;;;OAKG;IACH,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;IACtB;;;;;;OAMG;IACH,kBAAkB,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CAChE,CAAC,CAAC"}
@@ -0,0 +1,90 @@
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 WorkoutSet documents.
11
+ */
12
+ export const WorkoutSet_docType = 'workoutSet';
13
+
14
+ /**
15
+ * The schema for {@link WorkoutSet} documents.
16
+ */
17
+ export const WorkoutSetSchema = z.object({
18
+ ...BaseDocumentWithTypeSchema.shape,
19
+ ...RequiredUserIdSchema.shape,
20
+ ...BaseDocumentWithUpdatedAndCreatedDatesSchema.shape,
21
+ docType: z.literal(WorkoutSet_docType).default(WorkoutSet_docType),
22
+ /**
23
+ * The ID of the workout exercise this set belongs to.
24
+ */
25
+ workoutExerciseId: z.uuidv7().transform((val) => val as UUID),
26
+ /**
27
+ * The ID of the workout session this set was performed in.
28
+ */
29
+ workoutSessionId: z.uuidv7().transform((val) => val as UUID),
30
+ /**
31
+ * The ID of the workout session exercise this set belongs to.
32
+ */
33
+ workoutSessionExerciseId: z.uuidv7().transform((val) => val as UUID),
34
+ /**
35
+ * The planned number of reps for this set.
36
+ */
37
+ plannedReps: z.int().positive().nullish(),
38
+ /**
39
+ * The planned weight for this set.
40
+ */
41
+ plannedWeight: z.number().nullish(),
42
+ /**
43
+ * The planned Reps in Reserve (RIR) for this set.
44
+ *
45
+ * RIR is the set's proximity to muscle failure - how many reps you have left
46
+ * before you completely fail to produce the movement.
47
+ *
48
+ * Recommended range is 2-3 RIR on average, with 0-5 RIR being the effective range.
49
+ */
50
+ plannedRir: z.int().nonnegative().nullish(),
51
+ /**
52
+ * The actual number of reps performed in this set.
53
+ */
54
+ actualReps: z.int().nonnegative().nullish(),
55
+ /**
56
+ * The actual weight used for this set.
57
+ */
58
+ actualWeight: z.number().nullish(),
59
+ /**
60
+ * The actual Reps in Reserve (RIR) for this set.
61
+ *
62
+ * This should be recorded to track proximity to failure and adjust future
63
+ * programming.
64
+ */
65
+ rir: z.int().nullish(),
66
+ /**
67
+ * Custom exercise properties for this set.
68
+ *
69
+ * This is populated from WorkoutExercise.customProperties at creation time.
70
+ * When customProperties are changed on the exercise, they should be updated
71
+ * on all existing WorkoutSet documents with that WorkoutExercise linked to it.
72
+ */
73
+ exerciseProperties: z.record(z.string(), z.unknown()).nullish()
74
+ });
75
+
76
+ /**
77
+ * Represents a single set of an exercise performed during a workout session.
78
+ *
79
+ * Sets track both planned and actual performance data, allowing for comparison
80
+ * between programming and execution. This is crucial for algorithm-based
81
+ * progression and adaptation.
82
+ *
83
+ * Effective sets are defined as sets with:
84
+ * - 5-30 reps
85
+ * - 0-5 RIR (Reps in Reserve)
86
+ * - Weight between 30% and 85% of 1RM per rep
87
+ *
88
+ * The recommended average RIR is 2-3 to balance stimulus and fatigue.
89
+ */
90
+ export type WorkoutSet = z.infer<typeof WorkoutSetSchema>;
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Zod schema for {@link Fatigue}.
4
+ */
5
+ export declare const FatigueSchema: z.ZodObject<{
6
+ jointAndTissueDisruption: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
7
+ perceivedEffort: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
8
+ unusedMusclePerformance: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
9
+ }, z.core.$strip>;
10
+ /**
11
+ * Fatigue measurement for a workout session or exercise.
12
+ *
13
+ * The Stimulus to Fatigue Ratio (SFR) can be calculated as RSM / total fatigue score.
14
+ */
15
+ export type Fatigue = z.infer<typeof FatigueSchema>;
16
+ //# sourceMappingURL=Fatigue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Fatigue.d.ts","sourceRoot":"","sources":["../../../src/embedded-types/workout/Fatigue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,aAAa;;;;iBA4BxB,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Zod schema for {@link Fatigue}.
4
+ */
5
+ export const FatigueSchema = z.object({
6
+ /**
7
+ * Joint and connective tissue disruption score (0-3).
8
+ *
9
+ * - 0: You had minimal to no pain or perturbation in your joints or connective tissues
10
+ * - 1: You had some pain or perturbation in your joints and connective tissues but recovered by the next day
11
+ * - 2: You had some persistent pain or tightness in your connective tissues that lasted through the following day or several days
12
+ * - 3: You develop chronic pain in the joints and connective tissues that persists across days to weeks or longer
13
+ */
14
+ jointAndTissueDisruption: z.int().min(0).max(3).nullish(),
15
+ /**
16
+ * Perceived effort score (0-3).
17
+ *
18
+ * - 0: Training felt very easy and hardly taxed you psychologically
19
+ * - 1: You put effort into the training, but felt recovered by the end of the day
20
+ * - 2: You put a large effort into the training and felt drained through the next day
21
+ * - 3: You put an all-out effort into the training and felt drained for days
22
+ */
23
+ perceivedEffort: z.int().min(0).max(3).nullish(),
24
+ /**
25
+ * Unused muscle performance score (0-3).
26
+ *
27
+ * - 0: Performance on subsequent exercises targeting unused muscles was better than expected
28
+ * - 1: Performance on subsequent exercises targeting unused muscles was as expected
29
+ * - 2: Performance on subsequent exercises targeting unused muscles was worse than expected
30
+ * - 3: Your performance on subsequent exercises targeting unused muscles was hugely deteriorated
31
+ */
32
+ unusedMusclePerformance: z.int().min(0).max(3).nullish()
33
+ });
34
+ //# sourceMappingURL=Fatigue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Fatigue.js","sourceRoot":"","sources":["../../../src/embedded-types/workout/Fatigue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC;;;;;;;OAOG;IACH,wBAAwB,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;IACzD;;;;;;;OAOG;IACH,eAAe,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;IAChD;;;;;;;OAOG;IACH,uBAAuB,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;CACzD,CAAC,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Zod schema for {@link Fatigue}.
5
+ */
6
+ export const FatigueSchema = z.object({
7
+ /**
8
+ * Joint and connective tissue disruption score (0-3).
9
+ *
10
+ * - 0: You had minimal to no pain or perturbation in your joints or connective tissues
11
+ * - 1: You had some pain or perturbation in your joints and connective tissues but recovered by the next day
12
+ * - 2: You had some persistent pain or tightness in your connective tissues that lasted through the following day or several days
13
+ * - 3: You develop chronic pain in the joints and connective tissues that persists across days to weeks or longer
14
+ */
15
+ jointAndTissueDisruption: z.int().min(0).max(3).nullish(),
16
+ /**
17
+ * Perceived effort score (0-3).
18
+ *
19
+ * - 0: Training felt very easy and hardly taxed you psychologically
20
+ * - 1: You put effort into the training, but felt recovered by the end of the day
21
+ * - 2: You put a large effort into the training and felt drained through the next day
22
+ * - 3: You put an all-out effort into the training and felt drained for days
23
+ */
24
+ perceivedEffort: z.int().min(0).max(3).nullish(),
25
+ /**
26
+ * Unused muscle performance score (0-3).
27
+ *
28
+ * - 0: Performance on subsequent exercises targeting unused muscles was better than expected
29
+ * - 1: Performance on subsequent exercises targeting unused muscles was as expected
30
+ * - 2: Performance on subsequent exercises targeting unused muscles was worse than expected
31
+ * - 3: Your performance on subsequent exercises targeting unused muscles was hugely deteriorated
32
+ */
33
+ unusedMusclePerformance: z.int().min(0).max(3).nullish()
34
+ });
35
+
36
+ /**
37
+ * Fatigue measurement for a workout session or exercise.
38
+ *
39
+ * The Stimulus to Fatigue Ratio (SFR) can be calculated as RSM / total fatigue score.
40
+ */
41
+ export type Fatigue = z.infer<typeof FatigueSchema>;
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Zod schema for {@link RSM}.
4
+ */
5
+ export declare const RsmSchema: z.ZodObject<{
6
+ mindMuscleConnection: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
7
+ pump: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
8
+ disruption: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
9
+ }, z.core.$strip>;
10
+ /**
11
+ * Raw Stimulus Magnitude (RSM) - the amount of muscle growth stimulus any given
12
+ * workout session or exercise gives.
13
+ *
14
+ * The total RSM score is the sum of mindMuscleConnection, pump, and disruption (0-9).
15
+ */
16
+ export type RSM = z.infer<typeof RsmSchema>;
17
+ //# sourceMappingURL=Rsm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Rsm.d.ts","sourceRoot":"","sources":["../../../src/embedded-types/workout/Rsm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,SAAS;;;;iBA4BpB,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Zod schema for {@link RSM}.
4
+ */
5
+ export const RsmSchema = z.object({
6
+ /**
7
+ * Mind muscle connection score (0-3).
8
+ *
9
+ * - 0: You felt barely aware of your target muscles during the exercise
10
+ * - 1: You felt like your target muscles worked, but mildly
11
+ * - 2: You felt a good amount of tension and/or burn in the target muscles
12
+ * - 3: You felt tension and burn close to the limit in your target muscles
13
+ */
14
+ mindMuscleConnection: z.int().min(0).max(3).nullish(),
15
+ /**
16
+ * Pump score (0-3).
17
+ *
18
+ * - 0: You got no pump at all in the target muscles
19
+ * - 1: You got a very mild pump in the target muscles
20
+ * - 2: You got a decent pump in the target muscles
21
+ * - 3: You got close to maximal pump in the target muscles
22
+ */
23
+ pump: z.int().min(0).max(3).nullish(),
24
+ /**
25
+ * Muscle disruption score (0-3).
26
+ *
27
+ * - 0: You had no fatigue, perturbation, or soreness in the target muscles
28
+ * - 1: You had some weakness and stiffness after the session in the target muscles, but recovered by the next day
29
+ * - 2: You had weakness and stiffness after the session and experienced soreness the following day
30
+ * - 3: You got much weaker and felt perturbation in the target muscles right after the session and also had soreness for a few days or more
31
+ */
32
+ disruption: z.int().min(0).max(3).nullish()
33
+ });
34
+ //# sourceMappingURL=Rsm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Rsm.js","sourceRoot":"","sources":["../../../src/embedded-types/workout/Rsm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC;;;;;;;OAOG;IACH,oBAAoB,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;IACrD;;;;;;;OAOG;IACH,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;IACrC;;;;;;;OAOG;IACH,UAAU,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;CAC5C,CAAC,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Zod schema for {@link RSM}.
5
+ */
6
+ export const RsmSchema = z.object({
7
+ /**
8
+ * Mind muscle connection score (0-3).
9
+ *
10
+ * - 0: You felt barely aware of your target muscles during the exercise
11
+ * - 1: You felt like your target muscles worked, but mildly
12
+ * - 2: You felt a good amount of tension and/or burn in the target muscles
13
+ * - 3: You felt tension and burn close to the limit in your target muscles
14
+ */
15
+ mindMuscleConnection: z.int().min(0).max(3).nullish(),
16
+ /**
17
+ * Pump score (0-3).
18
+ *
19
+ * - 0: You got no pump at all in the target muscles
20
+ * - 1: You got a very mild pump in the target muscles
21
+ * - 2: You got a decent pump in the target muscles
22
+ * - 3: You got close to maximal pump in the target muscles
23
+ */
24
+ pump: z.int().min(0).max(3).nullish(),
25
+ /**
26
+ * Muscle disruption score (0-3).
27
+ *
28
+ * - 0: You had no fatigue, perturbation, or soreness in the target muscles
29
+ * - 1: You had some weakness and stiffness after the session in the target muscles, but recovered by the next day
30
+ * - 2: You had weakness and stiffness after the session and experienced soreness the following day
31
+ * - 3: You got much weaker and felt perturbation in the target muscles right after the session and also had soreness for a few days or more
32
+ */
33
+ disruption: z.int().min(0).max(3).nullish()
34
+ });
35
+
36
+ /**
37
+ * Raw Stimulus Magnitude (RSM) - the amount of muscle growth stimulus any given
38
+ * workout session or exercise gives.
39
+ *
40
+ * The total RSM score is the sum of mindMuscleConnection, pump, and disruption (0-9).
41
+ */
42
+ export type RSM = z.infer<typeof RsmSchema>;
@@ -8,6 +8,25 @@ import type { BaseDocument } from '../documents/BaseDocument.js';
8
8
  export type DocumentMap<T extends BaseDocument> = {
9
9
  [docId: UUID]: T | undefined;
10
10
  };
11
+ /**
12
+ * Represents database operations for a document type.
13
+ *
14
+ * @template T - The type of document, must extend BaseDocument.
15
+ */
16
+ export type DocumentOperations<T extends BaseDocument> = {
17
+ /**
18
+ * Documents to create.
19
+ */
20
+ create?: T[];
21
+ /**
22
+ * Documents to update. Must include _id field.
23
+ */
24
+ update?: Partial<T>[];
25
+ /**
26
+ * Document IDs to delete.
27
+ */
28
+ delete?: UUID[];
29
+ };
11
30
  /**
12
31
  * A service for low-level utilities related to documents.
13
32
  */
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentService.d.ts","sourceRoot":"","sources":["../../src/services/DocumentService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE;;;;GAIG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,YAAY,IAAI;IAChD,CAAC,KAAK,EAAE,IAAI,GAAG,CAAC,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC;IAI5C,MAAM,CAAC,UAAU,IAAI,IAAI;CAG1B"}
1
+ {"version":3,"file":"DocumentService.d.ts","sourceRoot":"","sources":["../../src/services/DocumentService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE;;;;GAIG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,YAAY,IAAI;IAChD,CAAC,KAAK,EAAE,IAAI,GAAG,CAAC,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,YAAY,IAAI;IACvD;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC;IAI5C,MAAM,CAAC,UAAU,IAAI,IAAI;CAG1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentService.js","sourceRoot":"","sources":["../../src/services/DocumentService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAYpC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAmB,GAAM;QACtC,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,UAAU;QACf,OAAO,MAAM,EAAU,CAAC;IAC1B,CAAC;CACF"}
1
+ {"version":3,"file":"DocumentService.js","sourceRoot":"","sources":["../../src/services/DocumentService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAgCpC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAmB,GAAM;QACtC,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,UAAU;QACf,OAAO,MAAM,EAAU,CAAC;IAC1B,CAAC;CACF"}
@@ -11,6 +11,26 @@ export type DocumentMap<T extends BaseDocument> = {
11
11
  [docId: UUID]: T | undefined;
12
12
  };
13
13
 
14
+ /**
15
+ * Represents database operations for a document type.
16
+ *
17
+ * @template T - The type of document, must extend BaseDocument.
18
+ */
19
+ export type DocumentOperations<T extends BaseDocument> = {
20
+ /**
21
+ * Documents to create.
22
+ */
23
+ create?: T[];
24
+ /**
25
+ * Documents to update. Must include _id field.
26
+ */
27
+ update?: Partial<T>[];
28
+ /**
29
+ * Document IDs to delete.
30
+ */
31
+ delete?: UUID[];
32
+ };
33
+
14
34
  /**
15
35
  * A service for low-level utilities related to documents.
16
36
  */