90dc-core 1.6.2 → 1.6.4

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 (31) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +2 -0
  3. package/dist/index.js.map +1 -1
  4. package/dist/lib/dbmodels/PersistedUser.d.ts +1 -1
  5. package/dist/lib/dbmodels/PersistedUser.js +2 -5
  6. package/dist/lib/dbmodels/PersistedUser.js.map +1 -1
  7. package/dist/lib/dbmodels/Subscription.d.ts +14 -0
  8. package/dist/lib/dbmodels/Subscription.js +67 -0
  9. package/dist/lib/dbmodels/Subscription.js.map +1 -0
  10. package/dist/lib/dbmodels/SubscriptionLog.d.ts +8 -0
  11. package/dist/lib/dbmodels/SubscriptionLog.js +42 -0
  12. package/dist/lib/dbmodels/SubscriptionLog.js.map +1 -0
  13. package/dist/lib/dbmodels/program/ExerciseModels.d.ts +22 -0
  14. package/dist/lib/dbmodels/program/ExerciseModels.js +117 -0
  15. package/dist/lib/dbmodels/program/ExerciseModels.js.map +1 -0
  16. package/dist/lib/dbmodels/program/TranslatedExerciseModel.d.ts +24 -0
  17. package/dist/lib/dbmodels/program/TranslatedExerciseModel.js +123 -0
  18. package/dist/lib/dbmodels/program/TranslatedExerciseModel.js.map +1 -0
  19. package/dist/lib/models/ExerciseInterfaces.d.ts +54 -10
  20. package/dist/lib/models/ExerciseInterfaces.js.map +1 -1
  21. package/dist/lib/models/UserInterfaces.d.ts +0 -4
  22. package/dist/lib/models/UserInterfaces.js.map +1 -1
  23. package/package.json +1 -1
  24. package/src/index.ts +2 -0
  25. package/src/lib/dbmodels/PersistedUser.ts +3 -3
  26. package/src/lib/dbmodels/Subscription.ts +48 -0
  27. package/src/lib/dbmodels/SubscriptionLog.ts +35 -0
  28. package/src/lib/dbmodels/program/ExerciseModels.ts +63 -0
  29. package/src/lib/dbmodels/program/TranslatedExerciseModel.ts +66 -0
  30. package/src/lib/models/ExerciseInterfaces.ts +72 -15
  31. package/src/lib/models/UserInterfaces.ts +0 -5
package/dist/index.d.ts CHANGED
@@ -11,4 +11,6 @@ export * from "./lib/dbmodels/program/Program";
11
11
  export * from "./lib/dbmodels/program/Workout";
12
12
  export * from "./lib/dbmodels/program/Exercise";
13
13
  export * from "./lib/dbmodels/program/Superset";
14
+ export * from "./lib/dbmodels/Subscription";
15
+ export * from "./lib/dbmodels/SubscriptionLog";
14
16
  export * from "./lib/utils/Logger";
package/dist/index.js CHANGED
@@ -13,6 +13,8 @@ export * from "./lib/dbmodels/program/Program";
13
13
  export * from "./lib/dbmodels/program/Workout";
14
14
  export * from "./lib/dbmodels/program/Exercise";
15
15
  export * from "./lib/dbmodels/program/Superset";
16
+ export * from "./lib/dbmodels/Subscription";
17
+ export * from "./lib/dbmodels/SubscriptionLog";
16
18
  //Utils
17
19
  export * from "./lib/utils/Logger";
18
20
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["//Interfaces\nexport * from \"./lib/models/ProgramInterfaces\";\nexport * from \"./lib/models/ExerciseInterfaces\";\nexport * from \"./lib/models/WorkoutInterfaces\";\nexport * from \"./lib/models/UserInterfaces\";\n\n//DB Models\nexport * from \"./lib/dbmodels/UsersFriends\"\nexport * from \"./lib/dbmodels/PersistedUser\"\nexport * from \"./lib/dbmodels/UserBadges\"\nexport * from \"./lib/dbmodels/UserStreaks\"\nexport * from \"./lib/dbmodels/Badge\"\nexport * from \"./lib/dbmodels/program/Program\"\nexport * from \"./lib/dbmodels/program/Workout\"\nexport * from \"./lib/dbmodels/program/Exercise\"\nexport * from \"./lib/dbmodels/program/Superset\"\n\n//Utils\nexport * from \"./lib/utils/Logger\"\n"],"names":[],"mappings":"AAAA,YAAY;AACZ,cAAc,iCAAiC;AAC/C,cAAc,kCAAkC;AAChD,cAAc,iCAAiC;AAC/C,cAAc,8BAA8B;AAE5C,WAAW;AACX,cAAc,8BAA6B;AAC3C,cAAc,+BAA8B;AAC5C,cAAc,4BAA2B;AACzC,cAAc,6BAA4B;AAC1C,cAAc,uBAAsB;AACpC,cAAc,iCAAgC;AAC9C,cAAc,iCAAgC;AAC9C,cAAc,kCAAiC;AAC/C,cAAc,kCAAiC;AAE/C,OAAO;AACP,cAAc,qBAAoB"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["//Interfaces\nexport * from \"./lib/models/ProgramInterfaces\";\nexport * from \"./lib/models/ExerciseInterfaces\";\nexport * from \"./lib/models/WorkoutInterfaces\";\nexport * from \"./lib/models/UserInterfaces\";\n\n//DB Models\nexport * from \"./lib/dbmodels/UsersFriends\"\nexport * from \"./lib/dbmodels/PersistedUser\"\nexport * from \"./lib/dbmodels/UserBadges\"\nexport * from \"./lib/dbmodels/UserStreaks\"\nexport * from \"./lib/dbmodels/Badge\"\nexport * from \"./lib/dbmodels/program/Program\"\nexport * from \"./lib/dbmodels/program/Workout\"\nexport * from \"./lib/dbmodels/program/Exercise\"\nexport * from \"./lib/dbmodels/program/Superset\"\nexport * from \"./lib/dbmodels/Subscription\"\nexport * from \"./lib/dbmodels/SubscriptionLog\"\n\n//Utils\nexport * from \"./lib/utils/Logger\"\n"],"names":[],"mappings":"AAAA,YAAY;AACZ,cAAc,iCAAiC;AAC/C,cAAc,kCAAkC;AAChD,cAAc,iCAAiC;AAC/C,cAAc,8BAA8B;AAE5C,WAAW;AACX,cAAc,8BAA6B;AAC3C,cAAc,+BAA8B;AAC5C,cAAc,4BAA2B;AACzC,cAAc,6BAA4B;AAC1C,cAAc,uBAAsB;AACpC,cAAc,iCAAgC;AAC9C,cAAc,iCAAgC;AAC9C,cAAc,kCAAiC;AAC/C,cAAc,kCAAiC;AAC/C,cAAc,8BAA6B;AAC3C,cAAc,iCAAgC;AAE9C,OAAO;AACP,cAAc,qBAAoB"}
@@ -1,5 +1,5 @@
1
1
  import { Model } from "sequelize-typescript";
2
- import type { Subscription } from "../models/UserInterfaces";
2
+ import type { Subscription } from "./Subscription";
3
3
  export declare class PersistedUser extends Model {
4
4
  userUuid: string;
5
5
  email: string;
@@ -4,7 +4,7 @@ var __decorate = this && this.__decorate || function(decorators, target, key, de
4
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
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { Column, DataType, Default, Index, Model, Table } from "sequelize-typescript";
7
+ import { Column, DataType, Default, HasOne, Index, Model, Table } from "sequelize-typescript";
8
8
  export let PersistedUser = class PersistedUser extends Model {
9
9
  };
10
10
  __decorate([
@@ -181,10 +181,7 @@ __decorate([
181
181
  })
182
182
  ], PersistedUser.prototype, "changeUtilityEmail", void 0);
183
183
  __decorate([
184
- Column({
185
- type: DataType.JSONB,
186
- allowNull: true
187
- })
184
+ HasOne(()=>PersistedUser)
188
185
  ], PersistedUser.prototype, "subscription", void 0);
189
186
  PersistedUser = __decorate([
190
187
  Table
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/dbmodels/PersistedUser.ts"],"sourcesContent":["import { Column, DataType, Default, Index, Model, Table } from \"sequelize-typescript\";\nimport type { Subscription } from \"../models/UserInterfaces\";\n\n@Table\nexport class PersistedUser extends Model {\n\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n defaultValue: DataType.UUID,\n allowNull: false,\n primaryKey: true\n })\n declare userUuid: string;\n\n @Index\n @Column({ type: DataType.TEXT, allowNull: false, unique: false })\n declare email: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare password: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare firstName?: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare lastName?: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare avatar: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare sex: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare goal: string;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare isFreeVersion: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare allowsEmail: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare gotParentalConsent: boolean;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare weightGoal: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare role: 'default' | 'admin';\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare level: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare type: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare days: number;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare dateOfBirth: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare metricSystem: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare height: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare weight: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare activeProgramId: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare registrationDate: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare registrationService: 'apple' | 'google' | 'facebook' | 'native';\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare utilityEmail: string;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare emailConfirmed: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare utilityEmailConfirmed: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare changeEmail: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare changeUtilityEmail: boolean;\n\n @Column({ type: DataType.JSONB, allowNull: true })\n declare subscription: Subscription;\n}\n"],"names":["Column","DataType","Default","Index","Model","Table","PersistedUser","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","unique","BOOLEAN","JSONB"],"mappings":"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"}
1
+ {"version":3,"sources":["../../../src/lib/dbmodels/PersistedUser.ts"],"sourcesContent":["import {BelongsTo, Column, DataType, Default, HasOne, Index, Model, Table} from \"sequelize-typescript\";\nimport type { Subscription } from \"./Subscription\";\n\n@Table\nexport class PersistedUser extends Model {\n\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n defaultValue: DataType.UUID,\n allowNull: false,\n primaryKey: true\n })\n declare userUuid: string;\n\n @Index\n @Column({ type: DataType.TEXT, allowNull: false, unique: false })\n declare email: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare password: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare firstName?: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare lastName?: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare avatar: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare sex: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare goal: string;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare isFreeVersion: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare allowsEmail: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare gotParentalConsent: boolean;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare weightGoal: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare role: 'default' | 'admin';\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare level: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare type: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare days: number;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare dateOfBirth: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare metricSystem: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare height: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare weight: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare activeProgramId: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare registrationDate: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare registrationService: 'apple' | 'google' | 'facebook' | 'native';\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare utilityEmail: string;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare emailConfirmed: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare utilityEmailConfirmed: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare changeEmail: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare changeUtilityEmail: boolean;\n\n @HasOne(() => PersistedUser)\n declare subscription: Subscription;\n}\n"],"names":["Column","DataType","Default","HasOne","Index","Model","Table","PersistedUser","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","unique","BOOLEAN"],"mappings":"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"}
@@ -0,0 +1,14 @@
1
+ import { Model } from "sequelize-typescript";
2
+ import { SubscriptionLog } from "./SubscriptionLog";
3
+ import { PersistedUser } from "./PersistedUser";
4
+ export declare class Subscription extends Model {
5
+ userUuid: string;
6
+ identifier: string;
7
+ platform: "google" | "apple" | "mollie";
8
+ status: "active" | "canceled" | "expired";
9
+ type: string;
10
+ expiresOn: Date;
11
+ startDate: Date;
12
+ user: PersistedUser;
13
+ subscriptionLogs: SubscriptionLog[];
14
+ }
@@ -0,0 +1,67 @@
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, ForeignKey, HasMany, Model, PrimaryKey, Table } from "sequelize-typescript";
8
+ import { SubscriptionLog } from "./SubscriptionLog";
9
+ import { PersistedUser } from "./PersistedUser";
10
+ export let Subscription = class Subscription extends Model {
11
+ };
12
+ __decorate([
13
+ ForeignKey(()=>PersistedUser),
14
+ PrimaryKey,
15
+ Column({
16
+ type: DataType.UUID,
17
+ allowNull: false,
18
+ primaryKey: true
19
+ })
20
+ ], Subscription.prototype, "userUuid", void 0);
21
+ __decorate([
22
+ Column({
23
+ type: DataType.TEXT,
24
+ allowNull: false
25
+ })
26
+ ], Subscription.prototype, "identifier", void 0);
27
+ __decorate([
28
+ Column({
29
+ type: DataType.TEXT,
30
+ allowNull: false
31
+ })
32
+ ], Subscription.prototype, "platform", void 0);
33
+ __decorate([
34
+ Column({
35
+ type: DataType.TEXT,
36
+ allowNull: false
37
+ })
38
+ ], Subscription.prototype, "status", void 0);
39
+ __decorate([
40
+ Column({
41
+ type: DataType.TEXT,
42
+ allowNull: false
43
+ })
44
+ ], Subscription.prototype, "type", void 0);
45
+ __decorate([
46
+ Column({
47
+ type: DataType.DATE,
48
+ allowNull: false
49
+ })
50
+ ], Subscription.prototype, "expiresOn", void 0);
51
+ __decorate([
52
+ Column({
53
+ type: DataType.DATE,
54
+ allowNull: false
55
+ })
56
+ ], Subscription.prototype, "startDate", void 0);
57
+ __decorate([
58
+ BelongsTo(()=>PersistedUser)
59
+ ], Subscription.prototype, "user", void 0);
60
+ __decorate([
61
+ HasMany(()=>SubscriptionLog)
62
+ ], Subscription.prototype, "subscriptionLogs", void 0);
63
+ Subscription = __decorate([
64
+ Table
65
+ ], Subscription);
66
+
67
+ //# sourceMappingURL=Subscription.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/dbmodels/Subscription.ts"],"sourcesContent":["import {\n BelongsTo,\n Column,\n DataType,\n ForeignKey,\n HasMany,\n Model,\n PrimaryKey,\n Table,\n} from \"sequelize-typescript\";\nimport { SubscriptionLog } from \"./SubscriptionLog\";\nimport {PersistedUser} from \"./PersistedUser\";\n\n@Table\nexport class Subscription extends Model {\n @ForeignKey(() => PersistedUser)\n @PrimaryKey\n @Column({\n type: DataType.UUID,\n allowNull: false,\n primaryKey: true,\n })\n declare userUuid: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare identifier: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare platform: \"google\" | \"apple\" | \"mollie\";\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare status: \"active\" | \"canceled\" | \"expired\";\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare type: string;\n\n @Column({ type: DataType.DATE, allowNull: false })\n declare expiresOn: Date;\n\n @Column({ type: DataType.DATE, allowNull: false })\n declare startDate: Date;\n\n @BelongsTo(() => PersistedUser)\n declare user: PersistedUser;\n\n @HasMany(() => SubscriptionLog)\n declare subscriptionLogs: SubscriptionLog[];\n}\n"],"names":["BelongsTo","Column","DataType","ForeignKey","HasMany","Model","PrimaryKey","Table","SubscriptionLog","PersistedUser","Subscription","type","UUID","allowNull","primaryKey","TEXT","DATE"],"mappings":";;;;;;AAAA,SACEA,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,UAAU,EACVC,OAAO,EACPC,KAAK,EACLC,UAAU,EACVC,KAAK,QACA,uBAAuB;AAC9B,SAASC,eAAe,QAAQ,oBAAoB;AACpD,SAAQC,aAAa,QAAO,kBAAkB;AAG9C,WAAaC,eAAN,2BAA2BL;AAiClC,EAAC;;IAhCEF,WAAW,IAAMM;IACjBH;IACAL,OAAO;QACNU,MAAMT,SAASU,IAAI;QACnBC,WAAW,KAAK;QAChBC,YAAY,IAAI;IAClB;GAPWJ;;IAUVT,OAAO;QAAEU,MAAMT,SAASa,IAAI;QAAEF,WAAW,KAAK;IAAC;GAVrCH;;IAaVT,OAAO;QAAEU,MAAMT,SAASa,IAAI;QAAEF,WAAW,KAAK;IAAC;GAbrCH;;IAgBVT,OAAO;QAAEU,MAAMT,SAASa,IAAI;QAAEF,WAAW,KAAK;IAAC;GAhBrCH;;IAmBVT,OAAO;QAAEU,MAAMT,SAASa,IAAI;QAAEF,WAAW,KAAK;IAAC;GAnBrCH;;IAsBVT,OAAO;QAAEU,MAAMT,SAASc,IAAI;QAAEH,WAAW,KAAK;IAAC;GAtBrCH;;IAyBVT,OAAO;QAAEU,MAAMT,SAASc,IAAI;QAAEH,WAAW,KAAK;IAAC;GAzBrCH;;IA4BVV,UAAU,IAAMS;GA5BNC;;IA+BVN,QAAQ,IAAMI;GA/BJE;AAAAA;IADZH;GACYG"}
@@ -0,0 +1,8 @@
1
+ import { Model } from "sequelize-typescript";
2
+ import { Subscription } from "./Subscription";
3
+ export declare class SubscriptionLog extends Model {
4
+ uuid: string;
5
+ subscriptionUuid: string;
6
+ action: string;
7
+ subscription: Subscription;
8
+ }
@@ -0,0 +1,42 @@
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, Table } from "sequelize-typescript";
8
+ import { Subscription } from "./Subscription";
9
+ export let SubscriptionLog = class SubscriptionLog 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
+ ], SubscriptionLog.prototype, "uuid", void 0);
20
+ __decorate([
21
+ ForeignKey(()=>Subscription),
22
+ Column({
23
+ type: DataType.UUID,
24
+ allowNull: false
25
+ })
26
+ ], SubscriptionLog.prototype, "subscriptionUuid", void 0);
27
+ __decorate([
28
+ Column({
29
+ type: DataType.TEXT,
30
+ allowNull: false
31
+ })
32
+ ], SubscriptionLog.prototype, "action", void 0);
33
+ __decorate([
34
+ BelongsTo(()=>Subscription)
35
+ ], SubscriptionLog.prototype, "subscription", void 0);
36
+ SubscriptionLog = __decorate([
37
+ Table({
38
+ timestamps: true
39
+ })
40
+ ], SubscriptionLog);
41
+
42
+ //# sourceMappingURL=SubscriptionLog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/dbmodels/SubscriptionLog.ts"],"sourcesContent":["import {\n BelongsTo,\n Column,\n DataType,\n Default,\n ForeignKey,\n Model,\n Table,\n} from \"sequelize-typescript\";\nimport { Subscription } from \"./Subscription\";\n\n@Table({ timestamps: true })\nexport class SubscriptionLog extends Model {\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 @ForeignKey(() => Subscription)\n @Column({\n type: DataType.UUID,\n allowNull: false,\n })\n declare subscriptionUuid: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare action: string;\n\n @BelongsTo(() => Subscription)\n declare subscription: Subscription;\n}\n"],"names":["BelongsTo","Column","DataType","Default","ForeignKey","Model","Table","Subscription","SubscriptionLog","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","timestamps"],"mappings":";;;;;;AAAA,SACEA,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,UAAU,EACVC,KAAK,EACLC,KAAK,QACA,uBAAuB;AAC9B,SAASC,YAAY,QAAQ,iBAAiB;AAG9C,WAAaC,kBAAN,8BAA8BH;AAsBrC,EAAC;;IArBEF,QAAQD,SAASO,MAAM;IACvBR,OAAO;QACNS,MAAMR,SAASS,IAAI;QACnBC,cAAcV,SAASS,IAAI;QAC3BE,WAAW,KAAK;QAChBC,YAAY,IAAI;IAClB;GAPWN;;IAUVJ,WAAW,IAAMG;IACjBN,OAAO;QACNS,MAAMR,SAASS,IAAI;QACnBE,WAAW,KAAK;IAClB;GAdWL;;IAiBVP,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF,WAAW,KAAK;IAAC;GAjBrCL;;IAoBVR,UAAU,IAAMO;GApBNC;AAAAA;IADZF,MAAM;QAAEU,YAAY,IAAI;IAAC;GACbR"}
@@ -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
- export type ProgramTypes = "BodyweightHomeWorkout" | "BodyweightOnlyBodyweight" | "BodyweightWeightedCali" | "Weights" | "Both";
2
- export interface GraphProgress extends Progress {
3
- date: string;
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 Progress {
6
- [key: string]: number | string | undefined;
17
+ export interface ExerciseProgress {
18
+ exerciseUuid: string;
19
+ progress: Progress[];
7
20
  }
8
- export interface ExerciseOptions {
9
- sets: string;
10
- reps: string;
11
- order: number;
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: 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":["export type ProgramTypes =\n | \"BodyweightHomeWorkout\"\n | \"BodyweightOnlyBodyweight\"\n | \"BodyweightWeightedCali\"\n | \"Weights\"\n | \"Both\";\n\nexport interface GraphProgress extends Progress {\n date: string;\n}\nexport interface Progress {\n [key: string]: number | string | undefined;\n}\nexport interface ExerciseOptions {\n sets: string;\n reps: string;\n order: number;\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"],"names":[],"mappings":"AAAA,WA0BC"}
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"}
@@ -23,10 +23,6 @@ export interface UserInfoModel {
23
23
  height: string;
24
24
  weight: string;
25
25
  }
26
- export interface Subscription {
27
- type: "android" | "ios";
28
- [key: string]: string;
29
- }
30
26
  export interface SingleTransactionResponse {
31
27
  revision: string;
32
28
  bundleId: string;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/models/UserInterfaces.ts"],"sourcesContent":["import type jwt from \"jsonwebtoken\";\n\nexport interface UserTypes {\n userUuid: string;\n email: string;\n firstName: string;\n lastName: string;\n avatar: string;\n role: string;\n}\n\nexport interface VerificationStatus {\n status: string;\n}\n\nexport interface TransactionsResponse {\n revision: string;\n bundleId: string;\n environment: string;\n hasMore: boolean;\n signedTransactions: string[];\n errorCode?: number;\n}\n\nexport interface UserInfoModel {\n userUuid: string;\n height: string;\n weight: string;\n}\n\nexport interface Subscription {\n type: \"android\" | \"ios\",\n [key: string]: string;\n}\n\nexport interface SingleTransactionResponse {\n revision: string;\n bundleId: string;\n environment: string;\n hasMore: boolean;\n signedTransactionInfo: string;\n errorCode?: number;\n}\n\nexport interface SubscriptionStatus {\n originalTransactionId: string;\n status: number;\n signedTransactionInfo: string;\n signedRenewalInfo: string;\n}\n\nexport interface SubscriptionStatusResponse {\n environment: string;\n bundleId: string;\n data: [\n {\n subscriptionGroupIdentifier: string;\n lastTransactions: SubscriptionStatus[];\n }\n ];\n errorCode?: number;\n}\n\nexport interface SubscriptionStatusResponseError {\n errorCode: number;\n errorMessage: string;\n}\n\nexport interface SubscriptionStatusResult {\n originalTransactionId: string;\n status: number;\n signedTransactionInfo: string | jwt.JwtPayload | null;\n signedRenewalInfo: string | jwt.JwtPayload | null;\n}\n\nexport interface SignedTransactions {\n transactionId: string;\n originalTransactionId: string;\n webOrderLineItemId: string;\n bundleId: string;\n productId: string;\n subscriptionGroupIdentifier: string;\n purchaseDate: number;\n originalPurchaseDate: number;\n expiresDate: number;\n quantity: number;\n type: string;\n inAppOwnershipType: string;\n signedDate: number;\n environment: string;\n transactionReason: string;\n storefront: string;\n storefrontId: string;\n}\n\nexport interface Credentials {\n refresh_token?: string | null,\n expiry_date?: number | null,\n access_token?: string | null,\n token_type?: string | null ,\n id_token?: string | null,\n scope?: string\n}\n\n\nexport interface LoginRequest {\n email: string;\n password: string;\n}\n\nexport interface UserPhotoRequest {\n base64: string;\n}\n\nexport interface ProgressPhoto {\n date: Date;\n progressPhoto: string;\n userUuid: string;\n}\n\nexport interface ForgotPassword {\n uuid: string;\n userUuid: string;\n token: string;\n date: Date;\n}\n\nexport interface RefreshPayload {\n userUuid: string;\n}\n\nexport interface TokenRequest {\n token: string;\n}\n\nexport interface RefreshRequest {\n refreshToken: string;\n}\n\nexport interface UuidRequest {\n userUuid: string;\n}\n\nexport interface EmailRequest {\n email: string;\n}\n\nexport interface TitleRequest {\n title: string;\n}\n\nexport interface UserPhoto {\n base64: string;\n title: string;\n}\n\nexport default interface AuthenticationToken {\n type: string;\n contents: string;\n}\n\nexport interface RestorePasswordRequest {\n email: string;\n}\n\nexport interface BeforeSubscriptionOptions {\n firstName: string;\n lastName: string;\n sex: string;\n goal: string;\n weightGoal: string;\n level: string;\n type: string;\n days: number;\n}\n\nexport interface AfterSubscriptionOptions {\n dateOfBirth: string;\n metricSystem: string;\n height: string;\n weight: string;\n}\n"],"names":[],"mappings":"AAAA,WAqLC"}
1
+ {"version":3,"sources":["../../../src/lib/models/UserInterfaces.ts"],"sourcesContent":["import type jwt from \"jsonwebtoken\";\n\nexport interface UserTypes {\n userUuid: string;\n email: string;\n firstName: string;\n lastName: string;\n avatar: string;\n role: string;\n}\n\nexport interface VerificationStatus {\n status: string;\n}\n\nexport interface TransactionsResponse {\n revision: string;\n bundleId: string;\n environment: string;\n hasMore: boolean;\n signedTransactions: string[];\n errorCode?: number;\n}\n\nexport interface UserInfoModel {\n userUuid: string;\n height: string;\n weight: string;\n}\n\nexport interface SingleTransactionResponse {\n revision: string;\n bundleId: string;\n environment: string;\n hasMore: boolean;\n signedTransactionInfo: string;\n errorCode?: number;\n}\n\nexport interface SubscriptionStatus {\n originalTransactionId: string;\n status: number;\n signedTransactionInfo: string;\n signedRenewalInfo: string;\n}\n\nexport interface SubscriptionStatusResponse {\n environment: string;\n bundleId: string;\n data: [\n {\n subscriptionGroupIdentifier: string;\n lastTransactions: SubscriptionStatus[];\n }\n ];\n errorCode?: number;\n}\n\nexport interface SubscriptionStatusResponseError {\n errorCode: number;\n errorMessage: string;\n}\n\nexport interface SubscriptionStatusResult {\n originalTransactionId: string;\n status: number;\n signedTransactionInfo: string | jwt.JwtPayload | null;\n signedRenewalInfo: string | jwt.JwtPayload | null;\n}\n\nexport interface SignedTransactions {\n transactionId: string;\n originalTransactionId: string;\n webOrderLineItemId: string;\n bundleId: string;\n productId: string;\n subscriptionGroupIdentifier: string;\n purchaseDate: number;\n originalPurchaseDate: number;\n expiresDate: number;\n quantity: number;\n type: string;\n inAppOwnershipType: string;\n signedDate: number;\n environment: string;\n transactionReason: string;\n storefront: string;\n storefrontId: string;\n}\n\nexport interface Credentials {\n refresh_token?: string | null,\n expiry_date?: number | null,\n access_token?: string | null,\n token_type?: string | null ,\n id_token?: string | null,\n scope?: string\n}\n\n\nexport interface LoginRequest {\n email: string;\n password: string;\n}\n\nexport interface UserPhotoRequest {\n base64: string;\n}\n\nexport interface ProgressPhoto {\n date: Date;\n progressPhoto: string;\n userUuid: string;\n}\n\nexport interface ForgotPassword {\n uuid: string;\n userUuid: string;\n token: string;\n date: Date;\n}\n\nexport interface RefreshPayload {\n userUuid: string;\n}\n\nexport interface TokenRequest {\n token: string;\n}\n\nexport interface RefreshRequest {\n refreshToken: string;\n}\n\nexport interface UuidRequest {\n userUuid: string;\n}\n\nexport interface EmailRequest {\n email: string;\n}\n\nexport interface TitleRequest {\n title: string;\n}\n\nexport interface UserPhoto {\n base64: string;\n title: string;\n}\n\nexport default interface AuthenticationToken {\n type: string;\n contents: string;\n}\n\nexport interface RestorePasswordRequest {\n email: string;\n}\n\nexport interface BeforeSubscriptionOptions {\n firstName: string;\n lastName: string;\n sex: string;\n goal: string;\n weightGoal: string;\n level: string;\n type: string;\n days: number;\n}\n\nexport interface AfterSubscriptionOptions {\n dateOfBirth: string;\n metricSystem: string;\n height: string;\n weight: string;\n}\n"],"names":[],"mappings":"AAAA,WAgLC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "90dc-core",
3
- "version": "1.6.2",
3
+ "version": "1.6.4",
4
4
  "description": "A package that contains utils and interfaces used to create 90dc",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -14,6 +14,8 @@ export * from "./lib/dbmodels/program/Program"
14
14
  export * from "./lib/dbmodels/program/Workout"
15
15
  export * from "./lib/dbmodels/program/Exercise"
16
16
  export * from "./lib/dbmodels/program/Superset"
17
+ export * from "./lib/dbmodels/Subscription"
18
+ export * from "./lib/dbmodels/SubscriptionLog"
17
19
 
18
20
  //Utils
19
21
  export * from "./lib/utils/Logger"
@@ -1,5 +1,5 @@
1
- import { Column, DataType, Default, Index, Model, Table } from "sequelize-typescript";
2
- import type { Subscription } from "../models/UserInterfaces";
1
+ import {BelongsTo, Column, DataType, Default, HasOne, Index, Model, Table} from "sequelize-typescript";
2
+ import type { Subscription } from "./Subscription";
3
3
 
4
4
  @Table
5
5
  export class PersistedUser extends Model {
@@ -95,6 +95,6 @@ export class PersistedUser extends Model {
95
95
  @Column({ type: DataType.BOOLEAN, allowNull: true })
96
96
  declare changeUtilityEmail: boolean;
97
97
 
98
- @Column({ type: DataType.JSONB, allowNull: true })
98
+ @HasOne(() => PersistedUser)
99
99
  declare subscription: Subscription;
100
100
  }
@@ -0,0 +1,48 @@
1
+ import {
2
+ BelongsTo,
3
+ Column,
4
+ DataType,
5
+ ForeignKey,
6
+ HasMany,
7
+ Model,
8
+ PrimaryKey,
9
+ Table,
10
+ } from "sequelize-typescript";
11
+ import { SubscriptionLog } from "./SubscriptionLog";
12
+ import {PersistedUser} from "./PersistedUser";
13
+
14
+ @Table
15
+ export class Subscription extends Model {
16
+ @ForeignKey(() => PersistedUser)
17
+ @PrimaryKey
18
+ @Column({
19
+ type: DataType.UUID,
20
+ allowNull: false,
21
+ primaryKey: true,
22
+ })
23
+ declare userUuid: string;
24
+
25
+ @Column({ type: DataType.TEXT, allowNull: false })
26
+ declare identifier: string;
27
+
28
+ @Column({ type: DataType.TEXT, allowNull: false })
29
+ declare platform: "google" | "apple" | "mollie";
30
+
31
+ @Column({ type: DataType.TEXT, allowNull: false })
32
+ declare status: "active" | "canceled" | "expired";
33
+
34
+ @Column({ type: DataType.TEXT, allowNull: false })
35
+ declare type: string;
36
+
37
+ @Column({ type: DataType.DATE, allowNull: false })
38
+ declare expiresOn: Date;
39
+
40
+ @Column({ type: DataType.DATE, allowNull: false })
41
+ declare startDate: Date;
42
+
43
+ @BelongsTo(() => PersistedUser)
44
+ declare user: PersistedUser;
45
+
46
+ @HasMany(() => SubscriptionLog)
47
+ declare subscriptionLogs: SubscriptionLog[];
48
+ }
@@ -0,0 +1,35 @@
1
+ import {
2
+ BelongsTo,
3
+ Column,
4
+ DataType,
5
+ Default,
6
+ ForeignKey,
7
+ Model,
8
+ Table,
9
+ } from "sequelize-typescript";
10
+ import { Subscription } from "./Subscription";
11
+
12
+ @Table({ timestamps: true })
13
+ export class SubscriptionLog extends Model {
14
+ @Default(DataType.UUIDV4)
15
+ @Column({
16
+ type: DataType.UUID,
17
+ defaultValue: DataType.UUID,
18
+ allowNull: false,
19
+ primaryKey: true,
20
+ })
21
+ declare uuid: string;
22
+
23
+ @ForeignKey(() => Subscription)
24
+ @Column({
25
+ type: DataType.UUID,
26
+ allowNull: false,
27
+ })
28
+ declare subscriptionUuid: string;
29
+
30
+ @Column({ type: DataType.TEXT, allowNull: false })
31
+ declare action: string;
32
+
33
+ @BelongsTo(() => Subscription)
34
+ declare subscription: Subscription;
35
+ }
@@ -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
- export type ProgramTypes =
2
- | "BodyweightHomeWorkout"
3
- | "BodyweightOnlyBodyweight"
4
- | "BodyweightWeightedCali"
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 GraphProgress extends Progress {
9
- date: string;
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
- export interface Progress {
12
- [key: string]: number | string | undefined;
18
+
19
+ export interface ExerciseProgress {
20
+ exerciseUuid: string;
21
+ progress: Progress[];
13
22
  }
14
- export interface ExerciseOptions {
15
- sets: string;
16
- reps: string;
17
- order: number;
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: 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
+ }
@@ -28,11 +28,6 @@ export interface UserInfoModel {
28
28
  weight: string;
29
29
  }
30
30
 
31
- export interface Subscription {
32
- type: "android" | "ios",
33
- [key: string]: string;
34
- }
35
-
36
31
  export interface SingleTransactionResponse {
37
32
  revision: string;
38
33
  bundleId: string;