@sunsteel/contracts 0.8.1 → 0.10.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.cts CHANGED
@@ -62,6 +62,31 @@ interface UpdateProfileRequest {
62
62
  height?: number | null;
63
63
  weightUnit?: WeightUnit;
64
64
  }
65
+ interface PlatePairInventory {
66
+ weightKg: number;
67
+ pairCount: number;
68
+ }
69
+ interface TrainingLocationPreference {
70
+ id: string;
71
+ name: string;
72
+ isDefault: boolean;
73
+ barWeightKg: number;
74
+ availablePlatePairs: PlatePairInventory[];
75
+ equipment: string[];
76
+ createdAt: IsoDateString;
77
+ updatedAt: IsoDateString;
78
+ }
79
+ interface TrainingLocationPreferenceInput {
80
+ id?: string;
81
+ name: string;
82
+ isDefault: boolean;
83
+ barWeightKg: number;
84
+ availablePlatePairs: PlatePairInventory[];
85
+ equipment: string[];
86
+ }
87
+ interface ReplaceTrainingLocationsRequest {
88
+ locations: TrainingLocationPreferenceInput[];
89
+ }
65
90
  interface UserSearchResponse {
66
91
  id: string;
67
92
  email: string;
@@ -270,6 +295,22 @@ interface UpsertSetLogRequest {
270
295
  rpe?: number;
271
296
  isCompleted?: boolean;
272
297
  }
298
+ type PersonalRecordKind = 'WEIGHT' | 'REPS' | 'VOLUME' | 'ESTIMATED_1RM';
299
+ /** A record frontier crossed by the set mutation that produced this response. */
300
+ interface EarnedPersonalRecord {
301
+ kind: PersonalRecordKind;
302
+ exerciseId: string;
303
+ exerciseName: string;
304
+ /** Canonical kg for every kind except REPS, where this is a repetition count. */
305
+ value: number;
306
+ /** Missing when this is the first completed result for that record kind. */
307
+ previousBest?: number | null;
308
+ }
309
+ /** Stable successful response of PUT /workouts/sessions/:id/set-logs. */
310
+ interface UpsertSetLogResponse {
311
+ setLog: SetLog;
312
+ earnedRecords: EarnedPersonalRecord[];
313
+ }
273
314
  interface WorkoutSessionSummary {
274
315
  id: string;
275
316
  status: WorkoutSessionStatus;
@@ -363,4 +404,4 @@ interface WorkoutAnalyticsStatus {
363
404
  generationId: string | null;
364
405
  }
365
406
 
366
- export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type Exercise, type ExerciseId, type FinishStatus, type FinishWorkoutRequest, type IsoDateString, type ListSessionsParams, MUSCLE_GROUPS, type MuscleGroup, PROGRESSION_SCHEMES, type PaginatedResponse, type PersonalRecordEntry, type PreviousPerformanceResponse, type PreviousSetPerformance, type ProgressionScheme, type PublicUserProfile, REP_TYPES, type RecentActivityEntry, type RepType, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineSet, SEXES, type SetAccountTimeZoneRequest, type SetLog, type Sex, type StartWorkoutRequest, type StartWorkoutResponse, type SupabaseAuthResponse, type SupabaseAuthUser, type SupabaseMigrationResponse, type UpdateProfileRequest, type UpdateRoutineRequest, type UpsertSetLogRequest, type UserId, type UserProfile, type UserSearchResponse, WEIGHT_UNITS, WORKOUT_SESSION_STATUSES, type WeightUnit, type WorkoutAnalyticsStatus, type WorkoutProgressQuery, type WorkoutProgressResponse, type WorkoutSession, type WorkoutSessionId, type WorkoutSessionListResponse, type WorkoutSessionSnapshotV1, type WorkoutSessionStatus, type WorkoutSessionSummary, type WorkoutStatsQuery, type WorkoutStatsResponse };
407
+ export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type EarnedPersonalRecord, type Exercise, type ExerciseId, type FinishStatus, type FinishWorkoutRequest, type IsoDateString, type ListSessionsParams, MUSCLE_GROUPS, type MuscleGroup, PROGRESSION_SCHEMES, type PaginatedResponse, type PersonalRecordEntry, type PersonalRecordKind, type PlatePairInventory, type PreviousPerformanceResponse, type PreviousSetPerformance, type ProgressionScheme, type PublicUserProfile, REP_TYPES, type RecentActivityEntry, type RepType, type ReplaceTrainingLocationsRequest, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineSet, SEXES, type SetAccountTimeZoneRequest, type SetLog, type Sex, type StartWorkoutRequest, type StartWorkoutResponse, type SupabaseAuthResponse, type SupabaseAuthUser, type SupabaseMigrationResponse, type TrainingLocationPreference, type TrainingLocationPreferenceInput, type UpdateProfileRequest, type UpdateRoutineRequest, type UpsertSetLogRequest, type UpsertSetLogResponse, type UserId, type UserProfile, type UserSearchResponse, WEIGHT_UNITS, WORKOUT_SESSION_STATUSES, type WeightUnit, type WorkoutAnalyticsStatus, type WorkoutProgressQuery, type WorkoutProgressResponse, type WorkoutSession, type WorkoutSessionId, type WorkoutSessionListResponse, type WorkoutSessionSnapshotV1, type WorkoutSessionStatus, type WorkoutSessionSummary, type WorkoutStatsQuery, type WorkoutStatsResponse };
package/dist/index.d.ts CHANGED
@@ -62,6 +62,31 @@ interface UpdateProfileRequest {
62
62
  height?: number | null;
63
63
  weightUnit?: WeightUnit;
64
64
  }
65
+ interface PlatePairInventory {
66
+ weightKg: number;
67
+ pairCount: number;
68
+ }
69
+ interface TrainingLocationPreference {
70
+ id: string;
71
+ name: string;
72
+ isDefault: boolean;
73
+ barWeightKg: number;
74
+ availablePlatePairs: PlatePairInventory[];
75
+ equipment: string[];
76
+ createdAt: IsoDateString;
77
+ updatedAt: IsoDateString;
78
+ }
79
+ interface TrainingLocationPreferenceInput {
80
+ id?: string;
81
+ name: string;
82
+ isDefault: boolean;
83
+ barWeightKg: number;
84
+ availablePlatePairs: PlatePairInventory[];
85
+ equipment: string[];
86
+ }
87
+ interface ReplaceTrainingLocationsRequest {
88
+ locations: TrainingLocationPreferenceInput[];
89
+ }
65
90
  interface UserSearchResponse {
66
91
  id: string;
67
92
  email: string;
@@ -270,6 +295,22 @@ interface UpsertSetLogRequest {
270
295
  rpe?: number;
271
296
  isCompleted?: boolean;
272
297
  }
298
+ type PersonalRecordKind = 'WEIGHT' | 'REPS' | 'VOLUME' | 'ESTIMATED_1RM';
299
+ /** A record frontier crossed by the set mutation that produced this response. */
300
+ interface EarnedPersonalRecord {
301
+ kind: PersonalRecordKind;
302
+ exerciseId: string;
303
+ exerciseName: string;
304
+ /** Canonical kg for every kind except REPS, where this is a repetition count. */
305
+ value: number;
306
+ /** Missing when this is the first completed result for that record kind. */
307
+ previousBest?: number | null;
308
+ }
309
+ /** Stable successful response of PUT /workouts/sessions/:id/set-logs. */
310
+ interface UpsertSetLogResponse {
311
+ setLog: SetLog;
312
+ earnedRecords: EarnedPersonalRecord[];
313
+ }
273
314
  interface WorkoutSessionSummary {
274
315
  id: string;
275
316
  status: WorkoutSessionStatus;
@@ -363,4 +404,4 @@ interface WorkoutAnalyticsStatus {
363
404
  generationId: string | null;
364
405
  }
365
406
 
366
- export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type Exercise, type ExerciseId, type FinishStatus, type FinishWorkoutRequest, type IsoDateString, type ListSessionsParams, MUSCLE_GROUPS, type MuscleGroup, PROGRESSION_SCHEMES, type PaginatedResponse, type PersonalRecordEntry, type PreviousPerformanceResponse, type PreviousSetPerformance, type ProgressionScheme, type PublicUserProfile, REP_TYPES, type RecentActivityEntry, type RepType, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineSet, SEXES, type SetAccountTimeZoneRequest, type SetLog, type Sex, type StartWorkoutRequest, type StartWorkoutResponse, type SupabaseAuthResponse, type SupabaseAuthUser, type SupabaseMigrationResponse, type UpdateProfileRequest, type UpdateRoutineRequest, type UpsertSetLogRequest, type UserId, type UserProfile, type UserSearchResponse, WEIGHT_UNITS, WORKOUT_SESSION_STATUSES, type WeightUnit, type WorkoutAnalyticsStatus, type WorkoutProgressQuery, type WorkoutProgressResponse, type WorkoutSession, type WorkoutSessionId, type WorkoutSessionListResponse, type WorkoutSessionSnapshotV1, type WorkoutSessionStatus, type WorkoutSessionSummary, type WorkoutStatsQuery, type WorkoutStatsResponse };
407
+ export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type EarnedPersonalRecord, type Exercise, type ExerciseId, type FinishStatus, type FinishWorkoutRequest, type IsoDateString, type ListSessionsParams, MUSCLE_GROUPS, type MuscleGroup, PROGRESSION_SCHEMES, type PaginatedResponse, type PersonalRecordEntry, type PersonalRecordKind, type PlatePairInventory, type PreviousPerformanceResponse, type PreviousSetPerformance, type ProgressionScheme, type PublicUserProfile, REP_TYPES, type RecentActivityEntry, type RepType, type ReplaceTrainingLocationsRequest, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineSet, SEXES, type SetAccountTimeZoneRequest, type SetLog, type Sex, type StartWorkoutRequest, type StartWorkoutResponse, type SupabaseAuthResponse, type SupabaseAuthUser, type SupabaseMigrationResponse, type TrainingLocationPreference, type TrainingLocationPreferenceInput, type UpdateProfileRequest, type UpdateRoutineRequest, type UpsertSetLogRequest, type UpsertSetLogResponse, type UserId, type UserProfile, type UserSearchResponse, WEIGHT_UNITS, WORKOUT_SESSION_STATUSES, type WeightUnit, type WorkoutAnalyticsStatus, type WorkoutProgressQuery, type WorkoutProgressResponse, type WorkoutSession, type WorkoutSessionId, type WorkoutSessionListResponse, type WorkoutSessionSnapshotV1, type WorkoutSessionStatus, type WorkoutSessionSummary, type WorkoutStatsQuery, type WorkoutStatsResponse };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunsteel/contracts",
3
- "version": "0.8.1",
3
+ "version": "0.10.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ezee969/sunsteel-contracts.git"