90dc-core 1.0.7 → 1.0.8

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.
Files changed (32) hide show
  1. package/package.json +30 -25
  2. package/src/index.ts +7 -0
  3. package/src/lib/db/models/Exercise.ts +47 -0
  4. package/src/lib/db/models/ExerciseBlueprint.ts +51 -0
  5. package/src/lib/db/models/ExerciseModels.ts +44 -0
  6. package/src/lib/db/models/ExerciseProgress.ts +26 -0
  7. package/src/lib/db/models/ForgotPasswordTokens.ts +22 -0
  8. package/src/lib/db/models/PersistedUser.ts +72 -0
  9. package/src/lib/db/models/Program.ts +22 -0
  10. package/src/lib/db/models/ProgramBlueprint.ts +39 -0
  11. package/src/lib/db/models/RefreshToken.ts +8 -0
  12. package/src/lib/db/models/Superset.ts +20 -0
  13. package/src/lib/db/models/SupersetExercise.ts +35 -0
  14. package/src/lib/db/models/UserInfo.ts +27 -0
  15. package/src/lib/db/models/UserProgressPhoto.ts +23 -0
  16. package/src/lib/db/models/Workout.ts +42 -0
  17. package/src/lib/db/models/WorkoutExercise.ts +34 -0
  18. package/{dist/lib/models/ExerciseInterfaces.d.ts → src/lib/models/ExerciseInterfaces.ts} +0 -0
  19. package/{dist/lib/models/ProgramInterfaces.d.ts → src/lib/models/ProgramInterfaces.ts} +0 -0
  20. package/{dist/lib/models/WorkoutInterfaces.d.ts → src/lib/models/WorkoutInterfaces.ts} +0 -0
  21. package/tsconfig.json +14 -0
  22. package/dist/index.d.ts +0 -6
  23. package/dist/index.js +0 -24
  24. package/dist/index.test.d.ts +0 -1
  25. package/dist/index.test.js +0 -6
  26. package/dist/lib/models/ExerciseInterfaces.js +0 -2
  27. package/dist/lib/models/ProgramInterfaces.js +0 -2
  28. package/dist/lib/models/UserInterfaces.d.ts +0 -52
  29. package/dist/lib/models/UserInterfaces.js +0 -2
  30. package/dist/lib/models/WorkoutInterfaces.js +0 -2
  31. package/dist/lib/util/Logger.d.ts +0 -1
  32. package/dist/lib/util/Logger.js +0 -11
package/package.json CHANGED
@@ -1,39 +1,44 @@
1
1
  {
2
2
  "name": "90dc-core",
3
- "version": "1.0.7",
4
- "description": "",
3
+ "version": "1.0.8",
4
+ "description": "A package that contains utils and interfaces used to create 90dc",
5
5
  "main": "index.js",
6
- "files": [
7
- "dist/**/*"
8
- ],
9
- "types": "dist/index.d.ts",
10
- "scripts": {
11
- "dev": "tsnd --respawn src/index.ts",
12
- "build": "tsc",
13
- "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
14
- "lint": "tslint -p tsconfig.json",
15
- "prepare": "npm run build",
16
- "prepublishOnly": "npm run lint",
17
- "preversion": "npm run lint",
18
- "version": "npm run format && git add -A src",
19
- "postversion": "git push && git push --tags",
20
- "test": "jest --config jestconfig.json"
21
- },
22
- "keywords": [],
23
- "author": "",
24
- "license": "ISC",
25
6
  "devDependencies": {
26
7
  "@types/jest": "^29.2.6",
8
+ "@types/node": "^18.13.0",
9
+ "@types/validator": "^13.7.12",
27
10
  "jest": "^29.3.1",
28
11
  "prettier": "^2.8.3",
29
12
  "ts-jest": "^29.0.5",
13
+ "ts-node": "^10.9.1",
14
+ "ts-node-dev": "^2.0.0",
30
15
  "tslint": "^6.1.3",
31
16
  "tslint-config-prettier": "^1.18.0",
32
- "typescript": "^4.9.4",
33
- "ts-node": "^10.9.1",
34
- "ts-node-dev": "^2.0.0"
17
+ "typescript": "^4.9.4"
35
18
  },
36
19
  "dependencies": {
20
+ "reflect-metadata": "^0.1.13",
21
+ "sequelize": "^6.28.0",
22
+ "sequelize-typescript": "^2.1.5",
37
23
  "winston": "^3.8.2"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/RomaPchel/90DC-core.git"
28
+ },
29
+ "author": "RomaPchel",
30
+ "license": "ISC",
31
+ "bugs": {
32
+ "url": "https://github.com/RomaPchel/90DC-core/issues"
33
+ },
34
+ "homepage": "https://github.com/RomaPchel/90DC-core#readme",
35
+ "scripts": {
36
+ "dev": "tsnd --respawn src/index.ts",
37
+ "build": "tsc",
38
+ "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
39
+ "lint": "tslint -p tsconfig.json",
40
+ "preversion": "npm run lint",
41
+ "version": "npm run format && git add -A src",
42
+ "postversion": "git push && git push --tags"
38
43
  }
39
- }
44
+ }
package/src/index.ts ADDED
@@ -0,0 +1,7 @@
1
+ export * from "./lib/models/ProgramInterfaces";
2
+ export * from "./lib/models/ExerciseInterfaces";
3
+ export * from "./lib/models/WorkoutInterfaces";
4
+ export * from "./lib/db/models/Exercise"
5
+ export * from "./lib/db/models/ExerciseModels"
6
+ export * from "./lib/db/models/PersistedUser"
7
+ export * from "./lib/db/models/ForgotPasswordTokens"
@@ -0,0 +1,47 @@
1
+ import {Column, DataType, Default, Model, Table} from "sequelize-typescript";
2
+ import {ExerciseModel} from "../../models/ExerciseInterfaces";
3
+
4
+ @Table
5
+ export class Exercise extends Model<Exercise> implements ExerciseModel {
6
+
7
+ @Default(DataType.UUIDV4)
8
+ @Column({type: DataType.UUID, defaultValue: DataType.UUID, allowNull: false, primaryKey: true})
9
+ declare uuid: string;
10
+
11
+ @Column({type: DataType.STRING, allowNull: false})
12
+ declare name: string;
13
+
14
+ @Column({type: DataType.ARRAY(DataType.STRING), allowNull: false})
15
+ declare level: string[];
16
+
17
+ @Column({type: DataType.BOOLEAN, allowNull: false})
18
+ declare hasPriority: boolean;
19
+
20
+ @Column({type: DataType.BOOLEAN, allowNull: false})
21
+ declare isCompound: boolean;
22
+
23
+ @Column({type: DataType.BOOLEAN, allowNull: false})
24
+ declare hasVariations: boolean;
25
+
26
+ @Column({type: DataType.BOOLEAN, allowNull: false})
27
+ declare needsEquipment: boolean;
28
+
29
+ @Column({type: DataType.JSONB, allowNull: false})
30
+ declare variations: Object;
31
+
32
+ @Column({type: DataType.ARRAY(DataType.STRING), allowNull: false})
33
+ declare muscles: string[];
34
+
35
+ @Column({type: DataType.STRING, allowNull: false})
36
+ declare reps: string;
37
+
38
+ @Column({type: DataType.STRING, allowNull: false})
39
+ declare sets: string;
40
+
41
+ @Column({type: DataType.INTEGER, allowNull: false})
42
+ declare order: number;
43
+
44
+ @Column({type: DataType.BOOLEAN, allowNull: false})
45
+ declare homeWorkout: boolean
46
+
47
+ }
@@ -0,0 +1,51 @@
1
+ import {
2
+ BelongsTo,
3
+ Column,
4
+ DataType,
5
+ Default,
6
+ Model,
7
+ Table,
8
+ } from "sequelize-typescript";
9
+ import { ProgramBlueprint } from "./ProgramBlueprint";
10
+
11
+ @Table
12
+ export class ExerciseBlueprint extends Model {
13
+ @Default(DataType.UUIDV4)
14
+ @Column({
15
+ type: DataType.UUID,
16
+ defaultValue: DataType.UUID,
17
+ allowNull: false,
18
+ primaryKey: true,
19
+ })
20
+ declare uuid: string;
21
+
22
+ @Column({ type: DataType.BOOLEAN, allowNull: false })
23
+ declare hasPriority: boolean;
24
+
25
+ @Column({ type: DataType.BOOLEAN, allowNull: false })
26
+ declare isCompound: boolean;
27
+
28
+ @Column({ type: DataType.BOOLEAN, allowNull: false })
29
+ declare needsEquipment: boolean;
30
+
31
+ @Column({ type: DataType.BOOLEAN, allowNull: false })
32
+ declare isSuperset: boolean;
33
+
34
+ @Column({ type: DataType.BOOLEAN, allowNull: false })
35
+ declare isFixed: boolean;
36
+
37
+ @Column({ type: DataType.STRING, allowNull: false })
38
+ declare muscle: string;
39
+
40
+ @Column({ type: DataType.INTEGER, allowNull: false })
41
+ declare rir: number;
42
+
43
+ @Column({ type: DataType.STRING, allowNull: false })
44
+ declare reps: string;
45
+
46
+ @Column({ type: DataType.STRING, allowNull: false })
47
+ declare sets: string;
48
+
49
+ @BelongsTo(() => ProgramBlueprint, { foreignKey: "programId" })
50
+ declare program: ProgramBlueprint;
51
+ }
@@ -0,0 +1,44 @@
1
+ import { Column, DataType, Default, Model, Table } from "sequelize-typescript";
2
+ import {ExerciseModel} from "../../models/ExerciseInterfaces";
3
+
4
+ @Table
5
+ export class ExercisesModels extends Model implements ExerciseModel {
6
+ @Default(DataType.UUIDV4)
7
+ @Column({
8
+ type: DataType.UUID,
9
+ defaultValue: DataType.UUID,
10
+ allowNull: false,
11
+ primaryKey: true,
12
+ })
13
+ declare uuid: string;
14
+
15
+ @Column({ type: DataType.STRING, allowNull: false })
16
+ declare name: string;
17
+
18
+ @Column({ type: DataType.ARRAY(DataType.STRING), allowNull: false })
19
+ declare level: string[];
20
+
21
+ @Column({ type: DataType.BOOLEAN, allowNull: false })
22
+ declare hasPriority: boolean;
23
+
24
+ @Column({ type: DataType.BOOLEAN, allowNull: false })
25
+ declare isCompound: boolean;
26
+
27
+ @Column({ type: DataType.BOOLEAN, allowNull: false })
28
+ declare hasVariations: boolean;
29
+
30
+ @Column({ type: DataType.BOOLEAN, allowNull: false })
31
+ declare needsEquipment: boolean;
32
+
33
+ @Column({ type: DataType.JSONB, allowNull: false })
34
+ declare variations: object;
35
+
36
+ @Column({ type: DataType.JSONB, allowNull: false })
37
+ declare variationIfNoVariations: object;
38
+
39
+ @Column({ type: DataType.ARRAY(DataType.STRING), allowNull: false })
40
+ declare muscles: string[];
41
+
42
+ @Column({ type: DataType.BOOLEAN, allowNull: false })
43
+ declare homeWorkout: boolean;
44
+ }
@@ -0,0 +1,26 @@
1
+ import {Column, DataType, Default, ForeignKey, Model, Table} from "sequelize-typescript";
2
+ import {PersistedUser} from "./PersistedUser";
3
+
4
+ @Table
5
+ export class ExerciseProgress extends Model<ExerciseProgress> {
6
+
7
+ @Default(DataType.UUIDV4)
8
+ @Column({type: DataType.UUID, defaultValue: DataType.UUID, allowNull: false, primaryKey: true})
9
+ declare uuid: string
10
+
11
+ @ForeignKey(() => PersistedUser)
12
+ @Column({type: DataType.UUID, defaultValue: DataType.UUID, allowNull: false})
13
+ declare userUuid: string;
14
+
15
+ @Column({type: DataType.TEXT, allowNull: false})
16
+ declare exerciseUuid: string;
17
+
18
+ @Column({type: DataType.TEXT, allowNull: false})
19
+ declare reps: string;
20
+
21
+ @Column({type: DataType.TEXT, allowNull: false})
22
+ declare weight: string;
23
+
24
+ @Column({type: DataType.DATE, allowNull: false})
25
+ declare date: Date;
26
+ }
@@ -0,0 +1,22 @@
1
+ import {Column, DataType, Default, Model, Table} from "sequelize-typescript";
2
+
3
+
4
+ @Table
5
+ export class ForgotPasswordTokens extends Model<ForgotPasswordTokens> {
6
+
7
+ @Default(DataType.UUIDV4)
8
+ @Column({type: DataType.UUID, defaultValue: DataType.UUID, allowNull: false, primaryKey: true})
9
+ declare uuid: string;
10
+
11
+ @Column({type: DataType.UUID, allowNull: false})
12
+ declare userUuid: string;
13
+
14
+ @Column({ type: DataType.TEXT, allowNull: false })
15
+ declare token: string
16
+
17
+ @Column({type: DataType.DATE, allowNull: false})
18
+ declare date: Date;
19
+
20
+
21
+
22
+ }
@@ -0,0 +1,72 @@
1
+ import {Column, DataType, Default, HasMany, HasOne, Model, Table} from "sequelize-typescript";
2
+ import {Program} from "./Program";
3
+ import {UserInfo} from "./UserInfo";
4
+ import {UserProgressPhoto} from "./UserProgressPhoto";
5
+
6
+
7
+ @Table
8
+ export class PersistedUser extends Model {
9
+
10
+ @Default(DataType.UUIDV4)
11
+ @Column({type: DataType.UUID, defaultValue: DataType.UUID, allowNull: false, primaryKey: true})
12
+ declare userUuid: string;
13
+
14
+ @Column({ type: DataType.TEXT, allowNull: false, unique: true })
15
+ declare email: string;
16
+
17
+ @Column({ type: DataType.TEXT, allowNull: false })
18
+ declare password: string;
19
+
20
+ @Column({ type: DataType.TEXT, allowNull: true })
21
+ declare firstName: string;
22
+
23
+ @Column({ type: DataType.TEXT, allowNull: true })
24
+ declare lastName: string;
25
+
26
+ @Column({type: DataType.TEXT, allowNull: true})
27
+ declare avatar: string;
28
+
29
+ @Column({ type: DataType.TEXT, allowNull: true })
30
+ declare sex: string;
31
+
32
+ @Column({ type: DataType.TEXT, allowNull: true })
33
+ declare goal: string;
34
+
35
+ @Column({ type: DataType.TEXT, allowNull: true })
36
+ declare weightGoal: string;
37
+
38
+ @Column({ type: DataType.TEXT, allowNull: true })
39
+ declare level: string;
40
+
41
+ @Column({ type: DataType.TEXT, allowNull: true })
42
+ declare type: string;
43
+
44
+ @Column({ type: DataType.TEXT, allowNull: true })
45
+ declare days: number;
46
+
47
+ @Column({ type: DataType.TEXT, allowNull: true })
48
+ declare dateOfBirth: string;
49
+
50
+ @Column({ type: DataType.TEXT, allowNull: true })
51
+ declare metricSystem: string;
52
+
53
+ @Column({ type: DataType.TEXT, allowNull: true })
54
+ declare height: string;
55
+
56
+ @Column({ type: DataType.TEXT, allowNull: true })
57
+ declare weight: string;
58
+
59
+ @HasOne(() => Program, { foreignKey: "userUuid" })
60
+ declare program: Program;
61
+
62
+ @HasOne(() => UserInfo, { foreignKey: "userUuid" })
63
+ declare userInfo: UserInfo;
64
+
65
+ @HasMany(() => UserProgressPhoto, { foreignKey: "userUuid" })
66
+ declare progressPhotos: UserInfo[];
67
+
68
+
69
+
70
+
71
+
72
+ }
@@ -0,0 +1,22 @@
1
+ import {Workout} from "./Workout";
2
+ import {BelongsTo, Column, DataType, Default, HasMany, Model, Table} from "sequelize-typescript";
3
+ import {PersistedUser} from "./PersistedUser";
4
+ import {ProgramModel} from "../../models/ProgramInterfaces";
5
+
6
+ @Table
7
+ export class Program extends Model implements ProgramModel {
8
+
9
+ @Default(DataType.UUIDV4)
10
+ @Column({type: DataType.UUID, defaultValue: DataType.UUID, allowNull: false, primaryKey: true})
11
+ declare programId: string;
12
+
13
+ @Column({type: DataType.UUID, allowNull: false})
14
+ declare userUuid: string;
15
+
16
+ @BelongsTo(() => PersistedUser, {foreignKey: "userUuid"})
17
+ declare user: PersistedUser;
18
+
19
+ @HasMany(() => Workout, {foreignKey: "programId"})
20
+ declare workout: Workout[];
21
+
22
+ }
@@ -0,0 +1,39 @@
1
+ import {
2
+ Column,
3
+ DataType,
4
+ Default,
5
+ HasMany,
6
+ Model,
7
+ Table,
8
+ } from "sequelize-typescript";
9
+ import { ExerciseBlueprint } from "./ExerciseBlueprint";
10
+
11
+ @Table
12
+ export class ProgramBlueprint extends Model {
13
+ @Default(DataType.UUIDV4)
14
+ @Column({
15
+ type: DataType.UUID,
16
+ defaultValue: DataType.UUID,
17
+ allowNull: false,
18
+ primaryKey: true,
19
+ })
20
+ declare programId: string;
21
+
22
+ @Column({ type: DataType.TEXT, allowNull: false, unique: true })
23
+ declare title: string;
24
+
25
+ @Column({ type: DataType.TEXT, allowNull: false })
26
+ declare level: string;
27
+
28
+ @Column({ type: DataType.INTEGER, allowNull: false })
29
+ declare numberOfDays: number;
30
+
31
+ @Column({ type: DataType.INTEGER, allowNull: false })
32
+ declare exercisesPerWorkout: number;
33
+
34
+ @Column({ type: DataType.ARRAY(DataType.JSONB), allowNull: false })
35
+ declare workoutNames: object[];
36
+
37
+ @HasMany(() => ExerciseBlueprint, { foreignKey: "programId" })
38
+ declare exercises: ExerciseBlueprint[];
39
+ }
@@ -0,0 +1,8 @@
1
+ import {Column, DataType, Model, Table} from "sequelize-typescript";
2
+
3
+ @Table
4
+ export class RefreshToken extends Model<RefreshToken>{
5
+
6
+ @Column({ type: DataType.TEXT, allowNull: false})
7
+ declare refreshToken: string;
8
+ }
@@ -0,0 +1,20 @@
1
+ import {Exercise} from "./Exercise";
2
+ import {SupersetExercise} from "./SupersetExercise";
3
+ import {BelongsTo, BelongsToMany, Column, DataType, Default, Model, Table} from "sequelize-typescript";
4
+ import {Workout} from "./Workout";
5
+ import {SupersetModel} from "../../models/WorkoutInterfaces";
6
+
7
+ @Table
8
+ export class Superset extends Model implements SupersetModel {
9
+
10
+ @Default(DataType.UUIDV4)
11
+ @Column({type: DataType.UUID, defaultValue: DataType.UUID, allowNull: false, primaryKey: true})
12
+ declare uuid: string;
13
+
14
+ @BelongsTo(() => Workout, { foreignKey: "uuid" })
15
+ declare workout: Workout;
16
+
17
+ @BelongsToMany(() => Exercise, () => SupersetExercise)
18
+ declare exercise: Exercise[];
19
+
20
+ }
@@ -0,0 +1,35 @@
1
+ import {Exercise} from "./Exercise";
2
+ import {Superset} from "./Superset";
3
+ import {Column, DataType, ForeignKey, Model, Table} from "sequelize-typescript";
4
+ import {SupersetExerciseModel} from "../../models/WorkoutInterfaces";
5
+
6
+ @Table
7
+ export class SupersetExercise extends Model<SupersetExercise> implements SupersetExerciseModel {
8
+
9
+ @ForeignKey(() => Superset)
10
+ @Column({
11
+ type: DataType.UUID,
12
+ allowNull: false,
13
+ primaryKey: true,
14
+ references: {
15
+ model: Superset,
16
+ key: 'uuid'
17
+ }
18
+ })
19
+ declare SupersetUuid: string;
20
+
21
+ @ForeignKey(() => Exercise)
22
+ @Column({
23
+ type: DataType.UUID,
24
+ allowNull: false,
25
+ primaryKey: true,
26
+ references: {
27
+ model: Exercise,
28
+ key: 'uuid',
29
+ }
30
+
31
+ })
32
+ declare ExerciseUuid: string;
33
+
34
+
35
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import {PersistedUser} from "./PersistedUser";
3
+ import {BelongsTo, Column, DataType, Default, Model, Table} from "sequelize-typescript";
4
+
5
+ @Table
6
+ export class UserInfo extends Model
7
+ {
8
+ @Default(DataType.UUIDV4)
9
+ @Column({type: DataType.UUID, defaultValue: DataType.UUID, allowNull: false, primaryKey: true})
10
+ declare userUuid: string;
11
+
12
+ @Column({ type: DataType.TEXT, allowNull: false})
13
+ declare height: string;
14
+
15
+ @Column({ type: DataType.TEXT, allowNull: false})
16
+ declare weight: string;
17
+
18
+ @Column({ type: DataType.TEXT, allowNull: true})
19
+ declare beforePhoto: string;
20
+
21
+ @Column({ type: DataType.TEXT, allowNull: true})
22
+ declare afterPhoto: string;
23
+
24
+ @BelongsTo(() => PersistedUser, { foreignKey: "userUuid" })
25
+ declare user: PersistedUser;
26
+
27
+ }
@@ -0,0 +1,23 @@
1
+ import {PersistedUser} from "./PersistedUser";
2
+ import {BelongsTo, Column, DataType, ForeignKey, Model, Table} from "sequelize-typescript";
3
+
4
+ @Table
5
+ export class UserProgressPhoto extends Model {
6
+
7
+ @Column({type: DataType.UUID, defaultValue: DataType.UUID, allowNull: false, primaryKey: true})
8
+ declare uuid: string;
9
+
10
+ @ForeignKey(() => PersistedUser)
11
+ @Column({type: DataType.UUID, defaultValue: DataType.UUID, allowNull: false})
12
+ declare userUuid: string;
13
+
14
+ @Column({type: DataType.TEXT, allowNull: true})
15
+ declare progressPhoto: string;
16
+
17
+ @Column({type: DataType.DATE, allowNull: false})
18
+ declare date: Date;
19
+
20
+ @BelongsTo(() => PersistedUser, {foreignKey: "userUuid"})
21
+ declare user: PersistedUser;
22
+
23
+ }
@@ -0,0 +1,42 @@
1
+ import { Exercise } from "./Exercise";
2
+ import { Program } from "./Program";
3
+ import { WorkoutExercise } from "./WorkoutExercise";
4
+ import { Superset } from "./Superset";
5
+ import {
6
+ BelongsTo,
7
+ BelongsToMany,
8
+ Column,
9
+ DataType,
10
+ Default,
11
+ HasMany,
12
+ Model,
13
+ Table,
14
+ } from "sequelize-typescript";
15
+ import {WorkoutModel} from "../../models/WorkoutInterfaces";
16
+
17
+ @Table
18
+ export class Workout extends Model implements WorkoutModel {
19
+ @Default(DataType.UUIDV4)
20
+ @Column({
21
+ type: DataType.UUID,
22
+ defaultValue: DataType.UUID,
23
+ allowNull: false,
24
+ primaryKey: true,
25
+ })
26
+ declare uuid: string;
27
+
28
+ @Column({ type: DataType.BOOLEAN, allowNull: false })
29
+ declare isFinished: boolean;
30
+
31
+ @Column({ type: DataType.JSONB, allowNull: false })
32
+ declare info: object;
33
+
34
+ @BelongsToMany(() => Exercise, () => WorkoutExercise)
35
+ declare exercise: Exercise;
36
+
37
+ @BelongsTo(() => Program, { foreignKey: "programId" })
38
+ declare program: Program;
39
+
40
+ @HasMany(() => Superset, { foreignKey: "uuid" })
41
+ declare superset: Superset[];
42
+ }
@@ -0,0 +1,34 @@
1
+ import {Workout} from "./Workout";
2
+ import {Exercise} from "./Exercise";
3
+ import {Column, DataType, ForeignKey, Model, Table} from "sequelize-typescript";
4
+ import {WorkoutExerciseModel} from "../../models/WorkoutInterfaces";
5
+
6
+ @Table
7
+ export class WorkoutExercise extends Model<WorkoutExercise> implements WorkoutExerciseModel {
8
+ @ForeignKey(() => Workout)
9
+ @Column({
10
+ type: DataType.UUID,
11
+ allowNull: false,
12
+ primaryKey: true,
13
+ references: {
14
+ model: "Workout",
15
+ key: 'uuid'
16
+ }
17
+ })
18
+ declare WorkoutUuid: string;
19
+
20
+ @ForeignKey(() => Exercise)
21
+ @Column({
22
+ type: DataType.UUID,
23
+ allowNull: false,
24
+ primaryKey: true,
25
+ references: {
26
+ model: "Exercise",
27
+ key: 'uuid',
28
+ }
29
+
30
+ })
31
+ declare ExerciseUuid: string;
32
+
33
+
34
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "experimentalDecorators": true,
4
+ "emitDecoratorMetadata": true,
5
+ "target": "es2016",
6
+ "module": "commonjs",
7
+ "esModuleInterop": true,
8
+ "forceConsistentCasingInFileNames": true,
9
+ "strict": true,
10
+ "skipLibCheck": true,
11
+ "outDir": "./build"
12
+ },
13
+ "include": ["src/**/*"]
14
+ }
package/dist/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export declare const Greeter: (name: string) => string;
2
- export * from "./lib/models/ProgramInterfaces";
3
- export * from "./lib/models/ExerciseInterfaces";
4
- export * from "./lib/models/WorkoutInterfaces";
5
- export * from "./lib/models/ProgramInterfaces";
6
- export * from "./lib/util/Logger";
package/dist/index.js DELETED
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.Greeter = void 0;
18
- const Greeter = (name) => `Hello ${name}`;
19
- exports.Greeter = Greeter;
20
- __exportStar(require("./lib/models/ProgramInterfaces"), exports);
21
- __exportStar(require("./lib/models/ExerciseInterfaces"), exports);
22
- __exportStar(require("./lib/models/WorkoutInterfaces"), exports);
23
- __exportStar(require("./lib/models/ProgramInterfaces"), exports);
24
- __exportStar(require("./lib/util/Logger"), exports);
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const index_1 = require("./index");
4
- test('My Greeter', () => {
5
- expect((0, index_1.Greeter)('Carl')).toBe('Hello Carl');
6
- });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,52 +0,0 @@
1
- export interface UserTypes {
2
- userUuid: string;
3
- email: string;
4
- firstName: string;
5
- lastName: string;
6
- avatar: string;
7
- }
8
- export interface UserInfoModel {
9
- userUuid: string;
10
- height: string;
11
- weight: string;
12
- }
13
- export interface LoginRequest {
14
- email: string;
15
- password: string;
16
- }
17
- export interface UserPhotoRequest {
18
- base64: string;
19
- }
20
- export interface ProgressPhoto {
21
- date: Date;
22
- progressPhoto: string;
23
- userUuid: string;
24
- }
25
- export interface ForgotPassword {
26
- uuid: string;
27
- userUuid: string;
28
- token: string;
29
- date: Date;
30
- }
31
- export interface RefreshPayload {
32
- userUuid: string;
33
- }
34
- export interface TokenRequest {
35
- token: string;
36
- }
37
- export interface RefreshRequest {
38
- refreshToken: string;
39
- }
40
- export interface UuidRequest {
41
- userUuid: string;
42
- }
43
- export interface EmailRequest {
44
- email: string;
45
- }
46
- export default interface AuthenticationToken {
47
- type: string;
48
- contents: string;
49
- }
50
- export interface RestorePasswordRequest {
51
- email: string;
52
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export declare const logger: import("winston").Logger;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.logger = void 0;
4
- const winston_1 = require("winston");
5
- exports.logger = (0, winston_1.createLogger)({
6
- transports: [new winston_1.transports.Console()],
7
- format: winston_1.format.combine(winston_1.format.colorize(), winston_1.format.timestamp(), winston_1.format.printf(({ timestamp, level, message }) => {
8
- return `[${timestamp}] ${level}: ${message}`;
9
- })),
10
- });
11
- exports.logger.info("Hello world!");