@trainheroic-unofficial/dto 1.3.0 → 1.5.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.
package/dist/index.d.mts CHANGED
@@ -228,10 +228,27 @@ declare const loggedSetSchema: z.ZodObject<{
228
228
  param1: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
229
229
  param2: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
230
230
  }, z.core.$strip>;
231
+ /**
232
+ * A logged set that can name the prescribed position it fills. `slot` is the 1-based set
233
+ * index in the prescription (10 max) the result should land in; omit it to fill the next
234
+ * sequential position (the first entry is set 1, the second set 2, and so on). Targeting a
235
+ * slot lets a partial log land in the right positions of a multi-set prescription — e.g.
236
+ * three top singles into the 4th/5th/6th positions of an `8,5,3,1,1,1` ramp. Used by the
237
+ * by-set logging write (not the by-exercise session log, where each exercise's sets are
238
+ * always sequential).
239
+ */
240
+ declare const loggedSetWithSlotSchema: z.ZodObject<{
241
+ param1: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
242
+ param2: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
243
+ slot: z.ZodOptional<z.ZodNumber>;
244
+ }, z.core.$strip>;
231
245
  /**
232
246
  * Args for the set-logging write. `date` (the workout's day) locates the saved
233
247
  * workout via the range endpoint; `savedWorkoutSetId` picks the set to complete; `results`
234
- * gives, per exercise in it, the entered value of each set (param 1 / param 2 by entry slot).
248
+ * gives, per exercise in it, the entered value of each set. Each set fills the next position by
249
+ * default, or names its `slot` (1-based) to place a partial log at specific positions. A partial
250
+ * log keeps positions already logged in an earlier call and leaves the positions it does not
251
+ * write empty.
235
252
  */
236
253
  declare const logSetArgsSchema: z.ZodObject<{
237
254
  date: z.ZodString;
@@ -241,6 +258,7 @@ declare const logSetArgsSchema: z.ZodObject<{
241
258
  sets: z.ZodArray<z.ZodObject<{
242
259
  param1: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
243
260
  param2: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
261
+ slot: z.ZodOptional<z.ZodNumber>;
244
262
  }, z.core.$strip>>;
245
263
  }, z.core.$strip>>;
246
264
  }, z.core.$strip>;
@@ -257,22 +275,25 @@ declare const coachLogSetArgsSchema: z.ZodObject<{
257
275
  sets: z.ZodArray<z.ZodObject<{
258
276
  param1: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
259
277
  param2: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
278
+ slot: z.ZodOptional<z.ZodNumber>;
260
279
  }, z.core.$strip>>;
261
280
  }, z.core.$strip>>;
262
281
  athleteId: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
263
282
  }, z.core.$strip>;
264
283
  type CoachLogSetArgs = z.infer<typeof coachLogSetArgsSchema>;
265
284
  /**
266
- * Args for the coach prescription-override write. Structurally the same as
267
- * {@link coachLogSetArgsSchema} (athleteId + date + savedWorkoutSetId + per-exercise `sets`), but
268
- * the values are prescribed targets (param1 = reps, param2 = weight) written to the athlete's
269
- * plan without marking the set performed. It is a separate schema (not an alias) so a future
270
- * prescribe-only constraint can be added here without changing the log args, and the write
271
- * replaces the slot's prescribed values for this athlete only.
285
+ * Args for the coach prescription-override write. Like {@link coachLogSetArgsSchema}
286
+ * (athleteId + date + savedWorkoutSetId + per-exercise `sets`), but the values are prescribed
287
+ * targets (param1 = reps, param2 = weight) written to the athlete's plan without marking the set
288
+ * performed. The write replaces this athlete's whole prescription for the set, so its sets are
289
+ * positional and sequential by definition: it deliberately omits the log path's `slot` field (a
290
+ * sparse, slot-targeted prescription has no meaning here) by building its results off
291
+ * {@link loggedSetSchema} rather than {@link loggedSetWithSlotSchema}.
272
292
  */
273
293
  declare const coachPrescribeSetArgsSchema: z.ZodObject<{
274
294
  date: z.ZodString;
275
295
  savedWorkoutSetId: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
296
+ athleteId: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
276
297
  results: z.ZodArray<z.ZodObject<{
277
298
  savedWorkoutSetExerciseId: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
278
299
  sets: z.ZodArray<z.ZodObject<{
@@ -280,7 +301,6 @@ declare const coachPrescribeSetArgsSchema: z.ZodObject<{
280
301
  param2: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
281
302
  }, z.core.$strip>>;
282
303
  }, z.core.$strip>>;
283
- athleteId: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
284
304
  }, z.core.$strip>;
285
305
  type CoachPrescribeSetArgs = z.infer<typeof coachPrescribeSetArgsSchema>;
286
306
  /**
@@ -686,4 +706,4 @@ type ReadResult = {
686
706
  blocks: ReadBlock[];
687
707
  };
688
708
  //#endregion
689
- export { Advisory, AthletePrefs, AthleteProfileSummary, AthleteUser, AthleteWorkingMax, AthleteWorkoutBlock, AthleteWorkoutExercise, AthleteWorkoutRangeArgs, AthleteWorkoutSummary, AthleteWorkoutView, BlockSpec, CoachAthleteExercise, CoachAthleteSession, CoachAthleteTraining, CoachLogSessionArgs, CoachLogSetArgs, CoachPrescribeSetArgs, CommentDraft, ExerciseCreate, ExerciseHistoryDetail, ExerciseHistoryListItem, ExerciseRow, ExerciseSpec, ExerciseStats, ExerciseView, Id, LeaderboardSpec, LogSessionArgs, LogSetArgs, PersonalRecord, PresentedExerciseHistory, PresentedExerciseSession, ProgramWorkout, ReadBlock, ReadExercise, ReadResult, ResolveResult, RosterActivityRow, SwapAthleteExerciseArgs, TeamVolumeAthlete, TeamVolumeReport, UserSimple, WorkoutDate, WorkoutSpec, athletePrefsSchema, athleteProfileSummarySchema, athleteUserSchema, athleteWorkingMaxListSchema, athleteWorkingMaxSchema, athleteWorkoutRangeArgsSchema, blockSpecSchema, coachLogSessionArgsSchema, coachLogSetArgsSchema, coachPrescribeSetArgsSchema, commentDraftSchema, dateString, exerciseCreateSchema, exerciseHistoryDetailSchema, exerciseHistoryListItemSchema, exerciseHistoryListSchema, exerciseLibraryResponseSchema, exerciseResponseSchema, exerciseSpecSchema, exerciseStatsSchema, historyEntrySchema, historySetSchema, idArgSchema, idSchema, leaderboardSpecSchema, liftPRSchema, logSessionArgsSchema, logSetArgsSchema, loggedSetSchema, parseWorkoutDate, personalRecordListSchema, personalRecordSchema, programWorkoutListSchema, programWorkoutResponseSchema, programWorkoutSchema, programsEditResponseSchema, repMaxSchema, sessionCreateResponseSchema, swapAthleteExerciseArgsSchema, userSimpleSchema, workoutSpecSchema };
709
+ export { Advisory, AthletePrefs, AthleteProfileSummary, AthleteUser, AthleteWorkingMax, AthleteWorkoutBlock, AthleteWorkoutExercise, AthleteWorkoutRangeArgs, AthleteWorkoutSummary, AthleteWorkoutView, BlockSpec, CoachAthleteExercise, CoachAthleteSession, CoachAthleteTraining, CoachLogSessionArgs, CoachLogSetArgs, CoachPrescribeSetArgs, CommentDraft, ExerciseCreate, ExerciseHistoryDetail, ExerciseHistoryListItem, ExerciseRow, ExerciseSpec, ExerciseStats, ExerciseView, Id, LeaderboardSpec, LogSessionArgs, LogSetArgs, PersonalRecord, PresentedExerciseHistory, PresentedExerciseSession, ProgramWorkout, ReadBlock, ReadExercise, ReadResult, ResolveResult, RosterActivityRow, SwapAthleteExerciseArgs, TeamVolumeAthlete, TeamVolumeReport, UserSimple, WorkoutDate, WorkoutSpec, athletePrefsSchema, athleteProfileSummarySchema, athleteUserSchema, athleteWorkingMaxListSchema, athleteWorkingMaxSchema, athleteWorkoutRangeArgsSchema, blockSpecSchema, coachLogSessionArgsSchema, coachLogSetArgsSchema, coachPrescribeSetArgsSchema, commentDraftSchema, dateString, exerciseCreateSchema, exerciseHistoryDetailSchema, exerciseHistoryListItemSchema, exerciseHistoryListSchema, exerciseLibraryResponseSchema, exerciseResponseSchema, exerciseSpecSchema, exerciseStatsSchema, historyEntrySchema, historySetSchema, idArgSchema, idSchema, leaderboardSpecSchema, liftPRSchema, logSessionArgsSchema, logSetArgsSchema, loggedSetSchema, loggedSetWithSlotSchema, parseWorkoutDate, personalRecordListSchema, personalRecordSchema, programWorkoutListSchema, programWorkoutResponseSchema, programWorkoutSchema, programsEditResponseSchema, repMaxSchema, sessionCreateResponseSchema, swapAthleteExerciseArgsSchema, userSimpleSchema, workoutSpecSchema };
package/dist/index.mjs CHANGED
@@ -164,16 +164,29 @@ const loggedSetSchema = z.object({
164
164
  param2: z.union([z.number(), z.string()]).optional()
165
165
  });
166
166
  /**
167
+ * A logged set that can name the prescribed position it fills. `slot` is the 1-based set
168
+ * index in the prescription (10 max) the result should land in; omit it to fill the next
169
+ * sequential position (the first entry is set 1, the second set 2, and so on). Targeting a
170
+ * slot lets a partial log land in the right positions of a multi-set prescription — e.g.
171
+ * three top singles into the 4th/5th/6th positions of an `8,5,3,1,1,1` ramp. Used by the
172
+ * by-set logging write (not the by-exercise session log, where each exercise's sets are
173
+ * always sequential).
174
+ */
175
+ const loggedSetWithSlotSchema = loggedSetSchema.extend({ slot: z.number().int().min(1).max(10).optional() });
176
+ /**
167
177
  * Args for the set-logging write. `date` (the workout's day) locates the saved
168
178
  * workout via the range endpoint; `savedWorkoutSetId` picks the set to complete; `results`
169
- * gives, per exercise in it, the entered value of each set (param 1 / param 2 by entry slot).
179
+ * gives, per exercise in it, the entered value of each set. Each set fills the next position by
180
+ * default, or names its `slot` (1-based) to place a partial log at specific positions. A partial
181
+ * log keeps positions already logged in an earlier call and leaves the positions it does not
182
+ * write empty.
170
183
  */
171
184
  const logSetArgsSchema = z.object({
172
185
  date: dateString,
173
186
  savedWorkoutSetId: idArgSchema,
174
187
  results: z.array(z.object({
175
188
  savedWorkoutSetExerciseId: idArgSchema,
176
- sets: z.array(loggedSetSchema).min(1)
189
+ sets: z.array(loggedSetWithSlotSchema).min(1)
177
190
  })).min(1)
178
191
  });
179
192
  /**
@@ -182,14 +195,23 @@ const logSetArgsSchema = z.object({
182
195
  */
183
196
  const coachLogSetArgsSchema = logSetArgsSchema.extend({ athleteId: idArgSchema });
184
197
  /**
185
- * Args for the coach prescription-override write. Structurally the same as
186
- * {@link coachLogSetArgsSchema} (athleteId + date + savedWorkoutSetId + per-exercise `sets`), but
187
- * the values are prescribed targets (param1 = reps, param2 = weight) written to the athlete's
188
- * plan without marking the set performed. It is a separate schema (not an alias) so a future
189
- * prescribe-only constraint can be added here without changing the log args, and the write
190
- * replaces the slot's prescribed values for this athlete only.
198
+ * Args for the coach prescription-override write. Like {@link coachLogSetArgsSchema}
199
+ * (athleteId + date + savedWorkoutSetId + per-exercise `sets`), but the values are prescribed
200
+ * targets (param1 = reps, param2 = weight) written to the athlete's plan without marking the set
201
+ * performed. The write replaces this athlete's whole prescription for the set, so its sets are
202
+ * positional and sequential by definition: it deliberately omits the log path's `slot` field (a
203
+ * sparse, slot-targeted prescription has no meaning here) by building its results off
204
+ * {@link loggedSetSchema} rather than {@link loggedSetWithSlotSchema}.
191
205
  */
192
- const coachPrescribeSetArgsSchema = logSetArgsSchema.extend({ athleteId: idArgSchema });
206
+ const coachPrescribeSetArgsSchema = z.object({
207
+ date: dateString,
208
+ savedWorkoutSetId: idArgSchema,
209
+ athleteId: idArgSchema,
210
+ results: z.array(z.object({
211
+ savedWorkoutSetExerciseId: idArgSchema,
212
+ sets: z.array(loggedSetSchema).min(1)
213
+ })).min(1)
214
+ });
193
215
  /**
194
216
  * Args for the coach per-athlete exercise swap: replace the exercise prescribed in one of a
195
217
  * roster athlete's saved-workout slots with a different exercise, the API equivalent of the
@@ -322,4 +344,4 @@ function parseWorkoutDate(s) {
322
344
  ];
323
345
  }
324
346
  //#endregion
325
- export { athletePrefsSchema, athleteProfileSummarySchema, athleteUserSchema, athleteWorkingMaxListSchema, athleteWorkingMaxSchema, athleteWorkoutRangeArgsSchema, blockSpecSchema, coachLogSessionArgsSchema, coachLogSetArgsSchema, coachPrescribeSetArgsSchema, commentDraftSchema, dateString, exerciseCreateSchema, exerciseHistoryDetailSchema, exerciseHistoryListItemSchema, exerciseHistoryListSchema, exerciseLibraryResponseSchema, exerciseResponseSchema, exerciseSpecSchema, exerciseStatsSchema, historyEntrySchema, historySetSchema, idArgSchema, idSchema, leaderboardSpecSchema, liftPRSchema, logSessionArgsSchema, logSetArgsSchema, loggedSetSchema, parseWorkoutDate, personalRecordListSchema, personalRecordSchema, programWorkoutListSchema, programWorkoutResponseSchema, programWorkoutSchema, programsEditResponseSchema, repMaxSchema, sessionCreateResponseSchema, swapAthleteExerciseArgsSchema, userSimpleSchema, workoutSpecSchema };
347
+ export { athletePrefsSchema, athleteProfileSummarySchema, athleteUserSchema, athleteWorkingMaxListSchema, athleteWorkingMaxSchema, athleteWorkoutRangeArgsSchema, blockSpecSchema, coachLogSessionArgsSchema, coachLogSetArgsSchema, coachPrescribeSetArgsSchema, commentDraftSchema, dateString, exerciseCreateSchema, exerciseHistoryDetailSchema, exerciseHistoryListItemSchema, exerciseHistoryListSchema, exerciseLibraryResponseSchema, exerciseResponseSchema, exerciseSpecSchema, exerciseStatsSchema, historyEntrySchema, historySetSchema, idArgSchema, idSchema, leaderboardSpecSchema, liftPRSchema, logSessionArgsSchema, logSetArgsSchema, loggedSetSchema, loggedSetWithSlotSchema, parseWorkoutDate, personalRecordListSchema, personalRecordSchema, programWorkoutListSchema, programWorkoutResponseSchema, programWorkoutSchema, programsEditResponseSchema, repMaxSchema, sessionCreateResponseSchema, swapAthleteExerciseArgsSchema, userSimpleSchema, workoutSpecSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trainheroic-unofficial/dto",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",