@abyss-project/training 1.0.0 → 1.0.2
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/api/analytics.public.api.d.ts +2 -0
- package/dist/api/analytics.public.api.js +8 -0
- package/dist/api/exercise.api.d.ts +10 -0
- package/dist/api/exercise.api.js +52 -0
- package/dist/api/exercise.public.api.d.ts +3 -0
- package/dist/api/exercise.public.api.js +14 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.js +4 -0
- package/dist/api/training-program.api.d.ts +13 -0
- package/dist/api/training-program.api.js +53 -0
- package/dist/api/user.api.d.ts +3 -1
- package/dist/api/user.api.js +11 -1
- package/dist/api/workout-session.api.d.ts +2 -5
- package/dist/api/workout-session.api.js +4 -16
- package/dist/api/workout-template.api.d.ts +1 -2
- package/dist/api/workout-template.api.js +1 -5
- package/dist/index.js +2 -1
- package/dist/types/enum/day-of-week.enum.d.ts +9 -0
- package/dist/types/enum/day-of-week.enum.js +13 -0
- package/dist/types/enum/exercise-measurement-type.enum.d.ts +7 -0
- package/dist/types/enum/exercise-measurement-type.enum.js +11 -0
- package/dist/types/enum/index.d.ts +7 -2
- package/dist/types/enum/index.js +7 -2
- package/dist/types/enum/personal-record-type.enum.d.ts +9 -0
- package/dist/types/enum/personal-record-type.enum.js +13 -0
- package/dist/types/enum/schedule-type.enum.d.ts +5 -0
- package/dist/types/enum/schedule-type.enum.js +9 -0
- package/dist/types/enum/skip-reason.enum.d.ts +9 -0
- package/dist/types/enum/skip-reason.enum.js +13 -0
- package/dist/types/enum/training-program-status.enum.d.ts +6 -0
- package/dist/types/enum/training-program-status.enum.js +10 -0
- package/dist/types/enum/workout-group-type.enum.d.ts +5 -0
- package/dist/types/enum/workout-group-type.enum.js +9 -0
- package/dist/types/interface/api/index.d.ts +24 -0
- package/dist/types/interface/api/index.js +7 -0
- package/dist/types/interface/api/requests/exercise.public.request.d.ts +20 -0
- package/dist/types/interface/api/requests/exercise.public.request.js +2 -0
- package/dist/types/interface/api/requests/exercise.request.d.ts +61 -0
- package/dist/types/interface/api/requests/exercise.request.js +2 -0
- package/dist/types/interface/api/requests/training-program.request.d.ts +67 -0
- package/dist/types/interface/api/requests/training-program.request.js +2 -0
- package/dist/types/interface/api/requests/user.request.d.ts +4 -0
- package/dist/types/interface/api/requests/workout-session.request.d.ts +10 -58
- package/dist/types/interface/api/requests/workout-template.public.request.d.ts +5 -2
- package/dist/types/interface/api/requests/workout-template.request.d.ts +20 -23
- package/dist/types/interface/api/responses/analytics.public.response.d.ts +24 -0
- package/dist/types/interface/api/responses/analytics.public.response.js +2 -0
- package/dist/types/interface/api/responses/exercise.public.response.d.ts +7 -0
- package/dist/types/interface/api/responses/exercise.public.response.js +2 -0
- package/dist/types/interface/api/responses/exercise.response.d.ts +110 -0
- package/dist/types/interface/api/responses/exercise.response.js +2 -0
- package/dist/types/interface/api/responses/training-program.response.d.ts +46 -0
- package/dist/types/interface/api/responses/training-program.response.js +2 -0
- package/dist/types/interface/api/responses/user.response.d.ts +41 -1
- package/dist/types/interface/api/responses/workout-session.response.d.ts +4 -0
- package/dist/types/interface/api/responses/workout-template.response.d.ts +3 -3
- package/dist/types/interface/index.d.ts +6 -1
- package/dist/types/interface/index.js +6 -1
- package/dist/types/interface/models/exercise.model.d.ts +2 -1
- package/dist/types/interface/models/training-program-schedule.model.d.ts +18 -0
- package/dist/types/interface/models/training-program-schedule.model.js +2 -0
- package/dist/types/interface/models/training-program.model.d.ts +17 -0
- package/dist/types/interface/models/training-program.model.js +2 -0
- package/dist/types/interface/models/workout-exercise.model.d.ts +6 -9
- package/dist/types/interface/models/workout-group.model.d.ts +18 -0
- package/dist/types/interface/models/workout-group.model.js +2 -0
- package/dist/types/interface/models/workout-section.model.d.ts +13 -0
- package/dist/types/interface/models/workout-section.model.js +2 -0
- package/dist/types/interface/models/workout-session.model.d.ts +3 -6
- package/dist/types/interface/models/workout-template.model.d.ts +2 -2
- package/dist/types/interface/personal-record.interface.d.ts +29 -0
- package/dist/types/interface/personal-record.interface.js +2 -0
- package/dist/types/interface/template-snapshot.interface.d.ts +36 -0
- package/dist/types/interface/template-snapshot.interface.js +2 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/workout-template.utils.d.ts +51 -0
- package/dist/utils/workout-template.utils.js +318 -0
- package/package.json +47 -51
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { QueryPaginate } from '..';
|
|
2
|
+
import { ExerciseType } from '../../../enum/exercise-type.enum';
|
|
3
|
+
import { ExerciseMeasurementType } from '../../../enum/exercise-measurement-type.enum';
|
|
4
|
+
import { MuscleGroup } from '../../../enum/muscle-group.enum';
|
|
5
|
+
import { EquipmentType } from '../../../enum/equipment-type.enum';
|
|
6
|
+
export interface ICreateExerciseBody {
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string | null;
|
|
9
|
+
type: ExerciseType[];
|
|
10
|
+
measurementTypes: ExerciseMeasurementType[];
|
|
11
|
+
primaryMuscleGroups: MuscleGroup[];
|
|
12
|
+
secondaryMuscleGroups?: MuscleGroup[];
|
|
13
|
+
requiredEquipment?: EquipmentType | null;
|
|
14
|
+
videoUrl?: string | null;
|
|
15
|
+
imageUrl?: string | null;
|
|
16
|
+
instructions?: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface IGetExerciseParams {
|
|
19
|
+
exerciseId: string;
|
|
20
|
+
}
|
|
21
|
+
export type IPaginateExerciseQuery = QueryPaginate & {
|
|
22
|
+
name?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
global?: string;
|
|
25
|
+
type?: ExerciseType[];
|
|
26
|
+
muscleGroups?: MuscleGroup[];
|
|
27
|
+
primaryMuscleGroups?: MuscleGroup[];
|
|
28
|
+
secondaryMuscleGroups?: MuscleGroup[];
|
|
29
|
+
requiredEquipment?: EquipmentType[];
|
|
30
|
+
measurementTypes?: ExerciseMeasurementType[];
|
|
31
|
+
exerciseSource?: 'all' | 'predefined' | 'personal';
|
|
32
|
+
};
|
|
33
|
+
export interface IUpdateExerciseParams {
|
|
34
|
+
exerciseId: string;
|
|
35
|
+
}
|
|
36
|
+
export interface IUpdateExerciseBody {
|
|
37
|
+
name?: string;
|
|
38
|
+
description?: string | null;
|
|
39
|
+
type?: ExerciseType[];
|
|
40
|
+
measurementTypes?: ExerciseMeasurementType[];
|
|
41
|
+
primaryMuscleGroups?: MuscleGroup[];
|
|
42
|
+
secondaryMuscleGroups?: MuscleGroup[];
|
|
43
|
+
requiredEquipment?: EquipmentType | null;
|
|
44
|
+
videoUrl?: string | null;
|
|
45
|
+
imageUrl?: string | null;
|
|
46
|
+
instructions?: string | null;
|
|
47
|
+
}
|
|
48
|
+
export interface IDeleteExerciseParams {
|
|
49
|
+
exerciseId: string;
|
|
50
|
+
}
|
|
51
|
+
export interface IGetExerciseStatsParams {
|
|
52
|
+
exerciseId: string;
|
|
53
|
+
}
|
|
54
|
+
export interface IGetExerciseStatsQuery {
|
|
55
|
+
workoutTemplateId?: string;
|
|
56
|
+
workoutGroupId?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface IGetLastPerformedSetsQuery {
|
|
59
|
+
workoutTemplateId: string;
|
|
60
|
+
workoutGroupIds: string[];
|
|
61
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { QueryPaginate } from '..';
|
|
2
|
+
import { DayOfWeek } from '../../../enum/day-of-week.enum';
|
|
3
|
+
import { ScheduleType } from '../../../enum/schedule-type.enum';
|
|
4
|
+
import { TrainingProgramStatus } from '../../../enum/training-program-status.enum';
|
|
5
|
+
export interface ICreateTrainingProgramBody {
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string | null;
|
|
8
|
+
durationWeeks: number;
|
|
9
|
+
schedules?: ICreateTrainingProgramScheduleBody[];
|
|
10
|
+
}
|
|
11
|
+
export interface ICreateTrainingProgramScheduleBody {
|
|
12
|
+
workoutTemplateId: string;
|
|
13
|
+
scheduleType: ScheduleType;
|
|
14
|
+
dayOfWeek?: DayOfWeek | null;
|
|
15
|
+
cycleDay?: number | null;
|
|
16
|
+
monthDay?: number | null;
|
|
17
|
+
weekNumber?: number | null;
|
|
18
|
+
order?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface IGetTrainingProgramParams {
|
|
21
|
+
trainingProgramId: string;
|
|
22
|
+
}
|
|
23
|
+
export type IPaginateTrainingProgramQuery = QueryPaginate & {
|
|
24
|
+
name?: string;
|
|
25
|
+
status?: TrainingProgramStatus;
|
|
26
|
+
};
|
|
27
|
+
export interface IUpdateTrainingProgramParams {
|
|
28
|
+
trainingProgramId: string;
|
|
29
|
+
}
|
|
30
|
+
export interface IUpdateTrainingProgramBody {
|
|
31
|
+
name?: string;
|
|
32
|
+
description?: string | null;
|
|
33
|
+
durationWeeks?: number;
|
|
34
|
+
status?: TrainingProgramStatus;
|
|
35
|
+
schedules?: ICreateTrainingProgramScheduleBody[];
|
|
36
|
+
}
|
|
37
|
+
export interface IDeleteTrainingProgramParams {
|
|
38
|
+
trainingProgramId: string;
|
|
39
|
+
}
|
|
40
|
+
export interface IStartTrainingProgramParams {
|
|
41
|
+
trainingProgramId: string;
|
|
42
|
+
}
|
|
43
|
+
export interface IPauseTrainingProgramParams {
|
|
44
|
+
trainingProgramId: string;
|
|
45
|
+
}
|
|
46
|
+
export interface IResumeTrainingProgramParams {
|
|
47
|
+
trainingProgramId: string;
|
|
48
|
+
}
|
|
49
|
+
export interface ICompleteTrainingProgramParams {
|
|
50
|
+
trainingProgramId: string;
|
|
51
|
+
}
|
|
52
|
+
export interface IAddScheduleParams {
|
|
53
|
+
trainingProgramId: string;
|
|
54
|
+
}
|
|
55
|
+
export interface IAddScheduleBody {
|
|
56
|
+
workoutTemplateId: string;
|
|
57
|
+
scheduleType: ScheduleType;
|
|
58
|
+
dayOfWeek?: DayOfWeek | null;
|
|
59
|
+
cycleDay?: number | null;
|
|
60
|
+
monthDay?: number | null;
|
|
61
|
+
weekNumber?: number | null;
|
|
62
|
+
order?: number;
|
|
63
|
+
}
|
|
64
|
+
export interface IRemoveScheduleParams {
|
|
65
|
+
trainingProgramId: string;
|
|
66
|
+
scheduleId: string;
|
|
67
|
+
}
|
|
@@ -1,74 +1,26 @@
|
|
|
1
1
|
import { QueryPaginate } from '..';
|
|
2
|
-
import {
|
|
2
|
+
import { IWorkoutSessionSet } from '../../template-snapshot.interface';
|
|
3
3
|
export interface ICreateWorkoutSessionBody {
|
|
4
|
-
workoutTemplateId
|
|
5
|
-
name: string;
|
|
6
|
-
status?: WorkoutSessionStatus;
|
|
7
|
-
scheduledAt?: Date | null;
|
|
8
|
-
notes?: string | null;
|
|
9
|
-
exerciseSets?: ICreateWorkoutSessionExerciseSetBody[];
|
|
10
|
-
}
|
|
11
|
-
export interface ICreateWorkoutSessionExerciseSetBody {
|
|
12
|
-
exerciseId: string;
|
|
13
|
-
setNumber: number;
|
|
14
|
-
reps?: number | null;
|
|
15
|
-
weight?: number | null;
|
|
16
|
-
duration?: number | null;
|
|
17
|
-
distance?: number | null;
|
|
18
|
-
restTime?: number | null;
|
|
19
|
-
rpe?: number | null;
|
|
20
|
-
feeling?: string | null;
|
|
21
|
-
isSkipped?: boolean;
|
|
22
|
-
skipReason?: string | null;
|
|
23
|
-
isWarmup?: boolean;
|
|
24
|
-
isDropSet?: boolean;
|
|
25
|
-
isFailure?: boolean;
|
|
26
|
-
completedAt?: Date | null;
|
|
4
|
+
workoutTemplateId: string;
|
|
27
5
|
notes?: string | null;
|
|
6
|
+
exerciseSets: IWorkoutSessionSet[];
|
|
7
|
+
startedAt?: Date;
|
|
8
|
+
completedAt?: Date;
|
|
9
|
+
duration?: number;
|
|
28
10
|
}
|
|
29
11
|
export interface IGetWorkoutSessionParams {
|
|
30
12
|
workoutSessionId: string;
|
|
31
13
|
}
|
|
32
14
|
export type IPaginateWorkoutSessionQuery = QueryPaginate & {
|
|
33
15
|
workoutTemplateId?: string;
|
|
34
|
-
status?: WorkoutSessionStatus;
|
|
35
|
-
startDate?: Date;
|
|
36
|
-
endDate?: Date;
|
|
37
|
-
};
|
|
38
|
-
export interface IGetUserWorkoutSessionParams {
|
|
39
|
-
userId: string;
|
|
40
|
-
}
|
|
41
|
-
export type IGetUserWorkoutSessionQuery = QueryPaginate & {
|
|
42
|
-
workoutTemplateId?: string;
|
|
43
|
-
status?: WorkoutSessionStatus;
|
|
44
16
|
startDate?: Date;
|
|
45
17
|
endDate?: Date;
|
|
18
|
+
search?: string;
|
|
46
19
|
};
|
|
47
|
-
export interface IUpdateWorkoutSessionParams {
|
|
48
|
-
workoutSessionId: string;
|
|
49
|
-
}
|
|
50
|
-
export interface IUpdateWorkoutSessionBody {
|
|
51
|
-
workoutTemplateId?: string | null;
|
|
52
|
-
name?: string;
|
|
53
|
-
status?: WorkoutSessionStatus;
|
|
54
|
-
scheduledAt?: Date | null;
|
|
55
|
-
startedAt?: Date | null;
|
|
56
|
-
completedAt?: Date | null;
|
|
57
|
-
duration?: number | null;
|
|
58
|
-
notes?: string | null;
|
|
59
|
-
exerciseSets?: ICreateWorkoutSessionExerciseSetBody[];
|
|
60
|
-
}
|
|
61
20
|
export interface IDeleteWorkoutSessionParams {
|
|
62
21
|
workoutSessionId: string;
|
|
63
22
|
}
|
|
64
|
-
export interface
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export interface ICompleteWorkoutSessionParams {
|
|
68
|
-
workoutSessionId: string;
|
|
69
|
-
}
|
|
70
|
-
export interface ICompleteWorkoutSessionBody {
|
|
71
|
-
duration?: number | null;
|
|
72
|
-
notes?: string | null;
|
|
73
|
-
rating?: number | null;
|
|
23
|
+
export interface IGetSessionsByDateRangeQuery {
|
|
24
|
+
startDate: string;
|
|
25
|
+
endDate: string;
|
|
74
26
|
}
|
|
@@ -2,9 +2,9 @@ import { QueryPaginate } from '..';
|
|
|
2
2
|
import { MuscleGroup } from '../../../enum/muscle-group.enum';
|
|
3
3
|
import { ExerciseType } from '../../../enum/exercise-type.enum';
|
|
4
4
|
import { EquipmentType } from '../../../enum/equipment-type.enum';
|
|
5
|
-
export
|
|
5
|
+
export type IGetWorkoutTemplatePublicParams = {
|
|
6
6
|
workoutTemplateId: string;
|
|
7
|
-
}
|
|
7
|
+
};
|
|
8
8
|
export type IPaginateWorkoutTemplatePublicQuery = QueryPaginate & {
|
|
9
9
|
name?: string;
|
|
10
10
|
durationMin?: number;
|
|
@@ -12,4 +12,7 @@ export type IPaginateWorkoutTemplatePublicQuery = QueryPaginate & {
|
|
|
12
12
|
muscleGroups?: MuscleGroup[];
|
|
13
13
|
exerciseTypes?: ExerciseType[];
|
|
14
14
|
equipmentTypes?: EquipmentType[];
|
|
15
|
+
userId?: string | null;
|
|
16
|
+
userFilter?: 'default' | 'community';
|
|
17
|
+
exerciseId?: string[];
|
|
15
18
|
};
|
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
import { QueryPaginate } from '..';
|
|
2
|
-
import { ExerciseGroupType } from '../../../enum/exercise-group-type.enum';
|
|
3
2
|
import { MuscleGroup } from '../../../enum/muscle-group.enum';
|
|
4
3
|
import { ExerciseType } from '../../../enum/exercise-type.enum';
|
|
5
4
|
import { EquipmentType } from '../../../enum/equipment-type.enum';
|
|
5
|
+
import { WorkoutGroupType } from '../../../enum/workout-group-type.enum';
|
|
6
6
|
export interface ICreateWorkoutTemplateBody {
|
|
7
7
|
name: string;
|
|
8
8
|
description?: string | null;
|
|
9
9
|
isPublic: boolean;
|
|
10
|
-
|
|
10
|
+
sections?: ICreateWorkoutTemplateSectionBody[];
|
|
11
|
+
}
|
|
12
|
+
export interface ICreateWorkoutTemplateSectionBody {
|
|
13
|
+
name: string;
|
|
14
|
+
description?: string | null;
|
|
15
|
+
groups?: ICreateWorkoutTemplateGroupBody[];
|
|
16
|
+
}
|
|
17
|
+
export interface ICreateWorkoutTemplateGroupBody {
|
|
18
|
+
name?: string | null;
|
|
19
|
+
plannedSets: number;
|
|
20
|
+
plannedRestTime?: number | null;
|
|
21
|
+
type?: WorkoutGroupType;
|
|
22
|
+
timeCap?: number | null;
|
|
23
|
+
intervalSeconds?: number | null;
|
|
11
24
|
exercises: ICreateWorkoutTemplateExerciseBody[];
|
|
12
25
|
}
|
|
13
26
|
export interface ICreateWorkoutTemplateExerciseBody {
|
|
14
27
|
exerciseId: string;
|
|
15
|
-
order: number;
|
|
16
|
-
groupType?: ExerciseGroupType;
|
|
17
|
-
groupId?: string | null;
|
|
18
|
-
groupOrder?: number | null;
|
|
19
|
-
plannedSets?: number | null;
|
|
20
28
|
plannedReps?: number | null;
|
|
21
29
|
plannedWeight?: number | null;
|
|
30
|
+
plannedDuration?: number | null;
|
|
31
|
+
plannedDistance?: number | null;
|
|
32
|
+
plannedCalories?: number | null;
|
|
22
33
|
plannedRestTime?: number | null;
|
|
23
34
|
notes?: string | null;
|
|
24
35
|
}
|
|
@@ -27,25 +38,12 @@ export interface IGetWorkoutTemplateParams {
|
|
|
27
38
|
}
|
|
28
39
|
export type IPaginateWorkoutTemplateQuery = QueryPaginate & {
|
|
29
40
|
name?: string;
|
|
30
|
-
userId?: string;
|
|
31
|
-
isPublic?: boolean;
|
|
32
|
-
durationMin?: number;
|
|
33
|
-
durationMax?: number;
|
|
34
|
-
muscleGroups?: MuscleGroup[];
|
|
35
|
-
exerciseTypes?: ExerciseType[];
|
|
36
|
-
equipmentTypes?: EquipmentType[];
|
|
37
|
-
};
|
|
38
|
-
export interface IGetUserWorkoutTemplateParams {
|
|
39
|
-
userId: string;
|
|
40
|
-
}
|
|
41
|
-
export type IGetUserWorkoutTemplateQuery = QueryPaginate & {
|
|
42
|
-
name?: string;
|
|
43
|
-
isPublic?: boolean;
|
|
44
41
|
durationMin?: number;
|
|
45
42
|
durationMax?: number;
|
|
46
43
|
muscleGroups?: MuscleGroup[];
|
|
47
44
|
exerciseTypes?: ExerciseType[];
|
|
48
45
|
equipmentTypes?: EquipmentType[];
|
|
46
|
+
exerciseId?: string[];
|
|
49
47
|
};
|
|
50
48
|
export interface IUpdateWorkoutTemplateParams {
|
|
51
49
|
workoutTemplateId: string;
|
|
@@ -54,8 +52,7 @@ export interface IUpdateWorkoutTemplateBody {
|
|
|
54
52
|
name?: string;
|
|
55
53
|
description?: string | null;
|
|
56
54
|
isPublic?: boolean;
|
|
57
|
-
|
|
58
|
-
exercises?: ICreateWorkoutTemplateExerciseBody[];
|
|
55
|
+
sections?: ICreateWorkoutTemplateSectionBody[];
|
|
59
56
|
}
|
|
60
57
|
export interface IDeleteWorkoutTemplateParams {
|
|
61
58
|
workoutTemplateId: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IResponse } from '..';
|
|
2
|
+
export interface IPublicAnalytics {
|
|
3
|
+
exercises: {
|
|
4
|
+
total: number;
|
|
5
|
+
};
|
|
6
|
+
workoutTemplates: {
|
|
7
|
+
totalPublic: number;
|
|
8
|
+
};
|
|
9
|
+
sessions: {
|
|
10
|
+
total: number;
|
|
11
|
+
last24h: number;
|
|
12
|
+
last7d: number;
|
|
13
|
+
last30d: number;
|
|
14
|
+
totalDurationMinutes: number;
|
|
15
|
+
};
|
|
16
|
+
users: {
|
|
17
|
+
total: number;
|
|
18
|
+
activeLast7d: number;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface IGetPublicAnalyticsData {
|
|
22
|
+
analytics: IPublicAnalytics;
|
|
23
|
+
}
|
|
24
|
+
export type IGetPublicAnalyticsResponse = IResponse<IGetPublicAnalyticsData>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IResponse, BasePaginate, IExerciseWithMetrics } from '..';
|
|
2
|
+
import { IExercise } from '../../models/exercise.model';
|
|
3
|
+
export interface IGetExercisePublicData {
|
|
4
|
+
exercise: IExercise;
|
|
5
|
+
}
|
|
6
|
+
export type IGetExercisePublicResponse = IResponse<IGetExercisePublicData>;
|
|
7
|
+
export type IPaginateExercisePublicResponse = IResponse<BasePaginate<IExerciseWithMetrics>>;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { IResponse, BasePaginate, IExerciseWithMetrics } from '..';
|
|
2
|
+
import { IExercise } from '../../models/exercise.model';
|
|
3
|
+
export interface ICreateExerciseData {
|
|
4
|
+
exercise: IExercise;
|
|
5
|
+
}
|
|
6
|
+
export type ICreateExerciseResponse = IResponse<ICreateExerciseData>;
|
|
7
|
+
export interface IGetExerciseData {
|
|
8
|
+
exercise: IExercise;
|
|
9
|
+
}
|
|
10
|
+
export type IGetExerciseResponse = IResponse<IGetExerciseData>;
|
|
11
|
+
export type IPaginateExerciseResponse = IResponse<BasePaginate<IExerciseWithMetrics>>;
|
|
12
|
+
export interface IUpdateExerciseData {
|
|
13
|
+
exercise: IExercise;
|
|
14
|
+
}
|
|
15
|
+
export type IUpdateExerciseResponse = IResponse<IUpdateExerciseData>;
|
|
16
|
+
export interface IDeleteExerciseData {
|
|
17
|
+
}
|
|
18
|
+
export type IDeleteExerciseResponse = IResponse<IDeleteExerciseData>;
|
|
19
|
+
export interface ExercisePerformanceDataPoint {
|
|
20
|
+
date: string;
|
|
21
|
+
weight: number | null;
|
|
22
|
+
reps: number | null;
|
|
23
|
+
duration: number | null;
|
|
24
|
+
distance: number | null;
|
|
25
|
+
calories: number | null;
|
|
26
|
+
volume: number;
|
|
27
|
+
templateId?: string | null;
|
|
28
|
+
}
|
|
29
|
+
export interface ExercisePerformanceRecord {
|
|
30
|
+
id: string;
|
|
31
|
+
date: string;
|
|
32
|
+
templateId?: string | null;
|
|
33
|
+
templateName: string;
|
|
34
|
+
phaseName: string | null;
|
|
35
|
+
groupName: string | null;
|
|
36
|
+
sets: Array<{
|
|
37
|
+
setNumber: number;
|
|
38
|
+
weight: number | null;
|
|
39
|
+
reps: number | null;
|
|
40
|
+
duration: number | null;
|
|
41
|
+
distance: number | null;
|
|
42
|
+
calories: number | null;
|
|
43
|
+
notes: string | null;
|
|
44
|
+
isSkipped: boolean;
|
|
45
|
+
}>;
|
|
46
|
+
}
|
|
47
|
+
export interface ExercisePerformanceStats {
|
|
48
|
+
firstPerformed: string | null;
|
|
49
|
+
lastPerformed: string | null;
|
|
50
|
+
totalSessions: number;
|
|
51
|
+
totalSets: number;
|
|
52
|
+
totalVolume: number;
|
|
53
|
+
bestWeight: number | null;
|
|
54
|
+
bestReps: number | null;
|
|
55
|
+
lastWeight: number | null;
|
|
56
|
+
lastReps: number | null;
|
|
57
|
+
averageWeight: number | null;
|
|
58
|
+
bestDuration: number | null;
|
|
59
|
+
lastDuration: number | null;
|
|
60
|
+
averageDuration: number | null;
|
|
61
|
+
bestDistance: number | null;
|
|
62
|
+
lastDistance: number | null;
|
|
63
|
+
averageDistance: number | null;
|
|
64
|
+
bestCalories: number | null;
|
|
65
|
+
lastCalories: number | null;
|
|
66
|
+
averageCalories: number | null;
|
|
67
|
+
performanceHistory: ExercisePerformanceDataPoint[];
|
|
68
|
+
}
|
|
69
|
+
export interface IGetExerciseStatsData {
|
|
70
|
+
stats: ExercisePerformanceStats;
|
|
71
|
+
}
|
|
72
|
+
export type IGetExerciseStatsResponse = IResponse<IGetExerciseStatsData>;
|
|
73
|
+
export interface IPaginateExerciseHistoryParams {
|
|
74
|
+
exerciseId: string;
|
|
75
|
+
}
|
|
76
|
+
export interface IPaginateExerciseHistoryQuery {
|
|
77
|
+
page?: number;
|
|
78
|
+
limit?: number;
|
|
79
|
+
workoutTemplateId?: string;
|
|
80
|
+
workoutGroupId?: string;
|
|
81
|
+
}
|
|
82
|
+
export interface IPaginateExerciseHistoryData {
|
|
83
|
+
data: ExercisePerformanceRecord[];
|
|
84
|
+
total: number;
|
|
85
|
+
page: number;
|
|
86
|
+
limit: number;
|
|
87
|
+
totalPages: number;
|
|
88
|
+
}
|
|
89
|
+
export type IPaginateExerciseHistoryResponse = IResponse<IPaginateExerciseHistoryData>;
|
|
90
|
+
export interface LastPerformedSet {
|
|
91
|
+
exerciseId: string;
|
|
92
|
+
workoutExerciseId: string;
|
|
93
|
+
sets: Array<{
|
|
94
|
+
setNumber: number;
|
|
95
|
+
reps: number | null;
|
|
96
|
+
weight: number | null;
|
|
97
|
+
duration: number | null;
|
|
98
|
+
distance: number | null;
|
|
99
|
+
calories: number | null;
|
|
100
|
+
}>;
|
|
101
|
+
}
|
|
102
|
+
export interface WorkoutGroupLastSession {
|
|
103
|
+
workoutGroupId: string;
|
|
104
|
+
sessionDate: string | null;
|
|
105
|
+
exercises: LastPerformedSet[];
|
|
106
|
+
}
|
|
107
|
+
export interface IGetLastPerformedSetsData {
|
|
108
|
+
groups: WorkoutGroupLastSession[];
|
|
109
|
+
}
|
|
110
|
+
export type IGetLastPerformedSetsResponse = IResponse<IGetLastPerformedSetsData>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { IResponse, BasePaginate } from '..';
|
|
2
|
+
import { ITrainingProgram } from '../../models/training-program.model';
|
|
3
|
+
import { ITrainingProgramSchedule } from '../../models/training-program-schedule.model';
|
|
4
|
+
export interface ICreateTrainingProgramData {
|
|
5
|
+
trainingProgram: ITrainingProgram;
|
|
6
|
+
}
|
|
7
|
+
export type ICreateTrainingProgramResponse = IResponse<ICreateTrainingProgramData>;
|
|
8
|
+
export interface IGetTrainingProgramData {
|
|
9
|
+
trainingProgram: ITrainingProgram;
|
|
10
|
+
}
|
|
11
|
+
export type IGetTrainingProgramResponse = IResponse<IGetTrainingProgramData>;
|
|
12
|
+
export type IPaginateTrainingProgramResponse = IResponse<BasePaginate<ITrainingProgram>>;
|
|
13
|
+
export interface IUpdateTrainingProgramData {
|
|
14
|
+
trainingProgram: ITrainingProgram;
|
|
15
|
+
}
|
|
16
|
+
export type IUpdateTrainingProgramResponse = IResponse<IUpdateTrainingProgramData>;
|
|
17
|
+
export interface IDeleteTrainingProgramData {
|
|
18
|
+
}
|
|
19
|
+
export type IDeleteTrainingProgramResponse = IResponse<IDeleteTrainingProgramData>;
|
|
20
|
+
export interface IStartTrainingProgramData {
|
|
21
|
+
trainingProgram: ITrainingProgram;
|
|
22
|
+
}
|
|
23
|
+
export type IStartTrainingProgramResponse = IResponse<IStartTrainingProgramData>;
|
|
24
|
+
export interface IPauseTrainingProgramData {
|
|
25
|
+
trainingProgram: ITrainingProgram;
|
|
26
|
+
}
|
|
27
|
+
export type IPauseTrainingProgramResponse = IResponse<IPauseTrainingProgramData>;
|
|
28
|
+
export interface IResumeTrainingProgramData {
|
|
29
|
+
trainingProgram: ITrainingProgram;
|
|
30
|
+
}
|
|
31
|
+
export type IResumeTrainingProgramResponse = IResponse<IResumeTrainingProgramData>;
|
|
32
|
+
export interface ICompleteTrainingProgramData {
|
|
33
|
+
trainingProgram: ITrainingProgram;
|
|
34
|
+
}
|
|
35
|
+
export type ICompleteTrainingProgramResponse = IResponse<ICompleteTrainingProgramData>;
|
|
36
|
+
export interface IAddScheduleData {
|
|
37
|
+
schedule: ITrainingProgramSchedule;
|
|
38
|
+
}
|
|
39
|
+
export type IAddScheduleResponse = IResponse<IAddScheduleData>;
|
|
40
|
+
export interface IRemoveScheduleData {
|
|
41
|
+
}
|
|
42
|
+
export type IRemoveScheduleResponse = IResponse<IRemoveScheduleData>;
|
|
43
|
+
export interface IGetTodayWorkoutsData {
|
|
44
|
+
schedules: ITrainingProgramSchedule[];
|
|
45
|
+
}
|
|
46
|
+
export type IGetTodayWorkoutsResponse = IResponse<IGetTodayWorkoutsData>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { IResponse, IUser } from '../..';
|
|
1
|
+
import { IResponse, IUser, IWorkoutSession, IWorkoutTemplate } from '../..';
|
|
2
|
+
import { UserPersonalRecords } from '../../personal-record.interface';
|
|
2
3
|
export interface IMeUserData {
|
|
3
4
|
user: IUser;
|
|
4
5
|
}
|
|
@@ -11,3 +12,42 @@ export interface IUpdateUserData {
|
|
|
11
12
|
user: IUser;
|
|
12
13
|
}
|
|
13
14
|
export type IUpdateUserResponse = IResponse<IUpdateUserData>;
|
|
15
|
+
export interface IDayTemplateCompletion {
|
|
16
|
+
date: string;
|
|
17
|
+
sessions: IWorkoutSession[];
|
|
18
|
+
}
|
|
19
|
+
export interface IPeriodStats {
|
|
20
|
+
sessions: number;
|
|
21
|
+
trainingTime: number;
|
|
22
|
+
weight: number;
|
|
23
|
+
distance: number;
|
|
24
|
+
calories: number;
|
|
25
|
+
}
|
|
26
|
+
export interface IUserMetrics {
|
|
27
|
+
totalSessions: number;
|
|
28
|
+
completedSessions: number;
|
|
29
|
+
totalTrainingTime: number;
|
|
30
|
+
totalWeight: number;
|
|
31
|
+
totalDistance: number;
|
|
32
|
+
totalCalories: number;
|
|
33
|
+
currentStreak: number;
|
|
34
|
+
lastSession: IWorkoutSession | null;
|
|
35
|
+
lastTemplateCompleted: IWorkoutTemplate | null;
|
|
36
|
+
last30Days: IDayTemplateCompletion[];
|
|
37
|
+
last30DaysStats: IPeriodStats;
|
|
38
|
+
previous30DaysStats: IPeriodStats;
|
|
39
|
+
scores: {
|
|
40
|
+
overallScore: number;
|
|
41
|
+
regularityScore: number;
|
|
42
|
+
completionScore: number;
|
|
43
|
+
progressScore: number;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface IUserMetricsData {
|
|
47
|
+
metrics: IUserMetrics;
|
|
48
|
+
}
|
|
49
|
+
export type IUserMetricsResponse = IResponse<IUserMetricsData>;
|
|
50
|
+
export interface IUserPersonalRecordsData {
|
|
51
|
+
personalRecords: UserPersonalRecords;
|
|
52
|
+
}
|
|
53
|
+
export type IUserPersonalRecordsResponse = IResponse<IUserPersonalRecordsData>;
|
|
@@ -24,3 +24,7 @@ export interface ICompleteWorkoutSessionData {
|
|
|
24
24
|
workoutSession: IWorkoutSession;
|
|
25
25
|
}
|
|
26
26
|
export type ICompleteWorkoutSessionResponse = IResponse<ICompleteWorkoutSessionData>;
|
|
27
|
+
export interface IGetSessionsByDateRangeData {
|
|
28
|
+
sessions: IWorkoutSession[];
|
|
29
|
+
}
|
|
30
|
+
export type IGetSessionsByDateRangeResponse = IResponse<IGetSessionsByDateRangeData>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { IResponse, BasePaginate } from '..';
|
|
1
|
+
import { IResponse, BasePaginate, IWorkoutTemplateWithMetrics } from '..';
|
|
2
2
|
import { IWorkoutTemplate } from '../../models/workout-template.model';
|
|
3
3
|
export interface ICreateWorkoutTemplateData {
|
|
4
4
|
workoutTemplate: IWorkoutTemplate;
|
|
5
5
|
}
|
|
6
6
|
export type ICreateWorkoutTemplateResponse = IResponse<ICreateWorkoutTemplateData>;
|
|
7
7
|
export interface IGetWorkoutTemplateData {
|
|
8
|
-
workoutTemplate:
|
|
8
|
+
workoutTemplate: IWorkoutTemplateWithMetrics;
|
|
9
9
|
}
|
|
10
10
|
export type IGetWorkoutTemplateResponse = IResponse<IGetWorkoutTemplateData>;
|
|
11
|
-
export type IPaginateWorkoutTemplateResponse = IResponse<BasePaginate<
|
|
11
|
+
export type IPaginateWorkoutTemplateResponse = IResponse<BasePaginate<IWorkoutTemplateWithMetrics>>;
|
|
12
12
|
export interface IUpdateWorkoutTemplateData {
|
|
13
13
|
workoutTemplate: IWorkoutTemplate;
|
|
14
14
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
export * from './models/user.model';
|
|
2
2
|
export * from './models/exercise.model';
|
|
3
3
|
export * from './models/workout-template.model';
|
|
4
|
+
export * from './models/workout-section.model';
|
|
5
|
+
export * from './models/workout-group.model';
|
|
4
6
|
export * from './models/workout-exercise.model';
|
|
5
7
|
export * from './models/workout-session.model';
|
|
6
|
-
export * from './models/
|
|
8
|
+
export * from './models/training-program.model';
|
|
9
|
+
export * from './models/training-program-schedule.model';
|
|
10
|
+
export * from './template-snapshot.interface';
|
|
11
|
+
export * from './personal-record.interface';
|
|
7
12
|
export * from './api';
|
|
@@ -17,7 +17,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./models/user.model"), exports);
|
|
18
18
|
__exportStar(require("./models/exercise.model"), exports);
|
|
19
19
|
__exportStar(require("./models/workout-template.model"), exports);
|
|
20
|
+
__exportStar(require("./models/workout-section.model"), exports);
|
|
21
|
+
__exportStar(require("./models/workout-group.model"), exports);
|
|
20
22
|
__exportStar(require("./models/workout-exercise.model"), exports);
|
|
21
23
|
__exportStar(require("./models/workout-session.model"), exports);
|
|
22
|
-
__exportStar(require("./models/
|
|
24
|
+
__exportStar(require("./models/training-program.model"), exports);
|
|
25
|
+
__exportStar(require("./models/training-program-schedule.model"), exports);
|
|
26
|
+
__exportStar(require("./template-snapshot.interface"), exports);
|
|
27
|
+
__exportStar(require("./personal-record.interface"), exports);
|
|
23
28
|
__exportStar(require("./api"), exports);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ExerciseType } from '../../enum/exercise-type.enum';
|
|
2
|
+
import { ExerciseMeasurementType } from '../../enum/exercise-measurement-type.enum';
|
|
2
3
|
import { MuscleGroup } from '../../enum/muscle-group.enum';
|
|
3
4
|
import { EquipmentType } from '../../enum/equipment-type.enum';
|
|
4
5
|
import { IUser } from './user.model';
|
|
@@ -8,6 +9,7 @@ export interface IExercise {
|
|
|
8
9
|
name: string;
|
|
9
10
|
description: string | null;
|
|
10
11
|
type: ExerciseType[];
|
|
12
|
+
measurementTypes: ExerciseMeasurementType[];
|
|
11
13
|
primaryMuscleGroups: MuscleGroup[];
|
|
12
14
|
secondaryMuscleGroups: MuscleGroup[];
|
|
13
15
|
requiredEquipment: EquipmentType | null;
|
|
@@ -15,7 +17,6 @@ export interface IExercise {
|
|
|
15
17
|
imageUrl: string | null;
|
|
16
18
|
instructions: string | null;
|
|
17
19
|
userId: string | null;
|
|
18
|
-
isPublic: boolean;
|
|
19
20
|
createdAt?: Date;
|
|
20
21
|
updatedAt?: Date;
|
|
21
22
|
user?: IUser;
|