@dgpholdings/greatoak-shared 1.1.44 → 1.1.46
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/typeGuards/index.d.ts +1 -1
- package/dist/types/TApiExercise.d.ts +1 -1
- package/dist/types/TApiExerciseRecord.d.ts +3 -53
- package/dist/types/TApiTemplateData.d.ts +16 -7
- package/dist/types/TApiTemplateShop.d.ts +74 -0
- package/dist/types/TApiTemplateShop.js +2 -0
- package/dist/types/commonTypes.d.ts +54 -0
- package/dist/types/commonTypes.js +2 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TRecord,
|
|
1
|
+
import { TRecord, TRecordWeight, TRecordDuration, TRecordBodyWeight, TRecordDistance } from "../types";
|
|
2
2
|
export declare const isRecordWeightTypeGuard: (param: TRecord[]) => param is TRecordWeight[];
|
|
3
3
|
export declare const isRecordDurationTypeGuard: (param: TRecord[]) => param is TRecordDuration[];
|
|
4
4
|
export declare const isRecordBodyWeightTypeGuard: (param: TRecord[]) => param is TRecordBodyWeight[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TRecord } from "./
|
|
1
|
+
import { TRecord } from "./commonTypes";
|
|
2
2
|
export type TBodyPart = "Chest" | "Core" | "Shoulders" | "Back" | "Biceps" | "Triceps" | "Forearms" | "Legs";
|
|
3
3
|
export declare enum EBodyParts {
|
|
4
4
|
"pectoralis-major" = "Pectoralis major upper",
|
|
@@ -1,60 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
isDone: boolean;
|
|
3
|
-
rpe?: string;
|
|
4
|
-
setNote?: string;
|
|
5
|
-
workDurationSecs?: number;
|
|
6
|
-
restDurationSecs?: number;
|
|
7
|
-
isStrictMode: boolean;
|
|
8
|
-
} & ({
|
|
9
|
-
type: "weight-reps";
|
|
10
|
-
kg: string;
|
|
11
|
-
reps: string;
|
|
12
|
-
rir?: string;
|
|
13
|
-
} | {
|
|
14
|
-
type: "duration";
|
|
15
|
-
durationSecs: string;
|
|
16
|
-
auxWeightKg: string;
|
|
17
|
-
} | {
|
|
18
|
-
type: "reps-only";
|
|
19
|
-
reps: string;
|
|
20
|
-
auxWeightKg: string;
|
|
21
|
-
rir?: string;
|
|
22
|
-
} | {
|
|
23
|
-
type: "distance";
|
|
24
|
-
distanceKm: string;
|
|
25
|
-
auxWeightKg: string;
|
|
26
|
-
durationSecs: string;
|
|
27
|
-
});
|
|
28
|
-
export type TRecordDuration = Extract<TRecord, {
|
|
29
|
-
type: "duration";
|
|
30
|
-
}>;
|
|
31
|
-
export type TRecordWeight = Extract<TRecord, {
|
|
32
|
-
type: "weight-reps";
|
|
33
|
-
}>;
|
|
34
|
-
export type TRecordBodyWeight = Extract<TRecord, {
|
|
35
|
-
type: "reps-only";
|
|
36
|
-
}>;
|
|
37
|
-
export type TRecordDistance = Extract<TRecord, {
|
|
38
|
-
type: "distance";
|
|
39
|
-
}>;
|
|
40
|
-
export type TRecordConfig = {
|
|
41
|
-
enableAuxWeight?: boolean;
|
|
42
|
-
enableRir?: boolean;
|
|
43
|
-
enableRpe?: boolean;
|
|
44
|
-
enableSetNote?: boolean;
|
|
45
|
-
enableExerciseNote?: boolean;
|
|
46
|
-
enableTimeIntervalMode?: boolean;
|
|
47
|
-
};
|
|
1
|
+
import { TRecord, TTemplateExercise } from "./commonTypes";
|
|
48
2
|
export type TApiExerciseRecordUpdateReq = {
|
|
49
3
|
templateId: string;
|
|
50
4
|
startTime: Date;
|
|
51
|
-
records: {
|
|
52
|
-
exerciseId: string;
|
|
53
|
-
config: TRecordConfig;
|
|
54
|
-
exerciseNote: string;
|
|
55
|
-
restTimeSecs?: number;
|
|
5
|
+
records: (Omit<TTemplateExercise, "initialRecords"> & {
|
|
56
6
|
record: TRecord[];
|
|
57
|
-
}[];
|
|
7
|
+
})[];
|
|
58
8
|
};
|
|
59
9
|
export type TApiExerciseRecordUpdateRes = {
|
|
60
10
|
status: 201;
|
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { TRecord, TTemplateExercise } from "./commonTypes";
|
|
2
|
+
export type TTemplateDb = TTemplate & {
|
|
3
|
+
programId: string;
|
|
4
|
+
slug: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
createAt: Date;
|
|
7
|
+
updatedAt: Date;
|
|
8
|
+
};
|
|
3
9
|
export type TTemplate = {
|
|
4
10
|
name: string;
|
|
5
11
|
templateId: string;
|
|
6
|
-
exerciseIds: string[];
|
|
7
12
|
lastUsed?: Date[];
|
|
8
13
|
createdAt?: string;
|
|
9
14
|
colorHex?: string;
|
|
15
|
+
type: "system-cloned" | "regular";
|
|
16
|
+
exercises: TTemplateExercise[];
|
|
10
17
|
config: {
|
|
11
18
|
isEnabledStrictDurationTrackingMode: boolean;
|
|
12
19
|
};
|
|
13
20
|
};
|
|
14
|
-
export type TTemplateExercise = {
|
|
15
|
-
template: TTemplate;
|
|
16
|
-
exercise: TExercise[];
|
|
17
|
-
};
|
|
18
21
|
export type TApiTemplateCreateReq = {
|
|
19
22
|
name: string;
|
|
20
23
|
programId: string | null;
|
|
24
|
+
colorHex?: string;
|
|
25
|
+
config: TTemplate["config"];
|
|
21
26
|
};
|
|
22
27
|
export type TApiTemplateCreateRes = {
|
|
23
28
|
status: number;
|
|
@@ -30,10 +35,14 @@ export type TApiTemplateUpdateReq = {
|
|
|
30
35
|
} & ({
|
|
31
36
|
name: string;
|
|
32
37
|
exerciseIds: string[];
|
|
38
|
+
config: TTemplate["config"];
|
|
39
|
+
colorHex?: string;
|
|
33
40
|
isDelete?: never | undefined;
|
|
34
41
|
} | {
|
|
35
42
|
isDelete: true;
|
|
43
|
+
config?: never | undefined;
|
|
36
44
|
name?: never | undefined;
|
|
45
|
+
colorHex?: never | undefined;
|
|
37
46
|
exerciseIds?: never | undefined;
|
|
38
47
|
});
|
|
39
48
|
export type TApiTemplateUpdateRes = {
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { TTemplateExercise } from "./commonTypes";
|
|
2
|
+
export type TTemplateShopDb = {
|
|
3
|
+
name: {
|
|
4
|
+
default: string;
|
|
5
|
+
en?: string;
|
|
6
|
+
de?: string;
|
|
7
|
+
ru?: string;
|
|
8
|
+
es?: string;
|
|
9
|
+
fr?: string;
|
|
10
|
+
};
|
|
11
|
+
description: {
|
|
12
|
+
default: string;
|
|
13
|
+
en?: string;
|
|
14
|
+
de?: string;
|
|
15
|
+
ru?: string;
|
|
16
|
+
es?: string;
|
|
17
|
+
fr?: string;
|
|
18
|
+
};
|
|
19
|
+
tags: string[];
|
|
20
|
+
slug: string;
|
|
21
|
+
level: "beginner" | "intermediate" | "advanced" | "beginner-intermediate" | "intermediate-advanced" | "all";
|
|
22
|
+
estimatedDuration: number;
|
|
23
|
+
exercises: TTemplateExercise[];
|
|
24
|
+
createdAt?: Date;
|
|
25
|
+
updatedAt?: Date;
|
|
26
|
+
} & ({
|
|
27
|
+
type: "system";
|
|
28
|
+
thumbnailImageUrl: string;
|
|
29
|
+
isPremium: boolean;
|
|
30
|
+
} | {
|
|
31
|
+
type: "customer-created";
|
|
32
|
+
ownerId: string;
|
|
33
|
+
});
|
|
34
|
+
export type TApiTemplateShopCreateReq = TTemplateShopDb;
|
|
35
|
+
export type TApiTemplateShopCreateRes = {
|
|
36
|
+
status: 400;
|
|
37
|
+
state: "failed";
|
|
38
|
+
message: string;
|
|
39
|
+
} | (TTemplateShopDb & {
|
|
40
|
+
status: 201;
|
|
41
|
+
state: "success";
|
|
42
|
+
});
|
|
43
|
+
export type TApiTemplateShopUpdateReq = {
|
|
44
|
+
_id: string;
|
|
45
|
+
} & TTemplateShopDb;
|
|
46
|
+
export type TApiTemplateShopUpdateRes = {
|
|
47
|
+
status: 400;
|
|
48
|
+
state: "failed";
|
|
49
|
+
message: string;
|
|
50
|
+
} | ({
|
|
51
|
+
status: 200;
|
|
52
|
+
state: "success";
|
|
53
|
+
} & TTemplateShopDb);
|
|
54
|
+
export type TApiTemplateShopGetAllReq = {};
|
|
55
|
+
export type TApiTemplateShopGetAllRes = {
|
|
56
|
+
status: 400;
|
|
57
|
+
state: "failed";
|
|
58
|
+
message: string;
|
|
59
|
+
} | {
|
|
60
|
+
status: 200;
|
|
61
|
+
state: "success";
|
|
62
|
+
templates: TTemplateShopDb[];
|
|
63
|
+
};
|
|
64
|
+
export type TApiTemplateShopAdoptOneReq = {
|
|
65
|
+
templateShop_id: string;
|
|
66
|
+
};
|
|
67
|
+
export type TApiTemplateShopAdoptOneRes = {
|
|
68
|
+
status: 400;
|
|
69
|
+
state: "failed";
|
|
70
|
+
message: string;
|
|
71
|
+
} | {
|
|
72
|
+
status: 201;
|
|
73
|
+
state: "success";
|
|
74
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export type TRecord = {
|
|
2
|
+
isDone: boolean;
|
|
3
|
+
rpe?: string;
|
|
4
|
+
setNote?: string;
|
|
5
|
+
workDurationSecs?: number;
|
|
6
|
+
restDurationSecs?: number;
|
|
7
|
+
isStrictMode: boolean;
|
|
8
|
+
} & ({
|
|
9
|
+
type: "weight-reps";
|
|
10
|
+
kg: string;
|
|
11
|
+
reps: string;
|
|
12
|
+
rir?: string;
|
|
13
|
+
} | {
|
|
14
|
+
type: "duration";
|
|
15
|
+
durationSecs: string;
|
|
16
|
+
auxWeightKg: string;
|
|
17
|
+
} | {
|
|
18
|
+
type: "reps-only";
|
|
19
|
+
reps: string;
|
|
20
|
+
auxWeightKg: string;
|
|
21
|
+
rir?: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: "distance";
|
|
24
|
+
distanceKm: string;
|
|
25
|
+
auxWeightKg: string;
|
|
26
|
+
durationSecs: string;
|
|
27
|
+
});
|
|
28
|
+
export type TRecordDuration = Extract<TRecord, {
|
|
29
|
+
type: "duration";
|
|
30
|
+
}>;
|
|
31
|
+
export type TRecordWeight = Extract<TRecord, {
|
|
32
|
+
type: "weight-reps";
|
|
33
|
+
}>;
|
|
34
|
+
export type TRecordBodyWeight = Extract<TRecord, {
|
|
35
|
+
type: "reps-only";
|
|
36
|
+
}>;
|
|
37
|
+
export type TRecordDistance = Extract<TRecord, {
|
|
38
|
+
type: "distance";
|
|
39
|
+
}>;
|
|
40
|
+
export type TTemplateConfig = {
|
|
41
|
+
enableAuxWeight?: boolean;
|
|
42
|
+
enableRir?: boolean;
|
|
43
|
+
enableRpe?: boolean;
|
|
44
|
+
enableSetNote?: boolean;
|
|
45
|
+
enableExerciseNote?: boolean;
|
|
46
|
+
enableTimeIntervalMode?: boolean;
|
|
47
|
+
};
|
|
48
|
+
export type TTemplateExercise = {
|
|
49
|
+
exerciseId: string;
|
|
50
|
+
config: TTemplateConfig;
|
|
51
|
+
exerciseNote: string;
|
|
52
|
+
restTimeSecs?: number;
|
|
53
|
+
initialRecords: TRecord[];
|
|
54
|
+
};
|
package/dist/types/index.d.ts
CHANGED