@sunsteel/contracts 0.2.6 → 0.4.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 +13 -19
- package/dist/index.d.cts +42 -121
- package/dist/index.d.ts +42 -121
- package/dist/index.js +12 -19
- package/package.json +9 -2
package/dist/index.cjs
CHANGED
|
@@ -25,11 +25,12 @@ __export(index_exports, {
|
|
|
25
25
|
PROGRESSION_SCHEMES: () => PROGRESSION_SCHEMES,
|
|
26
26
|
REP_TYPES: () => REP_TYPES,
|
|
27
27
|
SEXES: () => SEXES,
|
|
28
|
-
TM_ADJUSTMENT_CONSTANTS: () => TM_ADJUSTMENT_CONSTANTS,
|
|
29
28
|
WEIGHT_UNITS: () => WEIGHT_UNITS,
|
|
30
29
|
WORKOUT_SESSION_STATUSES: () => WORKOUT_SESSION_STATUSES
|
|
31
30
|
});
|
|
32
31
|
module.exports = __toCommonJS(index_exports);
|
|
32
|
+
|
|
33
|
+
// src/shared.ts
|
|
33
34
|
var PROGRAM_STYLES = ["STANDARD", "HYPERTROPHY"];
|
|
34
35
|
var WORKOUT_SESSION_STATUSES = [
|
|
35
36
|
"IN_PROGRESS",
|
|
@@ -42,33 +43,27 @@ var REP_TYPES = ["FIXED", "RANGE"];
|
|
|
42
43
|
var PROGRESSION_SCHEMES = [
|
|
43
44
|
"NONE",
|
|
44
45
|
"DOUBLE_PROGRESSION",
|
|
45
|
-
"DYNAMIC_DOUBLE_PROGRESSION"
|
|
46
|
-
"PROGRAMMED_RTF",
|
|
47
|
-
"PROGRAMMED_RTF_HYPERTROPHY"
|
|
46
|
+
"DYNAMIC_DOUBLE_PROGRESSION"
|
|
48
47
|
];
|
|
49
48
|
var MUSCLE_GROUPS = [
|
|
50
49
|
"PECTORAL",
|
|
51
50
|
"LATISSIMUS_DORSI",
|
|
52
|
-
"DELTOID",
|
|
53
51
|
"TRAPEZIUS",
|
|
52
|
+
"REAR_DELTOIDS",
|
|
53
|
+
"ERECTOR_SPINAE",
|
|
54
|
+
"TERES_MAJOR_MINOR",
|
|
55
|
+
"ANTERIOR_DELTOIDS",
|
|
56
|
+
"MEDIAL_DELTOIDS",
|
|
54
57
|
"BICEPS",
|
|
55
58
|
"TRICEPS",
|
|
56
|
-
"
|
|
57
|
-
"ABDOMINAL",
|
|
58
|
-
"OBLIQUE",
|
|
59
|
-
"ERECTOR_SPINAE",
|
|
60
|
-
"GLUTEUS",
|
|
59
|
+
"FOREARMS",
|
|
61
60
|
"QUADRICEPS",
|
|
62
61
|
"HAMSTRINGS",
|
|
63
|
-
"
|
|
62
|
+
"GLUTES",
|
|
63
|
+
"CALVES",
|
|
64
|
+
"CORE",
|
|
65
|
+
"ADDUCTOR"
|
|
64
66
|
];
|
|
65
|
-
var TM_ADJUSTMENT_CONSTANTS = {
|
|
66
|
-
MAX_DELTA_KG: 15,
|
|
67
|
-
MIN_DELTA_KG: -15,
|
|
68
|
-
MIN_WEEK: 1,
|
|
69
|
-
MAX_WEEK: 21,
|
|
70
|
-
MAX_REASON_LENGTH: 160
|
|
71
|
-
};
|
|
72
67
|
// Annotate the CommonJS export names for ESM import in node:
|
|
73
68
|
0 && (module.exports = {
|
|
74
69
|
MUSCLE_GROUPS,
|
|
@@ -76,7 +71,6 @@ var TM_ADJUSTMENT_CONSTANTS = {
|
|
|
76
71
|
PROGRESSION_SCHEMES,
|
|
77
72
|
REP_TYPES,
|
|
78
73
|
SEXES,
|
|
79
|
-
TM_ADJUSTMENT_CONSTANTS,
|
|
80
74
|
WEIGHT_UNITS,
|
|
81
75
|
WORKOUT_SESSION_STATUSES
|
|
82
76
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -8,9 +8,9 @@ declare const SEXES: readonly ["MALE", "FEMALE"];
|
|
|
8
8
|
type Sex = (typeof SEXES)[number];
|
|
9
9
|
declare const REP_TYPES: readonly ["FIXED", "RANGE"];
|
|
10
10
|
type RepType = (typeof REP_TYPES)[number];
|
|
11
|
-
declare const PROGRESSION_SCHEMES: readonly ["NONE", "DOUBLE_PROGRESSION", "DYNAMIC_DOUBLE_PROGRESSION"
|
|
11
|
+
declare const PROGRESSION_SCHEMES: readonly ["NONE", "DOUBLE_PROGRESSION", "DYNAMIC_DOUBLE_PROGRESSION"];
|
|
12
12
|
type ProgressionScheme = (typeof PROGRESSION_SCHEMES)[number];
|
|
13
|
-
declare const MUSCLE_GROUPS: readonly ["PECTORAL", "LATISSIMUS_DORSI", "
|
|
13
|
+
declare const MUSCLE_GROUPS: readonly ["PECTORAL", "LATISSIMUS_DORSI", "TRAPEZIUS", "REAR_DELTOIDS", "ERECTOR_SPINAE", "TERES_MAJOR_MINOR", "ANTERIOR_DELTOIDS", "MEDIAL_DELTOIDS", "BICEPS", "TRICEPS", "FOREARMS", "QUADRICEPS", "HAMSTRINGS", "GLUTES", "CALVES", "CORE", "ADDUCTOR"];
|
|
14
14
|
type MuscleGroup = (typeof MUSCLE_GROUPS)[number];
|
|
15
15
|
type IsoDateString = string;
|
|
16
16
|
type Brand<T, B> = T & {
|
|
@@ -21,6 +21,11 @@ type RoutineId = Brand<string, 'RoutineId'>;
|
|
|
21
21
|
type RoutineDayId = Brand<string, 'RoutineDayId'>;
|
|
22
22
|
type WorkoutSessionId = Brand<string, 'WorkoutSessionId'>;
|
|
23
23
|
type ExerciseId = Brand<string, 'ExerciseId'>;
|
|
24
|
+
interface PaginatedResponse<T> {
|
|
25
|
+
items: T[];
|
|
26
|
+
nextCursor?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
interface UserProfile {
|
|
25
30
|
id: string;
|
|
26
31
|
email: string;
|
|
@@ -65,6 +70,37 @@ interface UserSearchResponse {
|
|
|
65
70
|
lastName?: string | null;
|
|
66
71
|
avatarUrl?: string | null;
|
|
67
72
|
}
|
|
73
|
+
|
|
74
|
+
interface SupabaseAuthUser {
|
|
75
|
+
id: string;
|
|
76
|
+
email: string;
|
|
77
|
+
name: string;
|
|
78
|
+
supabaseUserId?: string | null;
|
|
79
|
+
weightUnit: WeightUnit;
|
|
80
|
+
createdAt?: IsoDateString;
|
|
81
|
+
updatedAt?: IsoDateString;
|
|
82
|
+
}
|
|
83
|
+
interface SupabaseAuthResponse {
|
|
84
|
+
user: SupabaseAuthUser;
|
|
85
|
+
message?: string;
|
|
86
|
+
requiresEmailVerification?: boolean;
|
|
87
|
+
}
|
|
88
|
+
interface SupabaseMigrationResponse {
|
|
89
|
+
message: string;
|
|
90
|
+
userId: string;
|
|
91
|
+
email: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface Exercise {
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
primaryMuscles: MuscleGroup[];
|
|
98
|
+
secondaryMuscles: MuscleGroup[];
|
|
99
|
+
equipment: string;
|
|
100
|
+
createdAt: IsoDateString;
|
|
101
|
+
updatedAt: IsoDateString;
|
|
102
|
+
}
|
|
103
|
+
|
|
68
104
|
interface RoutineSet {
|
|
69
105
|
setNumber: number;
|
|
70
106
|
repType: RepType;
|
|
@@ -130,7 +166,6 @@ interface Routine {
|
|
|
130
166
|
programStartDate?: IsoDateString;
|
|
131
167
|
programEndDate?: IsoDateString;
|
|
132
168
|
programTimezone?: string;
|
|
133
|
-
rtfGoals?: RtfWeekGoals;
|
|
134
169
|
days: RoutineDay[];
|
|
135
170
|
createdAt: IsoDateString;
|
|
136
171
|
updatedAt: IsoDateString;
|
|
@@ -146,6 +181,8 @@ interface CreateRoutineRequest {
|
|
|
146
181
|
programStyle?: ProgramStyle;
|
|
147
182
|
days: CreateRoutineDayInput[];
|
|
148
183
|
}
|
|
184
|
+
type UpdateRoutineRequest = Partial<CreateRoutineRequest>;
|
|
185
|
+
|
|
149
186
|
interface SetLog {
|
|
150
187
|
id: string;
|
|
151
188
|
sessionId: string;
|
|
@@ -172,16 +209,6 @@ interface WorkoutSession {
|
|
|
172
209
|
notes?: string | null;
|
|
173
210
|
lastActivityAt?: IsoDateString | null;
|
|
174
211
|
setLogs?: SetLog[];
|
|
175
|
-
program?: {
|
|
176
|
-
currentWeek: number;
|
|
177
|
-
durationWeeks: number;
|
|
178
|
-
withDeloads: boolean;
|
|
179
|
-
isDeloadWeek: boolean;
|
|
180
|
-
startDate: IsoDateString;
|
|
181
|
-
endDate: IsoDateString;
|
|
182
|
-
timeZone: string;
|
|
183
|
-
};
|
|
184
|
-
rtfPlans?: unknown[];
|
|
185
212
|
reused?: boolean;
|
|
186
213
|
routine?: {
|
|
187
214
|
id: string;
|
|
@@ -231,8 +258,6 @@ interface StartWorkoutResponse {
|
|
|
231
258
|
status: WorkoutSessionStatus;
|
|
232
259
|
startedAt: IsoDateString;
|
|
233
260
|
endedAt?: IsoDateString | null;
|
|
234
|
-
program?: WorkoutSession['program'];
|
|
235
|
-
rtfPlans?: WorkoutSession['rtfPlans'];
|
|
236
261
|
reused: boolean;
|
|
237
262
|
}
|
|
238
263
|
type FinishStatus = Extract<WorkoutSessionStatus, 'COMPLETED' | 'ABORTED'>;
|
|
@@ -265,10 +290,6 @@ interface WorkoutSessionSummary {
|
|
|
265
290
|
dayName?: string | null;
|
|
266
291
|
};
|
|
267
292
|
}
|
|
268
|
-
interface PaginatedResponse<T> {
|
|
269
|
-
items: T[];
|
|
270
|
-
nextCursor?: string;
|
|
271
|
-
}
|
|
272
293
|
interface ListSessionsParams {
|
|
273
294
|
status?: WorkoutSessionStatus;
|
|
274
295
|
routineId?: string;
|
|
@@ -279,106 +300,6 @@ interface ListSessionsParams {
|
|
|
279
300
|
limit?: number;
|
|
280
301
|
sort?: 'finishedAt:desc' | 'finishedAt:asc' | 'startedAt:desc' | 'startedAt:asc';
|
|
281
302
|
}
|
|
282
|
-
type
|
|
283
|
-
interface RtfExerciseGoal {
|
|
284
|
-
routineExerciseId: string;
|
|
285
|
-
exerciseId: string;
|
|
286
|
-
exerciseName: string;
|
|
287
|
-
variant: RtfVariant;
|
|
288
|
-
week: number;
|
|
289
|
-
isDeload: boolean;
|
|
290
|
-
intensity: number;
|
|
291
|
-
fixedReps: number;
|
|
292
|
-
setsPlanned: number;
|
|
293
|
-
amrapTarget: number | null;
|
|
294
|
-
amrapSetNumber: number | null;
|
|
295
|
-
workingWeightKg?: number;
|
|
296
|
-
trainingMaxKg?: number;
|
|
297
|
-
}
|
|
298
|
-
interface RtfWeekGoals {
|
|
299
|
-
routineId: string;
|
|
300
|
-
week: number;
|
|
301
|
-
withDeloads: boolean;
|
|
302
|
-
goals: RtfExerciseGoal[];
|
|
303
|
-
version: number;
|
|
304
|
-
_cache?: 'HIT' | 'MISS';
|
|
305
|
-
}
|
|
306
|
-
interface RtfTimelineEntry {
|
|
307
|
-
week: number;
|
|
308
|
-
isDeload: boolean;
|
|
309
|
-
startDate: IsoDateString;
|
|
310
|
-
endDate: IsoDateString;
|
|
311
|
-
}
|
|
312
|
-
interface RtfTimeline {
|
|
313
|
-
routineId: string;
|
|
314
|
-
totalWeeks: number;
|
|
315
|
-
withDeloads: boolean;
|
|
316
|
-
timeline: RtfTimelineEntry[];
|
|
317
|
-
version: number;
|
|
318
|
-
_cache?: 'HIT' | 'MISS';
|
|
319
|
-
}
|
|
320
|
-
interface RtfForecastData {
|
|
321
|
-
intensity: number;
|
|
322
|
-
fixedReps: number;
|
|
323
|
-
amrapTarget: number;
|
|
324
|
-
sets: number;
|
|
325
|
-
amrapSet: number;
|
|
326
|
-
isDeload?: boolean;
|
|
327
|
-
}
|
|
328
|
-
interface RtfForecastWeek {
|
|
329
|
-
week: number;
|
|
330
|
-
isDeload: boolean;
|
|
331
|
-
standard?: RtfForecastData;
|
|
332
|
-
hypertrophy?: RtfForecastData;
|
|
333
|
-
}
|
|
334
|
-
interface RtfForecast {
|
|
335
|
-
routineId: string;
|
|
336
|
-
weeks: number;
|
|
337
|
-
version: number;
|
|
338
|
-
withDeloads: boolean;
|
|
339
|
-
forecast: RtfForecastWeek[];
|
|
340
|
-
_cache?: 'HIT' | 'MISS';
|
|
341
|
-
}
|
|
342
|
-
interface CreateTmEventRequest {
|
|
343
|
-
exerciseId: string;
|
|
344
|
-
weekNumber: number;
|
|
345
|
-
deltaKg: number;
|
|
346
|
-
preTmKg: number;
|
|
347
|
-
postTmKg: number;
|
|
348
|
-
reason?: string;
|
|
349
|
-
}
|
|
350
|
-
interface TmEventResponse {
|
|
351
|
-
id: string;
|
|
352
|
-
routineId: string;
|
|
353
|
-
exerciseId: string;
|
|
354
|
-
exerciseName: string;
|
|
355
|
-
weekNumber: number;
|
|
356
|
-
deltaKg: number;
|
|
357
|
-
preTmKg: number;
|
|
358
|
-
postTmKg: number;
|
|
359
|
-
reason?: string;
|
|
360
|
-
style: ProgramStyle | null;
|
|
361
|
-
createdAt: IsoDateString;
|
|
362
|
-
}
|
|
363
|
-
interface TmEventSummary {
|
|
364
|
-
exerciseId: string;
|
|
365
|
-
exerciseName: string;
|
|
366
|
-
totalDeltaKg: number;
|
|
367
|
-
averageDeltaKg: number;
|
|
368
|
-
adjustmentCount: number;
|
|
369
|
-
lastAdjustmentDate: IsoDateString | null;
|
|
370
|
-
}
|
|
371
|
-
interface GetTmAdjustmentsParams {
|
|
372
|
-
exerciseId?: string;
|
|
373
|
-
minWeek?: number;
|
|
374
|
-
maxWeek?: number;
|
|
375
|
-
}
|
|
376
|
-
declare const TM_ADJUSTMENT_CONSTANTS: {
|
|
377
|
-
readonly MAX_DELTA_KG: 15;
|
|
378
|
-
readonly MIN_DELTA_KG: -15;
|
|
379
|
-
readonly MIN_WEEK: 1;
|
|
380
|
-
readonly MAX_WEEK: 21;
|
|
381
|
-
readonly MAX_REASON_LENGTH: 160;
|
|
382
|
-
};
|
|
303
|
+
type WorkoutSessionListResponse = PaginatedResponse<WorkoutSessionSummary>;
|
|
383
304
|
|
|
384
|
-
export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type
|
|
305
|
+
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, PROGRAM_STYLES, PROGRESSION_SCHEMES, type PaginatedResponse, type ProgramStyle, type ProgressionScheme, type PublicUserProfile, REP_TYPES, type RepType, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineSet, SEXES, 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 WorkoutSession, type WorkoutSessionId, type WorkoutSessionListResponse, type WorkoutSessionStatus, type WorkoutSessionSummary };
|
package/dist/index.d.ts
CHANGED
|
@@ -8,9 +8,9 @@ declare const SEXES: readonly ["MALE", "FEMALE"];
|
|
|
8
8
|
type Sex = (typeof SEXES)[number];
|
|
9
9
|
declare const REP_TYPES: readonly ["FIXED", "RANGE"];
|
|
10
10
|
type RepType = (typeof REP_TYPES)[number];
|
|
11
|
-
declare const PROGRESSION_SCHEMES: readonly ["NONE", "DOUBLE_PROGRESSION", "DYNAMIC_DOUBLE_PROGRESSION"
|
|
11
|
+
declare const PROGRESSION_SCHEMES: readonly ["NONE", "DOUBLE_PROGRESSION", "DYNAMIC_DOUBLE_PROGRESSION"];
|
|
12
12
|
type ProgressionScheme = (typeof PROGRESSION_SCHEMES)[number];
|
|
13
|
-
declare const MUSCLE_GROUPS: readonly ["PECTORAL", "LATISSIMUS_DORSI", "
|
|
13
|
+
declare const MUSCLE_GROUPS: readonly ["PECTORAL", "LATISSIMUS_DORSI", "TRAPEZIUS", "REAR_DELTOIDS", "ERECTOR_SPINAE", "TERES_MAJOR_MINOR", "ANTERIOR_DELTOIDS", "MEDIAL_DELTOIDS", "BICEPS", "TRICEPS", "FOREARMS", "QUADRICEPS", "HAMSTRINGS", "GLUTES", "CALVES", "CORE", "ADDUCTOR"];
|
|
14
14
|
type MuscleGroup = (typeof MUSCLE_GROUPS)[number];
|
|
15
15
|
type IsoDateString = string;
|
|
16
16
|
type Brand<T, B> = T & {
|
|
@@ -21,6 +21,11 @@ type RoutineId = Brand<string, 'RoutineId'>;
|
|
|
21
21
|
type RoutineDayId = Brand<string, 'RoutineDayId'>;
|
|
22
22
|
type WorkoutSessionId = Brand<string, 'WorkoutSessionId'>;
|
|
23
23
|
type ExerciseId = Brand<string, 'ExerciseId'>;
|
|
24
|
+
interface PaginatedResponse<T> {
|
|
25
|
+
items: T[];
|
|
26
|
+
nextCursor?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
interface UserProfile {
|
|
25
30
|
id: string;
|
|
26
31
|
email: string;
|
|
@@ -65,6 +70,37 @@ interface UserSearchResponse {
|
|
|
65
70
|
lastName?: string | null;
|
|
66
71
|
avatarUrl?: string | null;
|
|
67
72
|
}
|
|
73
|
+
|
|
74
|
+
interface SupabaseAuthUser {
|
|
75
|
+
id: string;
|
|
76
|
+
email: string;
|
|
77
|
+
name: string;
|
|
78
|
+
supabaseUserId?: string | null;
|
|
79
|
+
weightUnit: WeightUnit;
|
|
80
|
+
createdAt?: IsoDateString;
|
|
81
|
+
updatedAt?: IsoDateString;
|
|
82
|
+
}
|
|
83
|
+
interface SupabaseAuthResponse {
|
|
84
|
+
user: SupabaseAuthUser;
|
|
85
|
+
message?: string;
|
|
86
|
+
requiresEmailVerification?: boolean;
|
|
87
|
+
}
|
|
88
|
+
interface SupabaseMigrationResponse {
|
|
89
|
+
message: string;
|
|
90
|
+
userId: string;
|
|
91
|
+
email: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface Exercise {
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
primaryMuscles: MuscleGroup[];
|
|
98
|
+
secondaryMuscles: MuscleGroup[];
|
|
99
|
+
equipment: string;
|
|
100
|
+
createdAt: IsoDateString;
|
|
101
|
+
updatedAt: IsoDateString;
|
|
102
|
+
}
|
|
103
|
+
|
|
68
104
|
interface RoutineSet {
|
|
69
105
|
setNumber: number;
|
|
70
106
|
repType: RepType;
|
|
@@ -130,7 +166,6 @@ interface Routine {
|
|
|
130
166
|
programStartDate?: IsoDateString;
|
|
131
167
|
programEndDate?: IsoDateString;
|
|
132
168
|
programTimezone?: string;
|
|
133
|
-
rtfGoals?: RtfWeekGoals;
|
|
134
169
|
days: RoutineDay[];
|
|
135
170
|
createdAt: IsoDateString;
|
|
136
171
|
updatedAt: IsoDateString;
|
|
@@ -146,6 +181,8 @@ interface CreateRoutineRequest {
|
|
|
146
181
|
programStyle?: ProgramStyle;
|
|
147
182
|
days: CreateRoutineDayInput[];
|
|
148
183
|
}
|
|
184
|
+
type UpdateRoutineRequest = Partial<CreateRoutineRequest>;
|
|
185
|
+
|
|
149
186
|
interface SetLog {
|
|
150
187
|
id: string;
|
|
151
188
|
sessionId: string;
|
|
@@ -172,16 +209,6 @@ interface WorkoutSession {
|
|
|
172
209
|
notes?: string | null;
|
|
173
210
|
lastActivityAt?: IsoDateString | null;
|
|
174
211
|
setLogs?: SetLog[];
|
|
175
|
-
program?: {
|
|
176
|
-
currentWeek: number;
|
|
177
|
-
durationWeeks: number;
|
|
178
|
-
withDeloads: boolean;
|
|
179
|
-
isDeloadWeek: boolean;
|
|
180
|
-
startDate: IsoDateString;
|
|
181
|
-
endDate: IsoDateString;
|
|
182
|
-
timeZone: string;
|
|
183
|
-
};
|
|
184
|
-
rtfPlans?: unknown[];
|
|
185
212
|
reused?: boolean;
|
|
186
213
|
routine?: {
|
|
187
214
|
id: string;
|
|
@@ -231,8 +258,6 @@ interface StartWorkoutResponse {
|
|
|
231
258
|
status: WorkoutSessionStatus;
|
|
232
259
|
startedAt: IsoDateString;
|
|
233
260
|
endedAt?: IsoDateString | null;
|
|
234
|
-
program?: WorkoutSession['program'];
|
|
235
|
-
rtfPlans?: WorkoutSession['rtfPlans'];
|
|
236
261
|
reused: boolean;
|
|
237
262
|
}
|
|
238
263
|
type FinishStatus = Extract<WorkoutSessionStatus, 'COMPLETED' | 'ABORTED'>;
|
|
@@ -265,10 +290,6 @@ interface WorkoutSessionSummary {
|
|
|
265
290
|
dayName?: string | null;
|
|
266
291
|
};
|
|
267
292
|
}
|
|
268
|
-
interface PaginatedResponse<T> {
|
|
269
|
-
items: T[];
|
|
270
|
-
nextCursor?: string;
|
|
271
|
-
}
|
|
272
293
|
interface ListSessionsParams {
|
|
273
294
|
status?: WorkoutSessionStatus;
|
|
274
295
|
routineId?: string;
|
|
@@ -279,106 +300,6 @@ interface ListSessionsParams {
|
|
|
279
300
|
limit?: number;
|
|
280
301
|
sort?: 'finishedAt:desc' | 'finishedAt:asc' | 'startedAt:desc' | 'startedAt:asc';
|
|
281
302
|
}
|
|
282
|
-
type
|
|
283
|
-
interface RtfExerciseGoal {
|
|
284
|
-
routineExerciseId: string;
|
|
285
|
-
exerciseId: string;
|
|
286
|
-
exerciseName: string;
|
|
287
|
-
variant: RtfVariant;
|
|
288
|
-
week: number;
|
|
289
|
-
isDeload: boolean;
|
|
290
|
-
intensity: number;
|
|
291
|
-
fixedReps: number;
|
|
292
|
-
setsPlanned: number;
|
|
293
|
-
amrapTarget: number | null;
|
|
294
|
-
amrapSetNumber: number | null;
|
|
295
|
-
workingWeightKg?: number;
|
|
296
|
-
trainingMaxKg?: number;
|
|
297
|
-
}
|
|
298
|
-
interface RtfWeekGoals {
|
|
299
|
-
routineId: string;
|
|
300
|
-
week: number;
|
|
301
|
-
withDeloads: boolean;
|
|
302
|
-
goals: RtfExerciseGoal[];
|
|
303
|
-
version: number;
|
|
304
|
-
_cache?: 'HIT' | 'MISS';
|
|
305
|
-
}
|
|
306
|
-
interface RtfTimelineEntry {
|
|
307
|
-
week: number;
|
|
308
|
-
isDeload: boolean;
|
|
309
|
-
startDate: IsoDateString;
|
|
310
|
-
endDate: IsoDateString;
|
|
311
|
-
}
|
|
312
|
-
interface RtfTimeline {
|
|
313
|
-
routineId: string;
|
|
314
|
-
totalWeeks: number;
|
|
315
|
-
withDeloads: boolean;
|
|
316
|
-
timeline: RtfTimelineEntry[];
|
|
317
|
-
version: number;
|
|
318
|
-
_cache?: 'HIT' | 'MISS';
|
|
319
|
-
}
|
|
320
|
-
interface RtfForecastData {
|
|
321
|
-
intensity: number;
|
|
322
|
-
fixedReps: number;
|
|
323
|
-
amrapTarget: number;
|
|
324
|
-
sets: number;
|
|
325
|
-
amrapSet: number;
|
|
326
|
-
isDeload?: boolean;
|
|
327
|
-
}
|
|
328
|
-
interface RtfForecastWeek {
|
|
329
|
-
week: number;
|
|
330
|
-
isDeload: boolean;
|
|
331
|
-
standard?: RtfForecastData;
|
|
332
|
-
hypertrophy?: RtfForecastData;
|
|
333
|
-
}
|
|
334
|
-
interface RtfForecast {
|
|
335
|
-
routineId: string;
|
|
336
|
-
weeks: number;
|
|
337
|
-
version: number;
|
|
338
|
-
withDeloads: boolean;
|
|
339
|
-
forecast: RtfForecastWeek[];
|
|
340
|
-
_cache?: 'HIT' | 'MISS';
|
|
341
|
-
}
|
|
342
|
-
interface CreateTmEventRequest {
|
|
343
|
-
exerciseId: string;
|
|
344
|
-
weekNumber: number;
|
|
345
|
-
deltaKg: number;
|
|
346
|
-
preTmKg: number;
|
|
347
|
-
postTmKg: number;
|
|
348
|
-
reason?: string;
|
|
349
|
-
}
|
|
350
|
-
interface TmEventResponse {
|
|
351
|
-
id: string;
|
|
352
|
-
routineId: string;
|
|
353
|
-
exerciseId: string;
|
|
354
|
-
exerciseName: string;
|
|
355
|
-
weekNumber: number;
|
|
356
|
-
deltaKg: number;
|
|
357
|
-
preTmKg: number;
|
|
358
|
-
postTmKg: number;
|
|
359
|
-
reason?: string;
|
|
360
|
-
style: ProgramStyle | null;
|
|
361
|
-
createdAt: IsoDateString;
|
|
362
|
-
}
|
|
363
|
-
interface TmEventSummary {
|
|
364
|
-
exerciseId: string;
|
|
365
|
-
exerciseName: string;
|
|
366
|
-
totalDeltaKg: number;
|
|
367
|
-
averageDeltaKg: number;
|
|
368
|
-
adjustmentCount: number;
|
|
369
|
-
lastAdjustmentDate: IsoDateString | null;
|
|
370
|
-
}
|
|
371
|
-
interface GetTmAdjustmentsParams {
|
|
372
|
-
exerciseId?: string;
|
|
373
|
-
minWeek?: number;
|
|
374
|
-
maxWeek?: number;
|
|
375
|
-
}
|
|
376
|
-
declare const TM_ADJUSTMENT_CONSTANTS: {
|
|
377
|
-
readonly MAX_DELTA_KG: 15;
|
|
378
|
-
readonly MIN_DELTA_KG: -15;
|
|
379
|
-
readonly MIN_WEEK: 1;
|
|
380
|
-
readonly MAX_WEEK: 21;
|
|
381
|
-
readonly MAX_REASON_LENGTH: 160;
|
|
382
|
-
};
|
|
303
|
+
type WorkoutSessionListResponse = PaginatedResponse<WorkoutSessionSummary>;
|
|
383
304
|
|
|
384
|
-
export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type
|
|
305
|
+
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, PROGRAM_STYLES, PROGRESSION_SCHEMES, type PaginatedResponse, type ProgramStyle, type ProgressionScheme, type PublicUserProfile, REP_TYPES, type RepType, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineSet, SEXES, 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 WorkoutSession, type WorkoutSessionId, type WorkoutSessionListResponse, type WorkoutSessionStatus, type WorkoutSessionSummary };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/shared.ts
|
|
2
2
|
var PROGRAM_STYLES = ["STANDARD", "HYPERTROPHY"];
|
|
3
3
|
var WORKOUT_SESSION_STATUSES = [
|
|
4
4
|
"IN_PROGRESS",
|
|
@@ -11,40 +11,33 @@ var REP_TYPES = ["FIXED", "RANGE"];
|
|
|
11
11
|
var PROGRESSION_SCHEMES = [
|
|
12
12
|
"NONE",
|
|
13
13
|
"DOUBLE_PROGRESSION",
|
|
14
|
-
"DYNAMIC_DOUBLE_PROGRESSION"
|
|
15
|
-
"PROGRAMMED_RTF",
|
|
16
|
-
"PROGRAMMED_RTF_HYPERTROPHY"
|
|
14
|
+
"DYNAMIC_DOUBLE_PROGRESSION"
|
|
17
15
|
];
|
|
18
16
|
var MUSCLE_GROUPS = [
|
|
19
17
|
"PECTORAL",
|
|
20
18
|
"LATISSIMUS_DORSI",
|
|
21
|
-
"DELTOID",
|
|
22
19
|
"TRAPEZIUS",
|
|
20
|
+
"REAR_DELTOIDS",
|
|
21
|
+
"ERECTOR_SPINAE",
|
|
22
|
+
"TERES_MAJOR_MINOR",
|
|
23
|
+
"ANTERIOR_DELTOIDS",
|
|
24
|
+
"MEDIAL_DELTOIDS",
|
|
23
25
|
"BICEPS",
|
|
24
26
|
"TRICEPS",
|
|
25
|
-
"
|
|
26
|
-
"ABDOMINAL",
|
|
27
|
-
"OBLIQUE",
|
|
28
|
-
"ERECTOR_SPINAE",
|
|
29
|
-
"GLUTEUS",
|
|
27
|
+
"FOREARMS",
|
|
30
28
|
"QUADRICEPS",
|
|
31
29
|
"HAMSTRINGS",
|
|
32
|
-
"
|
|
30
|
+
"GLUTES",
|
|
31
|
+
"CALVES",
|
|
32
|
+
"CORE",
|
|
33
|
+
"ADDUCTOR"
|
|
33
34
|
];
|
|
34
|
-
var TM_ADJUSTMENT_CONSTANTS = {
|
|
35
|
-
MAX_DELTA_KG: 15,
|
|
36
|
-
MIN_DELTA_KG: -15,
|
|
37
|
-
MIN_WEEK: 1,
|
|
38
|
-
MAX_WEEK: 21,
|
|
39
|
-
MAX_REASON_LENGTH: 160
|
|
40
|
-
};
|
|
41
35
|
export {
|
|
42
36
|
MUSCLE_GROUPS,
|
|
43
37
|
PROGRAM_STYLES,
|
|
44
38
|
PROGRESSION_SCHEMES,
|
|
45
39
|
REP_TYPES,
|
|
46
40
|
SEXES,
|
|
47
|
-
TM_ADJUSTMENT_CONSTANTS,
|
|
48
41
|
WEIGHT_UNITS,
|
|
49
42
|
WORKOUT_SESSION_STATUSES
|
|
50
43
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sunsteel/contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
|
-
"url": "git+https://github.com
|
|
6
|
+
"url": "git+https://github.com/ezee969/sunsteel-contracts.git"
|
|
7
7
|
},
|
|
8
8
|
"private": false,
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=20.11"
|
|
11
|
+
},
|
|
9
12
|
"type": "module",
|
|
10
13
|
"sideEffects": false,
|
|
11
14
|
"main": "./dist/index.cjs",
|
|
@@ -24,6 +27,10 @@
|
|
|
24
27
|
"scripts": {
|
|
25
28
|
"build": "tsup src/index.ts --format esm,cjs --dts --clean",
|
|
26
29
|
"dev": "tsup src/index.ts --format esm,cjs --dts --watch",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"lint": "npm run typecheck",
|
|
32
|
+
"verify": "npm run typecheck && npm run build",
|
|
33
|
+
"verify:security": "npm audit",
|
|
27
34
|
"prepublishOnly": "npm run build"
|
|
28
35
|
},
|
|
29
36
|
"devDependencies": {
|