@trainheroic-unofficial/dto 3.0.1 → 3.1.1

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
@@ -281,18 +281,27 @@ declare const coachLogSetArgsSchema: z.ZodObject<{
281
281
  }, z.core.$strip>;
282
282
  type CoachLogSetArgs = z.infer<typeof coachLogSetArgsSchema>;
283
283
  /**
284
- * Args for the coach prescription-override write. Like {@link coachLogSetArgsSchema}
285
- * (athleteId + date + savedWorkoutSetId + per-exercise `sets`), but the values are prescribed
286
- * targets (param1 = reps, param2 = weight) written to the athlete's plan without marking the set
287
- * performed. The write replaces this athlete's whole prescription for the set, so its sets are
288
- * positional and sequential by definition: it deliberately omits the log path's `slot` field (a
289
- * sparse, slot-targeted prescription has no meaning here) by building its results off
290
- * {@link loggedSetSchema} rather than {@link loggedSetWithSlotSchema}.
284
+ * Args for changing the logged-in athlete's prescribed targets without marking the set performed.
285
+ * The write replaces the exercise's whole prescription, so its sets are positional and sequential
286
+ * by definition: it deliberately omits the log path's `slot` field because a sparse prescription
287
+ * has no meaning here.
291
288
  */
289
+ declare const athletePrescribeSetArgsSchema: z.ZodObject<{
290
+ date: z.ZodString;
291
+ savedWorkoutSetId: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
292
+ results: z.ZodArray<z.ZodObject<{
293
+ savedWorkoutSetExerciseId: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
294
+ sets: z.ZodArray<z.ZodObject<{
295
+ param1: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
296
+ param2: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
297
+ }, z.core.$strip>>;
298
+ }, z.core.$strip>>;
299
+ }, z.core.$strip>;
300
+ type AthletePrescribeSetArgs = z.infer<typeof athletePrescribeSetArgsSchema>;
301
+ /** Coach variant of {@link athletePrescribeSetArgsSchema}, with the roster athlete to update. */
292
302
  declare const coachPrescribeSetArgsSchema: z.ZodObject<{
293
303
  date: z.ZodString;
294
304
  savedWorkoutSetId: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
295
- athleteId: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
296
305
  results: z.ZodArray<z.ZodObject<{
297
306
  savedWorkoutSetExerciseId: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
298
307
  sets: z.ZodArray<z.ZodObject<{
@@ -300,6 +309,7 @@ declare const coachPrescribeSetArgsSchema: z.ZodObject<{
300
309
  param2: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
301
310
  }, z.core.$strip>>;
302
311
  }, z.core.$strip>>;
312
+ athleteId: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
303
313
  }, z.core.$strip>;
304
314
  type CoachPrescribeSetArgs = z.infer<typeof coachPrescribeSetArgsSchema>;
305
315
  /**
@@ -678,6 +688,18 @@ declare const programsEditResponseSchema: z.ZodObject<{
678
688
  sets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
679
689
  }, z.core.$loose>>>;
680
690
  }, z.core.$loose>;
691
+ /** A standalone program create response (container id + usable calendar/program id). */
692
+ declare const programCreateResponseSchema: z.ZodObject<{
693
+ id: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
694
+ title: z.ZodString;
695
+ programId: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
696
+ group_program: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
697
+ type: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
698
+ program: z.ZodOptional<z.ZodObject<{
699
+ id: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
700
+ program_type: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
701
+ }, z.core.$loose>>;
702
+ }, z.core.$loose>;
681
703
  //#endregion
682
704
  //#region src/workout.d.ts
683
705
  /** A single exercise prescription inside a block. */
@@ -797,4 +819,4 @@ type ReadResult = {
797
819
  blocks: ReadBlock[];
798
820
  };
799
821
  //#endregion
800
- export { Advisory, AthletePrefs, AthleteProfileSummary, AthleteSessionRemoveArgs, AthleteUser, AthleteWorkingMax, AthleteWorkoutBlock, AthleteWorkoutExercise, AthleteWorkoutRangeArgs, AthleteWorkoutSummary, AthleteWorkoutView, BlockSpec, CoachAthleteExercise, CoachAthleteSession, CoachAthleteTraining, CoachLogSessionArgs, CoachLogSetArgs, CoachPrescribeSetArgs, CommentDraft, ExerciseCreate, ExerciseHistoryDetail, ExerciseHistoryListItem, ExerciseRow, ExerciseSpec, ExerciseStats, ExerciseView, ExportBlock, ExportExercise, ExportSet, ExportSetParam, ExportSetSide, Id, LeaderboardSpec, LogSessionArgs, LogSetArgs, PersonalRecord, PresentedExerciseHistory, PresentedExerciseSession, ProgramWorkout, ReadBlock, ReadExercise, ReadResult, ResolveResult, RosterActivityRow, SwapAthleteExerciseArgs, TeamVolumeAthlete, TeamVolumeReport, UserSimple, WorkoutDate, WorkoutHistoryExport, WorkoutSpec, athletePrefsSchema, athleteProfileSummarySchema, athleteSessionRemoveArgsSchema, 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 };
822
+ export { Advisory, AthletePrefs, AthletePrescribeSetArgs, AthleteProfileSummary, AthleteSessionRemoveArgs, AthleteUser, AthleteWorkingMax, AthleteWorkoutBlock, AthleteWorkoutExercise, AthleteWorkoutRangeArgs, AthleteWorkoutSummary, AthleteWorkoutView, BlockSpec, CoachAthleteExercise, CoachAthleteSession, CoachAthleteTraining, CoachLogSessionArgs, CoachLogSetArgs, CoachPrescribeSetArgs, CommentDraft, ExerciseCreate, ExerciseHistoryDetail, ExerciseHistoryListItem, ExerciseRow, ExerciseSpec, ExerciseStats, ExerciseView, ExportBlock, ExportExercise, ExportSet, ExportSetParam, ExportSetSide, Id, LeaderboardSpec, LogSessionArgs, LogSetArgs, PersonalRecord, PresentedExerciseHistory, PresentedExerciseSession, ProgramWorkout, ReadBlock, ReadExercise, ReadResult, ResolveResult, RosterActivityRow, SwapAthleteExerciseArgs, TeamVolumeAthlete, TeamVolumeReport, UserSimple, WorkoutDate, WorkoutHistoryExport, WorkoutSpec, athletePrefsSchema, athletePrescribeSetArgsSchema, athleteProfileSummarySchema, athleteSessionRemoveArgsSchema, 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, programCreateResponseSchema, programWorkoutListSchema, programWorkoutResponseSchema, programWorkoutSchema, programsEditResponseSchema, repMaxSchema, sessionCreateResponseSchema, swapAthleteExerciseArgsSchema, userSimpleSchema, workoutSpecSchema };
package/dist/index.mjs CHANGED
@@ -212,20 +212,18 @@ const logSetArgsSchema = z.object({
212
212
  */
213
213
  const coachLogSetArgsSchema = logSetArgsSchema.extend({ athleteId: idArgSchema });
214
214
  /**
215
- * Args for the coach prescription-override write. Like {@link coachLogSetArgsSchema}
216
- * (athleteId + date + savedWorkoutSetId + per-exercise `sets`), but the values are prescribed
217
- * targets (param1 = reps, param2 = weight) written to the athlete's plan without marking the set
218
- * performed. The write replaces this athlete's whole prescription for the set, so its sets are
219
- * positional and sequential by definition: it deliberately omits the log path's `slot` field (a
220
- * sparse, slot-targeted prescription has no meaning here) by building its results off
221
- * {@link loggedSetSchema} rather than {@link loggedSetWithSlotSchema}.
215
+ * Args for changing the logged-in athlete's prescribed targets without marking the set performed.
216
+ * The write replaces the exercise's whole prescription, so its sets are positional and sequential
217
+ * by definition: it deliberately omits the log path's `slot` field because a sparse prescription
218
+ * has no meaning here.
222
219
  */
223
- const coachPrescribeSetArgsSchema = z.object({
220
+ const athletePrescribeSetArgsSchema = z.object({
224
221
  date: dateString,
225
222
  savedWorkoutSetId: idArgSchema,
226
- athleteId: idArgSchema,
227
223
  results: prescribedExerciseResultsSchema
228
224
  });
225
+ /** Coach variant of {@link athletePrescribeSetArgsSchema}, with the roster athlete to update. */
226
+ const coachPrescribeSetArgsSchema = athletePrescribeSetArgsSchema.extend({ athleteId: idArgSchema });
229
227
  /**
230
228
  * Args for the coach per-athlete exercise swap: replace the exercise prescribed in one of a
231
229
  * roster athlete's saved-workout slots with a different exercise, the API equivalent of the
@@ -311,6 +309,18 @@ const programWorkoutResponseSchema = z.looseObject({
311
309
  });
312
310
  /** The calendar edit-view response we read sessions back from. */
313
311
  const programsEditResponseSchema = z.looseObject({ programWorkouts: z.array(programWorkoutResponseSchema).optional() });
312
+ /** A standalone program create response (container id + usable calendar/program id). */
313
+ const programCreateResponseSchema = z.looseObject({
314
+ id: intLike,
315
+ title: z.string(),
316
+ programId: intLike,
317
+ group_program: intLike,
318
+ type: intLike,
319
+ program: z.looseObject({
320
+ id: intLike,
321
+ program_type: intLike
322
+ }).optional()
323
+ });
314
324
  //#endregion
315
325
  //#region src/workout.ts
316
326
  /** A single exercise prescription inside a block. */
@@ -379,4 +389,4 @@ function parseWorkoutDate(s) {
379
389
  ];
380
390
  }
381
391
  //#endregion
382
- export { athletePrefsSchema, athleteProfileSummarySchema, athleteSessionRemoveArgsSchema, 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 };
392
+ export { athletePrefsSchema, athletePrescribeSetArgsSchema, athleteProfileSummarySchema, athleteSessionRemoveArgsSchema, 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, programCreateResponseSchema, 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": "3.0.1",
3
+ "version": "3.1.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",