90dc-core 1.6.2 → 1.6.3
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/lib/dbmodels/program/ExerciseModels.d.ts +22 -0
- package/dist/lib/dbmodels/program/ExerciseModels.js +117 -0
- package/dist/lib/dbmodels/program/ExerciseModels.js.map +1 -0
- package/dist/lib/dbmodels/program/TranslatedExerciseModel.d.ts +24 -0
- package/dist/lib/dbmodels/program/TranslatedExerciseModel.js +123 -0
- package/dist/lib/dbmodels/program/TranslatedExerciseModel.js.map +1 -0
- package/dist/lib/models/ExerciseInterfaces.d.ts +54 -10
- package/dist/lib/models/ExerciseInterfaces.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/dbmodels/program/ExerciseModels.ts +63 -0
- package/src/lib/dbmodels/program/TranslatedExerciseModel.ts +66 -0
- package/src/lib/models/ExerciseInterfaces.ts +72 -15
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Model } from "sequelize-typescript";
|
|
2
|
+
import type { ExerciseModel, ProgramTypes } from "../../models/ExerciseInterfaces";
|
|
3
|
+
import { TranslatedExerciseModel } from "./TranslatedExerciseModel";
|
|
4
|
+
export declare class ExercisesModels extends Model implements ExerciseModel {
|
|
5
|
+
uuid: string;
|
|
6
|
+
name: string;
|
|
7
|
+
restTime: string;
|
|
8
|
+
pointers: string;
|
|
9
|
+
isCustom: boolean;
|
|
10
|
+
url: string;
|
|
11
|
+
level: string[];
|
|
12
|
+
hasPriority: boolean;
|
|
13
|
+
isCompound: boolean;
|
|
14
|
+
hasVariations: boolean;
|
|
15
|
+
needsEquipment: boolean;
|
|
16
|
+
variations: object;
|
|
17
|
+
muscles: string[];
|
|
18
|
+
homeWorkout: boolean;
|
|
19
|
+
programType: ProgramTypes[];
|
|
20
|
+
graphData: "reps" | "weight";
|
|
21
|
+
translatedExercises: TranslatedExerciseModel[];
|
|
22
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Column, DataType, Default, HasMany, Model, Table } from "sequelize-typescript";
|
|
8
|
+
import { TranslatedExerciseModel } from "./TranslatedExerciseModel";
|
|
9
|
+
export let ExercisesModels = class ExercisesModels extends Model {
|
|
10
|
+
};
|
|
11
|
+
__decorate([
|
|
12
|
+
Default(DataType.UUIDV4),
|
|
13
|
+
Column({
|
|
14
|
+
type: DataType.UUID,
|
|
15
|
+
defaultValue: DataType.UUID,
|
|
16
|
+
allowNull: false,
|
|
17
|
+
primaryKey: true
|
|
18
|
+
})
|
|
19
|
+
], ExercisesModels.prototype, "uuid", void 0);
|
|
20
|
+
__decorate([
|
|
21
|
+
Column({
|
|
22
|
+
type: DataType.STRING,
|
|
23
|
+
allowNull: false
|
|
24
|
+
})
|
|
25
|
+
], ExercisesModels.prototype, "name", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
Column({
|
|
28
|
+
type: DataType.STRING,
|
|
29
|
+
allowNull: true
|
|
30
|
+
})
|
|
31
|
+
], ExercisesModels.prototype, "restTime", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
Column({
|
|
34
|
+
type: DataType.STRING(2048),
|
|
35
|
+
allowNull: false
|
|
36
|
+
})
|
|
37
|
+
], ExercisesModels.prototype, "pointers", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
Column({
|
|
40
|
+
type: DataType.BOOLEAN,
|
|
41
|
+
allowNull: true
|
|
42
|
+
})
|
|
43
|
+
], ExercisesModels.prototype, "isCustom", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
Column({
|
|
46
|
+
type: DataType.STRING,
|
|
47
|
+
allowNull: false
|
|
48
|
+
})
|
|
49
|
+
], ExercisesModels.prototype, "url", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
Column({
|
|
52
|
+
type: DataType.ARRAY(DataType.STRING),
|
|
53
|
+
allowNull: false
|
|
54
|
+
})
|
|
55
|
+
], ExercisesModels.prototype, "level", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
Column({
|
|
58
|
+
type: DataType.BOOLEAN,
|
|
59
|
+
allowNull: false
|
|
60
|
+
})
|
|
61
|
+
], ExercisesModels.prototype, "hasPriority", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
Column({
|
|
64
|
+
type: DataType.BOOLEAN,
|
|
65
|
+
allowNull: false
|
|
66
|
+
})
|
|
67
|
+
], ExercisesModels.prototype, "isCompound", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
Column({
|
|
70
|
+
type: DataType.BOOLEAN,
|
|
71
|
+
allowNull: false
|
|
72
|
+
})
|
|
73
|
+
], ExercisesModels.prototype, "hasVariations", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
Column({
|
|
76
|
+
type: DataType.BOOLEAN,
|
|
77
|
+
allowNull: false
|
|
78
|
+
})
|
|
79
|
+
], ExercisesModels.prototype, "needsEquipment", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
Column({
|
|
82
|
+
type: DataType.JSONB,
|
|
83
|
+
allowNull: false
|
|
84
|
+
})
|
|
85
|
+
], ExercisesModels.prototype, "variations", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
Column({
|
|
88
|
+
type: DataType.ARRAY(DataType.STRING),
|
|
89
|
+
allowNull: false
|
|
90
|
+
})
|
|
91
|
+
], ExercisesModels.prototype, "muscles", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
Column({
|
|
94
|
+
type: DataType.BOOLEAN,
|
|
95
|
+
allowNull: false
|
|
96
|
+
})
|
|
97
|
+
], ExercisesModels.prototype, "homeWorkout", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
Column({
|
|
100
|
+
type: DataType.ARRAY(DataType.STRING),
|
|
101
|
+
allowNull: false
|
|
102
|
+
})
|
|
103
|
+
], ExercisesModels.prototype, "programType", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
Column({
|
|
106
|
+
type: DataType.STRING,
|
|
107
|
+
allowNull: false
|
|
108
|
+
})
|
|
109
|
+
], ExercisesModels.prototype, "graphData", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
HasMany(()=>TranslatedExerciseModel)
|
|
112
|
+
], ExercisesModels.prototype, "translatedExercises", void 0);
|
|
113
|
+
ExercisesModels = __decorate([
|
|
114
|
+
Table
|
|
115
|
+
], ExercisesModels);
|
|
116
|
+
|
|
117
|
+
//# sourceMappingURL=ExerciseModels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/dbmodels/program/ExerciseModels.ts"],"sourcesContent":["import { Column, DataType, Default, HasMany, Model, Table } from \"sequelize-typescript\";\nimport type {ExerciseModel, ProgramTypes} from \"../../models/ExerciseInterfaces\";\nimport {TranslatedExerciseModel} from \"./TranslatedExerciseModel\";\n\n@Table\nexport class ExercisesModels extends Model implements ExerciseModel {\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n defaultValue: DataType.UUID,\n allowNull: false,\n primaryKey: true,\n })\n declare uuid: string;\n\n @Column({ type: DataType.STRING, allowNull: false })\n declare name: string;\n\n @Column({ type: DataType.STRING, allowNull: true })\n declare restTime: string;\n\n @Column({ type: DataType.STRING(2048), allowNull: false })\n declare pointers: string;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare isCustom: boolean;\n\n @Column({ type: DataType.STRING, allowNull: false })\n declare url: string;\n\n @Column({ type: DataType.ARRAY(DataType.STRING), allowNull: false })\n declare level: string[];\n\n @Column({ type: DataType.BOOLEAN, allowNull: false })\n declare hasPriority: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: false })\n declare isCompound: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: false })\n declare hasVariations: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: false })\n declare needsEquipment: boolean;\n\n @Column({ type: DataType.JSONB, allowNull: false })\n declare variations: object;\n\n @Column({ type: DataType.ARRAY(DataType.STRING), allowNull: false })\n declare muscles: string[];\n\n @Column({ type: DataType.BOOLEAN, allowNull: false })\n declare homeWorkout: boolean;\n\n @Column({ type: DataType.ARRAY(DataType.STRING), allowNull: false })\n declare programType: ProgramTypes[];\n\n @Column({ type: DataType.STRING, allowNull: false })\n declare graphData: \"reps\" | \"weight\";\n\n @HasMany(() => TranslatedExerciseModel)\n declare translatedExercises: TranslatedExerciseModel[];\n}\n"],"names":["Column","DataType","Default","HasMany","Model","Table","TranslatedExerciseModel","ExercisesModels","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","STRING","BOOLEAN","ARRAY","JSONB"],"mappings":";;;;;;AAAA,SAASA,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,EAAEC,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAExF,SAAQC,uBAAuB,QAAO,4BAA4B;AAGlE,WAAaC,kBAAN,8BAA8BH;AAyDrC,EAAC;;IAxDIF,QAAQD,SAASO,MAAM;IACvBR,OAAO;QACJS,MAAMR,SAASS,IAAI;QACnBC,cAAcV,SAASS,IAAI;QAC3BE,WAAW,KAAK;QAChBC,YAAY,IAAI;IACpB;GAPSN;;IAURP,OAAO;QAAES,MAAMR,SAASa,MAAM;QAAEF,WAAW,KAAK;IAAC;GAVzCL;;IAaRP,OAAO;QAAES,MAAMR,SAASa,MAAM;QAAEF,WAAW,IAAI;IAAC;GAbxCL;;IAgBRP,OAAO;QAAES,MAAMR,SAASa,MAAM,CAAC;QAAOF,WAAW,KAAK;IAAC;GAhB/CL;;IAmBRP,OAAO;QAAES,MAAMR,SAASc,OAAO;QAAEH,WAAW,IAAI;IAAC;GAnBzCL;;IAsBRP,OAAO;QAAES,MAAMR,SAASa,MAAM;QAAEF,WAAW,KAAK;IAAC;GAtBzCL;;IAyBRP,OAAO;QAAES,MAAMR,SAASe,KAAK,CAACf,SAASa,MAAM;QAAGF,WAAW,KAAK;IAAC;GAzBzDL;;IA4BRP,OAAO;QAAES,MAAMR,SAASc,OAAO;QAAEH,WAAW,KAAK;IAAC;GA5B1CL;;IA+BRP,OAAO;QAAES,MAAMR,SAASc,OAAO;QAAEH,WAAW,KAAK;IAAC;GA/B1CL;;IAkCRP,OAAO;QAAES,MAAMR,SAASc,OAAO;QAAEH,WAAW,KAAK;IAAC;GAlC1CL;;IAqCRP,OAAO;QAAES,MAAMR,SAASc,OAAO;QAAEH,WAAW,KAAK;IAAC;GArC1CL;;IAwCRP,OAAO;QAAES,MAAMR,SAASgB,KAAK;QAAEL,WAAW,KAAK;IAAC;GAxCxCL;;IA2CRP,OAAO;QAAES,MAAMR,SAASe,KAAK,CAACf,SAASa,MAAM;QAAGF,WAAW,KAAK;IAAC;GA3CzDL;;IA8CRP,OAAO;QAAES,MAAMR,SAASc,OAAO;QAAEH,WAAW,KAAK;IAAC;GA9C1CL;;IAiDRP,OAAO;QAAES,MAAMR,SAASe,KAAK,CAACf,SAASa,MAAM;QAAGF,WAAW,KAAK;IAAC;GAjDzDL;;IAoDRP,OAAO;QAAES,MAAMR,SAASa,MAAM;QAAEF,WAAW,KAAK;IAAC;GApDzCL;;IAuDRJ,QAAQ,IAAMG;GAvDNC;AAAAA;IADZF;GACYE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { ExercisesModels } from './ExerciseModels';
|
|
3
|
+
import type { ProgramTypes } from "../../models/ExerciseInterfaces";
|
|
4
|
+
export declare class TranslatedExerciseModel extends Model {
|
|
5
|
+
uuid: string;
|
|
6
|
+
exerciseUuid: string;
|
|
7
|
+
name: string;
|
|
8
|
+
language: string;
|
|
9
|
+
restTime: string;
|
|
10
|
+
pointers: string;
|
|
11
|
+
isCustom: boolean;
|
|
12
|
+
url: string;
|
|
13
|
+
level: string[];
|
|
14
|
+
hasPriority: boolean;
|
|
15
|
+
isCompound: boolean;
|
|
16
|
+
hasVariations: boolean;
|
|
17
|
+
needsEquipment: boolean;
|
|
18
|
+
variations: object;
|
|
19
|
+
muscles: string[];
|
|
20
|
+
homeWorkout: boolean;
|
|
21
|
+
programType: ProgramTypes[];
|
|
22
|
+
graphData: 'reps' | 'weight';
|
|
23
|
+
exercise: ExercisesModels;
|
|
24
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { BelongsTo, Column, DataType, Default, ForeignKey, Model, PrimaryKey, Table } from "sequelize-typescript";
|
|
8
|
+
import { ExercisesModels } from "./ExerciseModels";
|
|
9
|
+
export let TranslatedExerciseModel = class TranslatedExerciseModel extends Model {
|
|
10
|
+
};
|
|
11
|
+
__decorate([
|
|
12
|
+
PrimaryKey,
|
|
13
|
+
Default(DataType.UUIDV4),
|
|
14
|
+
Column(DataType.UUID)
|
|
15
|
+
], TranslatedExerciseModel.prototype, "uuid", void 0);
|
|
16
|
+
__decorate([
|
|
17
|
+
ForeignKey(()=>ExercisesModels),
|
|
18
|
+
Column(DataType.UUID)
|
|
19
|
+
], TranslatedExerciseModel.prototype, "exerciseUuid", void 0);
|
|
20
|
+
__decorate([
|
|
21
|
+
Column({
|
|
22
|
+
type: DataType.STRING,
|
|
23
|
+
allowNull: false
|
|
24
|
+
})
|
|
25
|
+
], TranslatedExerciseModel.prototype, "name", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
Column({
|
|
28
|
+
type: DataType.TEXT,
|
|
29
|
+
allowNull: false
|
|
30
|
+
})
|
|
31
|
+
], TranslatedExerciseModel.prototype, "language", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
Column({
|
|
34
|
+
type: DataType.STRING,
|
|
35
|
+
allowNull: true
|
|
36
|
+
})
|
|
37
|
+
], TranslatedExerciseModel.prototype, "restTime", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
Column({
|
|
40
|
+
type: DataType.STRING(2048),
|
|
41
|
+
allowNull: false
|
|
42
|
+
})
|
|
43
|
+
], TranslatedExerciseModel.prototype, "pointers", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
Column({
|
|
46
|
+
type: DataType.BOOLEAN,
|
|
47
|
+
allowNull: true
|
|
48
|
+
})
|
|
49
|
+
], TranslatedExerciseModel.prototype, "isCustom", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
Column({
|
|
52
|
+
type: DataType.STRING,
|
|
53
|
+
allowNull: false
|
|
54
|
+
})
|
|
55
|
+
], TranslatedExerciseModel.prototype, "url", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
Column({
|
|
58
|
+
type: DataType.ARRAY(DataType.STRING),
|
|
59
|
+
allowNull: false
|
|
60
|
+
})
|
|
61
|
+
], TranslatedExerciseModel.prototype, "level", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
Column({
|
|
64
|
+
type: DataType.BOOLEAN,
|
|
65
|
+
allowNull: false
|
|
66
|
+
})
|
|
67
|
+
], TranslatedExerciseModel.prototype, "hasPriority", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
Column({
|
|
70
|
+
type: DataType.BOOLEAN,
|
|
71
|
+
allowNull: false
|
|
72
|
+
})
|
|
73
|
+
], TranslatedExerciseModel.prototype, "isCompound", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
Column({
|
|
76
|
+
type: DataType.BOOLEAN,
|
|
77
|
+
allowNull: false
|
|
78
|
+
})
|
|
79
|
+
], TranslatedExerciseModel.prototype, "hasVariations", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
Column({
|
|
82
|
+
type: DataType.BOOLEAN,
|
|
83
|
+
allowNull: false
|
|
84
|
+
})
|
|
85
|
+
], TranslatedExerciseModel.prototype, "needsEquipment", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
Column({
|
|
88
|
+
type: DataType.JSONB,
|
|
89
|
+
allowNull: false
|
|
90
|
+
})
|
|
91
|
+
], TranslatedExerciseModel.prototype, "variations", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
Column({
|
|
94
|
+
type: DataType.ARRAY(DataType.STRING),
|
|
95
|
+
allowNull: false
|
|
96
|
+
})
|
|
97
|
+
], TranslatedExerciseModel.prototype, "muscles", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
Column({
|
|
100
|
+
type: DataType.BOOLEAN,
|
|
101
|
+
allowNull: false
|
|
102
|
+
})
|
|
103
|
+
], TranslatedExerciseModel.prototype, "homeWorkout", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
Column({
|
|
106
|
+
type: DataType.ARRAY(DataType.STRING),
|
|
107
|
+
allowNull: false
|
|
108
|
+
})
|
|
109
|
+
], TranslatedExerciseModel.prototype, "programType", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
Column({
|
|
112
|
+
type: DataType.STRING,
|
|
113
|
+
allowNull: false
|
|
114
|
+
})
|
|
115
|
+
], TranslatedExerciseModel.prototype, "graphData", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
BelongsTo(()=>ExercisesModels)
|
|
118
|
+
], TranslatedExerciseModel.prototype, "exercise", void 0);
|
|
119
|
+
TranslatedExerciseModel = __decorate([
|
|
120
|
+
Table
|
|
121
|
+
], TranslatedExerciseModel);
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=TranslatedExerciseModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/dbmodels/program/TranslatedExerciseModel.ts"],"sourcesContent":["import { BelongsTo, Column, DataType, Default, ForeignKey, Model, PrimaryKey, Table } from 'sequelize-typescript';\nimport { ExercisesModels } from './ExerciseModels';\nimport type {ProgramTypes} from \"../../models/ExerciseInterfaces\";\n\n@Table\nexport class TranslatedExerciseModel extends Model {\n\t@PrimaryKey\n\t@Default(DataType.UUIDV4)\n\t@Column(DataType.UUID)\n\tdeclare uuid: string;\n\n\t@ForeignKey(() => ExercisesModels)\n\t@Column(DataType.UUID)\n\tdeclare exerciseUuid: string;\n\n\t@Column({ type: DataType.STRING, allowNull: false })\n\tdeclare name: string;\n\n\t@Column({ type: DataType.TEXT, allowNull: false })\n\tdeclare language: string;\n\n\t@Column({ type: DataType.STRING, allowNull: true })\n\tdeclare restTime: string;\n\n\t@Column({ type: DataType.STRING(2048), allowNull: false })\n\tdeclare pointers: string;\n\n\t@Column({ type: DataType.BOOLEAN, allowNull: true })\n\tdeclare isCustom: boolean;\n\n\t@Column({ type: DataType.STRING, allowNull: false })\n\tdeclare url: string;\n\n\t@Column({ type: DataType.ARRAY(DataType.STRING), allowNull: false })\n\tdeclare level: string[];\n\n\t@Column({ type: DataType.BOOLEAN, allowNull: false })\n\tdeclare hasPriority: boolean;\n\n\t@Column({ type: DataType.BOOLEAN, allowNull: false })\n\tdeclare isCompound: boolean;\n\n\t@Column({ type: DataType.BOOLEAN, allowNull: false })\n\tdeclare hasVariations: boolean;\n\n\t@Column({ type: DataType.BOOLEAN, allowNull: false })\n\tdeclare needsEquipment: boolean;\n\n\t@Column({ type: DataType.JSONB, allowNull: false })\n\tdeclare variations: object;\n\n\t@Column({ type: DataType.ARRAY(DataType.STRING), allowNull: false })\n\tdeclare muscles: string[];\n\n\t@Column({ type: DataType.BOOLEAN, allowNull: false })\n\tdeclare homeWorkout: boolean;\n\n\t@Column({ type: DataType.ARRAY(DataType.STRING), allowNull: false })\n\tdeclare programType: ProgramTypes[];\n\n\t@Column({ type: DataType.STRING, allowNull: false })\n\tdeclare graphData: 'reps' | 'weight';\n\n\t@BelongsTo(() => ExercisesModels)\n\tdeclare exercise: ExercisesModels;\n}\n"],"names":["BelongsTo","Column","DataType","Default","ForeignKey","Model","PrimaryKey","Table","ExercisesModels","TranslatedExerciseModel","UUIDV4","UUID","type","STRING","allowNull","TEXT","BOOLEAN","ARRAY","JSONB"],"mappings":";;;;;;AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,UAAU,EAAEC,KAAK,EAAEC,UAAU,EAAEC,KAAK,QAAQ,uBAAuB;AAClH,SAASC,eAAe,QAAQ,mBAAmB;AAInD,WAAaC,0BAAN,sCAAsCJ;AA4D7C,EAAC;;IA3DCC;IACAH,QAAQD,SAASQ,MAAM;IACvBT,OAAOC,SAASS,IAAI;GAHTF;;IAMXL,WAAW,IAAMI;IACjBP,OAAOC,SAASS,IAAI;GAPTF;;IAUXR,OAAO;QAAEW,MAAMV,SAASW,MAAM;QAAEC,WAAW,KAAK;IAAC;GAVtCL;;IAaXR,OAAO;QAAEW,MAAMV,SAASa,IAAI;QAAED,WAAW,KAAK;IAAC;GAbpCL;;IAgBXR,OAAO;QAAEW,MAAMV,SAASW,MAAM;QAAEC,WAAW,IAAI;IAAC;GAhBrCL;;IAmBXR,OAAO;QAAEW,MAAMV,SAASW,MAAM,CAAC;QAAOC,WAAW,KAAK;IAAC;GAnB5CL;;IAsBXR,OAAO;QAAEW,MAAMV,SAASc,OAAO;QAAEF,WAAW,IAAI;IAAC;GAtBtCL;;IAyBXR,OAAO;QAAEW,MAAMV,SAASW,MAAM;QAAEC,WAAW,KAAK;IAAC;GAzBtCL;;IA4BXR,OAAO;QAAEW,MAAMV,SAASe,KAAK,CAACf,SAASW,MAAM;QAAGC,WAAW,KAAK;IAAC;GA5BtDL;;IA+BXR,OAAO;QAAEW,MAAMV,SAASc,OAAO;QAAEF,WAAW,KAAK;IAAC;GA/BvCL;;IAkCXR,OAAO;QAAEW,MAAMV,SAASc,OAAO;QAAEF,WAAW,KAAK;IAAC;GAlCvCL;;IAqCXR,OAAO;QAAEW,MAAMV,SAASc,OAAO;QAAEF,WAAW,KAAK;IAAC;GArCvCL;;IAwCXR,OAAO;QAAEW,MAAMV,SAASc,OAAO;QAAEF,WAAW,KAAK;IAAC;GAxCvCL;;IA2CXR,OAAO;QAAEW,MAAMV,SAASgB,KAAK;QAAEJ,WAAW,KAAK;IAAC;GA3CrCL;;IA8CXR,OAAO;QAAEW,MAAMV,SAASe,KAAK,CAACf,SAASW,MAAM;QAAGC,WAAW,KAAK;IAAC;GA9CtDL;;IAiDXR,OAAO;QAAEW,MAAMV,SAASc,OAAO;QAAEF,WAAW,KAAK;IAAC;GAjDvCL;;IAoDXR,OAAO;QAAEW,MAAMV,SAASe,KAAK,CAACf,SAASW,MAAM;QAAGC,WAAW,KAAK;IAAC;GApDtDL;;IAuDXR,OAAO;QAAEW,MAAMV,SAASW,MAAM;QAAEC,WAAW,KAAK;IAAC;GAvDtCL;;IA0DXT,UAAU,IAAMQ;GA1DLC;AAAAA;IADZF;GACYE"}
|
|
@@ -1,21 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { UserStrengthTests } from "../dbmodels/program/UserStrengthTests";
|
|
2
|
+
import type { UserChallenge } from "../dbmodels/program/UserChallenge";
|
|
3
|
+
import type { TranslatedStrengthTestExercise } from "../dbmodels/program/TranslatedStrengthTestExercise";
|
|
4
|
+
import type { ExercisesModels } from "../dbmodels/program/ExerciseModels";
|
|
5
|
+
export interface ExerciseModel {
|
|
6
|
+
uuid: string;
|
|
7
|
+
name: string;
|
|
8
|
+
level: string[];
|
|
9
|
+
isCompound: boolean;
|
|
10
|
+
needsEquipment: boolean;
|
|
11
|
+
hasPriority: boolean;
|
|
12
|
+
hasVariations: boolean;
|
|
13
|
+
variations: object;
|
|
14
|
+
muscles: string[];
|
|
15
|
+
homeWorkout: boolean;
|
|
4
16
|
}
|
|
5
|
-
export interface
|
|
6
|
-
|
|
17
|
+
export interface ExerciseProgress {
|
|
18
|
+
exerciseUuid: string;
|
|
19
|
+
progress: Progress[];
|
|
7
20
|
}
|
|
8
|
-
export interface
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
21
|
+
export interface UpdateSTRequest {
|
|
22
|
+
body: UserStrengthTests;
|
|
23
|
+
}
|
|
24
|
+
export interface UpdateUserChallengeRequest {
|
|
25
|
+
body: UserChallenge;
|
|
26
|
+
}
|
|
27
|
+
export interface STExerciseProgress {
|
|
28
|
+
exerciseUuid: string;
|
|
29
|
+
progress: Progress;
|
|
30
|
+
}
|
|
31
|
+
export interface ExercisePerformance {
|
|
32
|
+
workoutIndex: number;
|
|
33
|
+
progress: Progress[];
|
|
34
|
+
}
|
|
35
|
+
export interface SwapExerciseRequest {
|
|
36
|
+
exerciseUuid: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ChangeExerciseRequest {
|
|
39
|
+
oldExerciseUuid: string;
|
|
40
|
+
newExercise: ExercisesModels;
|
|
12
41
|
}
|
|
13
42
|
export interface ReducedExercise {
|
|
14
43
|
uuid: string;
|
|
15
44
|
name: string;
|
|
16
45
|
order: number;
|
|
17
|
-
progress
|
|
46
|
+
progress?: Progress[];
|
|
18
47
|
sets: string;
|
|
19
48
|
reps: string;
|
|
20
49
|
restTime?: string;
|
|
21
50
|
}
|
|
51
|
+
export interface UpdateTranslatedStrengthTestExercisesRequest {
|
|
52
|
+
exercises: TranslatedStrengthTestExercise[];
|
|
53
|
+
}
|
|
54
|
+
export interface AddTranslatedStrengthTestExercisesRequest {
|
|
55
|
+
exercises: TranslatedStrengthTestExercise[];
|
|
56
|
+
}
|
|
57
|
+
export type ProgramTypes = "BodyweightHomeWorkout" | "BodyweightOnlyBodyweight" | "BodyweightWeightedCali" | "Weights" | "Both";
|
|
58
|
+
export interface Progress {
|
|
59
|
+
[key: string]: number | string | undefined;
|
|
60
|
+
}
|
|
61
|
+
export interface ProgressByExercise {
|
|
62
|
+
name: string;
|
|
63
|
+
totalRepsDone: number;
|
|
64
|
+
weight: number;
|
|
65
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/models/ExerciseInterfaces.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/models/ExerciseInterfaces.ts"],"sourcesContent":["import type {UserStrengthTests} from \"../dbmodels/program/UserStrengthTests\";\nimport type {UserChallenge} from \"../dbmodels/program/UserChallenge\";\nimport type {TranslatedStrengthTestExercise} from \"../dbmodels/program/TranslatedStrengthTestExercise\";\nimport type {ExercisesModels} from \"../dbmodels/program/ExerciseModels\";\n\nexport interface ExerciseModel {\n uuid: string;\n name: string;\n level: string[];\n isCompound: boolean;\n needsEquipment: boolean;\n hasPriority: boolean;\n hasVariations: boolean;\n variations: object;\n muscles: string[];\n homeWorkout: boolean;\n}\n\nexport interface ExerciseProgress {\n exerciseUuid: string;\n progress: Progress[];\n}\n\nexport interface UpdateSTRequest {\n body: UserStrengthTests;\n}\n\nexport interface UpdateUserChallengeRequest {\n body: UserChallenge;\n}\n\nexport interface STExerciseProgress {\n exerciseUuid: string;\n progress: Progress;\n}\n\nexport interface ExercisePerformance {\n workoutIndex: number;\n progress: Progress[];\n}\n\nexport interface SwapExerciseRequest {\n exerciseUuid: string;\n}\n\nexport interface ChangeExerciseRequest {\n oldExerciseUuid: string;\n newExercise: ExercisesModels;\n}\n\nexport interface ReducedExercise {\n uuid: string;\n name: string;\n order: number;\n progress?: Progress[];\n sets: string;\n reps: string;\n restTime?: string;\n}\n\nexport interface UpdateTranslatedStrengthTestExercisesRequest {\n exercises: TranslatedStrengthTestExercise[];\n}\n\nexport interface AddTranslatedStrengthTestExercisesRequest {\n exercises: TranslatedStrengthTestExercise[];\n}\n\nexport type ProgramTypes =\n | \"BodyweightHomeWorkout\"\n | \"BodyweightOnlyBodyweight\"\n | \"BodyweightWeightedCali\"\n | \"Weights\"\n | \"Both\";\n\nexport interface Progress {\n [key: string]: number | string | undefined;\n}\n\nexport interface ProgressByExercise {\n name: string;\n totalRepsDone: number;\n weight: number;\n}\n"],"names":[],"mappings":"AAAA,WAmFC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Column, DataType, Default, HasMany, Model, Table } from "sequelize-typescript";
|
|
2
|
+
import type {ExerciseModel, ProgramTypes} from "../../models/ExerciseInterfaces";
|
|
3
|
+
import {TranslatedExerciseModel} from "./TranslatedExerciseModel";
|
|
4
|
+
|
|
5
|
+
@Table
|
|
6
|
+
export class ExercisesModels extends Model implements ExerciseModel {
|
|
7
|
+
@Default(DataType.UUIDV4)
|
|
8
|
+
@Column({
|
|
9
|
+
type: DataType.UUID,
|
|
10
|
+
defaultValue: DataType.UUID,
|
|
11
|
+
allowNull: false,
|
|
12
|
+
primaryKey: true,
|
|
13
|
+
})
|
|
14
|
+
declare uuid: string;
|
|
15
|
+
|
|
16
|
+
@Column({ type: DataType.STRING, allowNull: false })
|
|
17
|
+
declare name: string;
|
|
18
|
+
|
|
19
|
+
@Column({ type: DataType.STRING, allowNull: true })
|
|
20
|
+
declare restTime: string;
|
|
21
|
+
|
|
22
|
+
@Column({ type: DataType.STRING(2048), allowNull: false })
|
|
23
|
+
declare pointers: string;
|
|
24
|
+
|
|
25
|
+
@Column({ type: DataType.BOOLEAN, allowNull: true })
|
|
26
|
+
declare isCustom: boolean;
|
|
27
|
+
|
|
28
|
+
@Column({ type: DataType.STRING, allowNull: false })
|
|
29
|
+
declare url: string;
|
|
30
|
+
|
|
31
|
+
@Column({ type: DataType.ARRAY(DataType.STRING), allowNull: false })
|
|
32
|
+
declare level: string[];
|
|
33
|
+
|
|
34
|
+
@Column({ type: DataType.BOOLEAN, allowNull: false })
|
|
35
|
+
declare hasPriority: boolean;
|
|
36
|
+
|
|
37
|
+
@Column({ type: DataType.BOOLEAN, allowNull: false })
|
|
38
|
+
declare isCompound: boolean;
|
|
39
|
+
|
|
40
|
+
@Column({ type: DataType.BOOLEAN, allowNull: false })
|
|
41
|
+
declare hasVariations: boolean;
|
|
42
|
+
|
|
43
|
+
@Column({ type: DataType.BOOLEAN, allowNull: false })
|
|
44
|
+
declare needsEquipment: boolean;
|
|
45
|
+
|
|
46
|
+
@Column({ type: DataType.JSONB, allowNull: false })
|
|
47
|
+
declare variations: object;
|
|
48
|
+
|
|
49
|
+
@Column({ type: DataType.ARRAY(DataType.STRING), allowNull: false })
|
|
50
|
+
declare muscles: string[];
|
|
51
|
+
|
|
52
|
+
@Column({ type: DataType.BOOLEAN, allowNull: false })
|
|
53
|
+
declare homeWorkout: boolean;
|
|
54
|
+
|
|
55
|
+
@Column({ type: DataType.ARRAY(DataType.STRING), allowNull: false })
|
|
56
|
+
declare programType: ProgramTypes[];
|
|
57
|
+
|
|
58
|
+
@Column({ type: DataType.STRING, allowNull: false })
|
|
59
|
+
declare graphData: "reps" | "weight";
|
|
60
|
+
|
|
61
|
+
@HasMany(() => TranslatedExerciseModel)
|
|
62
|
+
declare translatedExercises: TranslatedExerciseModel[];
|
|
63
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { BelongsTo, Column, DataType, Default, ForeignKey, Model, PrimaryKey, Table } from 'sequelize-typescript';
|
|
2
|
+
import { ExercisesModels } from './ExerciseModels';
|
|
3
|
+
import type {ProgramTypes} from "../../models/ExerciseInterfaces";
|
|
4
|
+
|
|
5
|
+
@Table
|
|
6
|
+
export class TranslatedExerciseModel extends Model {
|
|
7
|
+
@PrimaryKey
|
|
8
|
+
@Default(DataType.UUIDV4)
|
|
9
|
+
@Column(DataType.UUID)
|
|
10
|
+
declare uuid: string;
|
|
11
|
+
|
|
12
|
+
@ForeignKey(() => ExercisesModels)
|
|
13
|
+
@Column(DataType.UUID)
|
|
14
|
+
declare exerciseUuid: string;
|
|
15
|
+
|
|
16
|
+
@Column({ type: DataType.STRING, allowNull: false })
|
|
17
|
+
declare name: string;
|
|
18
|
+
|
|
19
|
+
@Column({ type: DataType.TEXT, allowNull: false })
|
|
20
|
+
declare language: string;
|
|
21
|
+
|
|
22
|
+
@Column({ type: DataType.STRING, allowNull: true })
|
|
23
|
+
declare restTime: string;
|
|
24
|
+
|
|
25
|
+
@Column({ type: DataType.STRING(2048), allowNull: false })
|
|
26
|
+
declare pointers: string;
|
|
27
|
+
|
|
28
|
+
@Column({ type: DataType.BOOLEAN, allowNull: true })
|
|
29
|
+
declare isCustom: boolean;
|
|
30
|
+
|
|
31
|
+
@Column({ type: DataType.STRING, allowNull: false })
|
|
32
|
+
declare url: string;
|
|
33
|
+
|
|
34
|
+
@Column({ type: DataType.ARRAY(DataType.STRING), allowNull: false })
|
|
35
|
+
declare level: string[];
|
|
36
|
+
|
|
37
|
+
@Column({ type: DataType.BOOLEAN, allowNull: false })
|
|
38
|
+
declare hasPriority: boolean;
|
|
39
|
+
|
|
40
|
+
@Column({ type: DataType.BOOLEAN, allowNull: false })
|
|
41
|
+
declare isCompound: boolean;
|
|
42
|
+
|
|
43
|
+
@Column({ type: DataType.BOOLEAN, allowNull: false })
|
|
44
|
+
declare hasVariations: boolean;
|
|
45
|
+
|
|
46
|
+
@Column({ type: DataType.BOOLEAN, allowNull: false })
|
|
47
|
+
declare needsEquipment: boolean;
|
|
48
|
+
|
|
49
|
+
@Column({ type: DataType.JSONB, allowNull: false })
|
|
50
|
+
declare variations: object;
|
|
51
|
+
|
|
52
|
+
@Column({ type: DataType.ARRAY(DataType.STRING), allowNull: false })
|
|
53
|
+
declare muscles: string[];
|
|
54
|
+
|
|
55
|
+
@Column({ type: DataType.BOOLEAN, allowNull: false })
|
|
56
|
+
declare homeWorkout: boolean;
|
|
57
|
+
|
|
58
|
+
@Column({ type: DataType.ARRAY(DataType.STRING), allowNull: false })
|
|
59
|
+
declare programType: ProgramTypes[];
|
|
60
|
+
|
|
61
|
+
@Column({ type: DataType.STRING, allowNull: false })
|
|
62
|
+
declare graphData: 'reps' | 'weight';
|
|
63
|
+
|
|
64
|
+
@BelongsTo(() => ExercisesModels)
|
|
65
|
+
declare exercise: ExercisesModels;
|
|
66
|
+
}
|
|
@@ -1,27 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
| "Weights"
|
|
6
|
-
| "Both";
|
|
1
|
+
import type {UserStrengthTests} from "../dbmodels/program/UserStrengthTests";
|
|
2
|
+
import type {UserChallenge} from "../dbmodels/program/UserChallenge";
|
|
3
|
+
import type {TranslatedStrengthTestExercise} from "../dbmodels/program/TranslatedStrengthTestExercise";
|
|
4
|
+
import type {ExercisesModels} from "../dbmodels/program/ExerciseModels";
|
|
7
5
|
|
|
8
|
-
export interface
|
|
9
|
-
|
|
6
|
+
export interface ExerciseModel {
|
|
7
|
+
uuid: string;
|
|
8
|
+
name: string;
|
|
9
|
+
level: string[];
|
|
10
|
+
isCompound: boolean;
|
|
11
|
+
needsEquipment: boolean;
|
|
12
|
+
hasPriority: boolean;
|
|
13
|
+
hasVariations: boolean;
|
|
14
|
+
variations: object;
|
|
15
|
+
muscles: string[];
|
|
16
|
+
homeWorkout: boolean;
|
|
10
17
|
}
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
|
|
19
|
+
export interface ExerciseProgress {
|
|
20
|
+
exerciseUuid: string;
|
|
21
|
+
progress: Progress[];
|
|
13
22
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
|
|
24
|
+
export interface UpdateSTRequest {
|
|
25
|
+
body: UserStrengthTests;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface UpdateUserChallengeRequest {
|
|
29
|
+
body: UserChallenge;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface STExerciseProgress {
|
|
33
|
+
exerciseUuid: string;
|
|
34
|
+
progress: Progress;
|
|
18
35
|
}
|
|
36
|
+
|
|
37
|
+
export interface ExercisePerformance {
|
|
38
|
+
workoutIndex: number;
|
|
39
|
+
progress: Progress[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface SwapExerciseRequest {
|
|
43
|
+
exerciseUuid: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface ChangeExerciseRequest {
|
|
47
|
+
oldExerciseUuid: string;
|
|
48
|
+
newExercise: ExercisesModels;
|
|
49
|
+
}
|
|
50
|
+
|
|
19
51
|
export interface ReducedExercise {
|
|
20
52
|
uuid: string;
|
|
21
53
|
name: string;
|
|
22
54
|
order: number;
|
|
23
|
-
progress
|
|
55
|
+
progress?: Progress[];
|
|
24
56
|
sets: string;
|
|
25
57
|
reps: string;
|
|
26
58
|
restTime?: string;
|
|
27
59
|
}
|
|
60
|
+
|
|
61
|
+
export interface UpdateTranslatedStrengthTestExercisesRequest {
|
|
62
|
+
exercises: TranslatedStrengthTestExercise[];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface AddTranslatedStrengthTestExercisesRequest {
|
|
66
|
+
exercises: TranslatedStrengthTestExercise[];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type ProgramTypes =
|
|
70
|
+
| "BodyweightHomeWorkout"
|
|
71
|
+
| "BodyweightOnlyBodyweight"
|
|
72
|
+
| "BodyweightWeightedCali"
|
|
73
|
+
| "Weights"
|
|
74
|
+
| "Both";
|
|
75
|
+
|
|
76
|
+
export interface Progress {
|
|
77
|
+
[key: string]: number | string | undefined;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface ProgressByExercise {
|
|
81
|
+
name: string;
|
|
82
|
+
totalRepsDone: number;
|
|
83
|
+
weight: number;
|
|
84
|
+
}
|