@sunsteel/contracts 0.10.0 → 0.11.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.cjs +9 -0
- package/dist/index.d.cts +26 -1
- package/dist/index.d.ts +26 -1
- package/dist/index.js +8 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -24,6 +24,7 @@ __export(index_exports, {
|
|
|
24
24
|
PROGRESSION_SCHEMES: () => PROGRESSION_SCHEMES,
|
|
25
25
|
REP_TYPES: () => REP_TYPES,
|
|
26
26
|
SEXES: () => SEXES,
|
|
27
|
+
TRAINING_EVENT_TYPES: () => TRAINING_EVENT_TYPES,
|
|
27
28
|
WEIGHT_UNITS: () => WEIGHT_UNITS,
|
|
28
29
|
WORKOUT_SESSION_STATUSES: () => WORKOUT_SESSION_STATUSES
|
|
29
30
|
});
|
|
@@ -62,12 +63,20 @@ var MUSCLE_GROUPS = [
|
|
|
62
63
|
"CORE",
|
|
63
64
|
"ADDUCTOR"
|
|
64
65
|
];
|
|
66
|
+
|
|
67
|
+
// src/analytics.ts
|
|
68
|
+
var TRAINING_EVENT_TYPES = [
|
|
69
|
+
"SESSION_COMPLETED",
|
|
70
|
+
"PERSONAL_RECORD",
|
|
71
|
+
"PROGRESSION_CHANGED"
|
|
72
|
+
];
|
|
65
73
|
// Annotate the CommonJS export names for ESM import in node:
|
|
66
74
|
0 && (module.exports = {
|
|
67
75
|
MUSCLE_GROUPS,
|
|
68
76
|
PROGRESSION_SCHEMES,
|
|
69
77
|
REP_TYPES,
|
|
70
78
|
SEXES,
|
|
79
|
+
TRAINING_EVENT_TYPES,
|
|
71
80
|
WEIGHT_UNITS,
|
|
72
81
|
WORKOUT_SESSION_STATUSES
|
|
73
82
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -286,6 +286,29 @@ interface FinishWorkoutRequest {
|
|
|
286
286
|
status: FinishStatus;
|
|
287
287
|
notes?: string;
|
|
288
288
|
}
|
|
289
|
+
type ProgressionRule = 'ALL_SETS_REACHED_TARGET' | 'SET_REACHED_TARGET';
|
|
290
|
+
interface ProgressionSetChange {
|
|
291
|
+
setNumber: number;
|
|
292
|
+
targetReps: number;
|
|
293
|
+
performedReps: number;
|
|
294
|
+
previousWeightKg: number;
|
|
295
|
+
newWeightKg: number;
|
|
296
|
+
}
|
|
297
|
+
/** An automatic prescription update produced while completing a session. */
|
|
298
|
+
interface ProgressionChange {
|
|
299
|
+
routineExerciseId: string;
|
|
300
|
+
exerciseId: string;
|
|
301
|
+
exerciseName: string;
|
|
302
|
+
progressionScheme: Extract<ProgressionScheme, 'DOUBLE_PROGRESSION' | 'DYNAMIC_DOUBLE_PROGRESSION'>;
|
|
303
|
+
rule: ProgressionRule;
|
|
304
|
+
minWeightIncrementKg: number;
|
|
305
|
+
sets: ProgressionSetChange[];
|
|
306
|
+
}
|
|
307
|
+
/** Stable successful response of PATCH /workouts/sessions/:id/finish. */
|
|
308
|
+
interface FinishWorkoutResponse {
|
|
309
|
+
session: WorkoutSession;
|
|
310
|
+
progressionChanges: ProgressionChange[];
|
|
311
|
+
}
|
|
289
312
|
interface UpsertSetLogRequest {
|
|
290
313
|
routineExerciseId: string;
|
|
291
314
|
exerciseId: string;
|
|
@@ -350,6 +373,8 @@ interface WorkoutStatsResponse {
|
|
|
350
373
|
activeDaysThisWeek: number;
|
|
351
374
|
}
|
|
352
375
|
|
|
376
|
+
declare const TRAINING_EVENT_TYPES: readonly ["SESSION_COMPLETED", "PERSONAL_RECORD", "PROGRESSION_CHANGED"];
|
|
377
|
+
type TrainingEventType = (typeof TRAINING_EVENT_TYPES)[number];
|
|
353
378
|
/** Stable successful response of GET /workouts/progress. */
|
|
354
379
|
interface WorkoutProgressQuery {
|
|
355
380
|
timeZone: string;
|
|
@@ -404,4 +429,4 @@ interface WorkoutAnalyticsStatus {
|
|
|
404
429
|
generationId: string | null;
|
|
405
430
|
}
|
|
406
431
|
|
|
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 };
|
|
432
|
+
export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type EarnedPersonalRecord, type Exercise, type ExerciseId, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type IsoDateString, type ListSessionsParams, MUSCLE_GROUPS, type MuscleGroup, PROGRESSION_SCHEMES, type PaginatedResponse, type PersonalRecordEntry, type PersonalRecordKind, type PlatePairInventory, type PreviousPerformanceResponse, type PreviousSetPerformance, type ProgressionChange, type ProgressionRule, type ProgressionScheme, type ProgressionSetChange, 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, TRAINING_EVENT_TYPES, type TrainingEventType, 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
|
@@ -286,6 +286,29 @@ interface FinishWorkoutRequest {
|
|
|
286
286
|
status: FinishStatus;
|
|
287
287
|
notes?: string;
|
|
288
288
|
}
|
|
289
|
+
type ProgressionRule = 'ALL_SETS_REACHED_TARGET' | 'SET_REACHED_TARGET';
|
|
290
|
+
interface ProgressionSetChange {
|
|
291
|
+
setNumber: number;
|
|
292
|
+
targetReps: number;
|
|
293
|
+
performedReps: number;
|
|
294
|
+
previousWeightKg: number;
|
|
295
|
+
newWeightKg: number;
|
|
296
|
+
}
|
|
297
|
+
/** An automatic prescription update produced while completing a session. */
|
|
298
|
+
interface ProgressionChange {
|
|
299
|
+
routineExerciseId: string;
|
|
300
|
+
exerciseId: string;
|
|
301
|
+
exerciseName: string;
|
|
302
|
+
progressionScheme: Extract<ProgressionScheme, 'DOUBLE_PROGRESSION' | 'DYNAMIC_DOUBLE_PROGRESSION'>;
|
|
303
|
+
rule: ProgressionRule;
|
|
304
|
+
minWeightIncrementKg: number;
|
|
305
|
+
sets: ProgressionSetChange[];
|
|
306
|
+
}
|
|
307
|
+
/** Stable successful response of PATCH /workouts/sessions/:id/finish. */
|
|
308
|
+
interface FinishWorkoutResponse {
|
|
309
|
+
session: WorkoutSession;
|
|
310
|
+
progressionChanges: ProgressionChange[];
|
|
311
|
+
}
|
|
289
312
|
interface UpsertSetLogRequest {
|
|
290
313
|
routineExerciseId: string;
|
|
291
314
|
exerciseId: string;
|
|
@@ -350,6 +373,8 @@ interface WorkoutStatsResponse {
|
|
|
350
373
|
activeDaysThisWeek: number;
|
|
351
374
|
}
|
|
352
375
|
|
|
376
|
+
declare const TRAINING_EVENT_TYPES: readonly ["SESSION_COMPLETED", "PERSONAL_RECORD", "PROGRESSION_CHANGED"];
|
|
377
|
+
type TrainingEventType = (typeof TRAINING_EVENT_TYPES)[number];
|
|
353
378
|
/** Stable successful response of GET /workouts/progress. */
|
|
354
379
|
interface WorkoutProgressQuery {
|
|
355
380
|
timeZone: string;
|
|
@@ -404,4 +429,4 @@ interface WorkoutAnalyticsStatus {
|
|
|
404
429
|
generationId: string | null;
|
|
405
430
|
}
|
|
406
431
|
|
|
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 };
|
|
432
|
+
export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type EarnedPersonalRecord, type Exercise, type ExerciseId, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type IsoDateString, type ListSessionsParams, MUSCLE_GROUPS, type MuscleGroup, PROGRESSION_SCHEMES, type PaginatedResponse, type PersonalRecordEntry, type PersonalRecordKind, type PlatePairInventory, type PreviousPerformanceResponse, type PreviousSetPerformance, type ProgressionChange, type ProgressionRule, type ProgressionScheme, type ProgressionSetChange, 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, TRAINING_EVENT_TYPES, type TrainingEventType, 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.js
CHANGED
|
@@ -31,11 +31,19 @@ var MUSCLE_GROUPS = [
|
|
|
31
31
|
"CORE",
|
|
32
32
|
"ADDUCTOR"
|
|
33
33
|
];
|
|
34
|
+
|
|
35
|
+
// src/analytics.ts
|
|
36
|
+
var TRAINING_EVENT_TYPES = [
|
|
37
|
+
"SESSION_COMPLETED",
|
|
38
|
+
"PERSONAL_RECORD",
|
|
39
|
+
"PROGRESSION_CHANGED"
|
|
40
|
+
];
|
|
34
41
|
export {
|
|
35
42
|
MUSCLE_GROUPS,
|
|
36
43
|
PROGRESSION_SCHEMES,
|
|
37
44
|
REP_TYPES,
|
|
38
45
|
SEXES,
|
|
46
|
+
TRAINING_EVENT_TYPES,
|
|
39
47
|
WEIGHT_UNITS,
|
|
40
48
|
WORKOUT_SESSION_STATUSES
|
|
41
49
|
};
|