90dc-core 1.7.1 → 1.7.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/nonconsprogram/NonConsumableProgram.d.ts +2 -0
- package/dist/lib/dbmodels/nonconsprogram/NonConsumableProgram.js +12 -0
- package/dist/lib/dbmodels/nonconsprogram/NonConsumableProgram.js.map +1 -1
- package/dist/lib/dbmodels/program/Program.js +4 -1
- package/dist/lib/dbmodels/program/Program.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/dbmodels/nonconsprogram/NonConsumableProgram.ts +6 -0
- package/src/lib/dbmodels/program/Program.ts +1 -1
|
@@ -16,6 +16,8 @@ export declare class NonConsumableProgram extends Model {
|
|
|
16
16
|
isFree: boolean;
|
|
17
17
|
productIdAndroid: string | null;
|
|
18
18
|
productIdIos: string | null;
|
|
19
|
+
header: string | null;
|
|
20
|
+
isCustom: boolean;
|
|
19
21
|
translatedPrograms: TranslatedConsumableProgram[];
|
|
20
22
|
users: PersistedUser[];
|
|
21
23
|
programs: Program[];
|
|
@@ -87,6 +87,18 @@ __decorate([
|
|
|
87
87
|
allowNull: true
|
|
88
88
|
})
|
|
89
89
|
], NonConsumableProgram.prototype, "productIdIos", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
Column({
|
|
92
|
+
type: DataType.TEXT,
|
|
93
|
+
allowNull: true
|
|
94
|
+
})
|
|
95
|
+
], NonConsumableProgram.prototype, "header", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
Column({
|
|
98
|
+
type: DataType.BOOLEAN,
|
|
99
|
+
defaultValue: false
|
|
100
|
+
})
|
|
101
|
+
], NonConsumableProgram.prototype, "isCustom", void 0);
|
|
90
102
|
__decorate([
|
|
91
103
|
HasMany(()=>TranslatedConsumableProgram)
|
|
92
104
|
], NonConsumableProgram.prototype, "translatedPrograms", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/dbmodels/nonconsprogram/NonConsumableProgram.ts"],"sourcesContent":["import {\n BelongsToMany,\n Column,\n DataType,\n Default,\n HasMany,\n Model,\n Table,\n} from \"sequelize-typescript\";\nimport {\n ConsumableProgramGoals,\n ConsumableProgramTypes,\n ConsumableProgramWeightGoals,\n} from \"../../enums/ProgramEnums\";\nimport { TranslatedConsumableProgram } from \"./TranslatedConsumableProgram\";\nimport { UserPrograms } from \"./UserNonConsumableProgram\";\nimport { PersistedUser } from \"../PersistedUser\";\nimport {Program} from \"../program/Program\";\n\n@Table\nexport class NonConsumableProgram 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 @Column({ type: DataType.TEXT, allowNull: false })\n declare title: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare description: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare coverImageUri: string;\n\n @Column({ type: DataType.INTEGER, allowNull: false })\n declare order: number;\n\n @Column({ type: DataType.INTEGER, allowNull: false, defaultValue: 0 })\n declare popularityOrder: number;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare weightGoal: ConsumableProgramWeightGoals;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare goal: ConsumableProgramGoals;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare type: ConsumableProgramTypes;\n\n @Column({ type: DataType.BOOLEAN, allowNull: false })\n declare isFree: boolean;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare productIdAndroid: string | null;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare productIdIos: string | null;\n\n @HasMany(() => TranslatedConsumableProgram)\n declare translatedPrograms: TranslatedConsumableProgram[];\n\n @BelongsToMany(() => PersistedUser, { through: () => UserPrograms })\n declare users: PersistedUser[];\n\n @HasMany(() => Program)\n declare programs: Program[];\n}\n"],"names":["BelongsToMany","Column","DataType","Default","HasMany","Model","Table","TranslatedConsumableProgram","UserPrograms","PersistedUser","Program","NonConsumableProgram","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","INTEGER","BOOLEAN","through"],"mappings":";;;;;;AAAA,SACEA,aAAa,EACbC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,OAAO,EACPC,KAAK,EACLC,KAAK,QACA,uBAAuB;AAM9B,SAASC,2BAA2B,QAAQ,gCAAgC;AAC5E,SAASC,YAAY,QAAQ,6BAA6B;AAC1D,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,OAAO,QAAO,qBAAqB;AAG5C,WAAaC,uBAAN,mCAAmCN;
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/dbmodels/nonconsprogram/NonConsumableProgram.ts"],"sourcesContent":["import {\n BelongsToMany,\n Column,\n DataType,\n Default,\n HasMany,\n Model,\n Table,\n} from \"sequelize-typescript\";\nimport {\n ConsumableProgramGoals,\n ConsumableProgramTypes,\n ConsumableProgramWeightGoals,\n} from \"../../enums/ProgramEnums\";\nimport { TranslatedConsumableProgram } from \"./TranslatedConsumableProgram\";\nimport { UserPrograms } from \"./UserNonConsumableProgram\";\nimport { PersistedUser } from \"../PersistedUser\";\nimport {Program} from \"../program/Program\";\n\n@Table\nexport class NonConsumableProgram 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 @Column({ type: DataType.TEXT, allowNull: false })\n declare title: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare description: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare coverImageUri: string;\n\n @Column({ type: DataType.INTEGER, allowNull: false })\n declare order: number;\n\n @Column({ type: DataType.INTEGER, allowNull: false, defaultValue: 0 })\n declare popularityOrder: number;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare weightGoal: ConsumableProgramWeightGoals;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare goal: ConsumableProgramGoals;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare type: ConsumableProgramTypes;\n\n @Column({ type: DataType.BOOLEAN, allowNull: false })\n declare isFree: boolean;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare productIdAndroid: string | null;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare productIdIos: string | null;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare header: string | null;\n\n @Column({ type: DataType.BOOLEAN, defaultValue: false })\n declare isCustom: boolean;\n\n @HasMany(() => TranslatedConsumableProgram)\n declare translatedPrograms: TranslatedConsumableProgram[];\n\n @BelongsToMany(() => PersistedUser, { through: () => UserPrograms })\n declare users: PersistedUser[];\n\n @HasMany(() => Program)\n declare programs: Program[];\n}\n"],"names":["BelongsToMany","Column","DataType","Default","HasMany","Model","Table","TranslatedConsumableProgram","UserPrograms","PersistedUser","Program","NonConsumableProgram","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","INTEGER","BOOLEAN","through"],"mappings":";;;;;;AAAA,SACEA,aAAa,EACbC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,OAAO,EACPC,KAAK,EACLC,KAAK,QACA,uBAAuB;AAM9B,SAASC,2BAA2B,QAAQ,gCAAgC;AAC5E,SAASC,YAAY,QAAQ,6BAA6B;AAC1D,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,OAAO,QAAO,qBAAqB;AAG5C,WAAaC,uBAAN,mCAAmCN;AAyD1C,EAAC;;IAxDEF,QAAQD,SAASU,MAAM;IACvBX,OAAO;QACNY,MAAMX,SAASY,IAAI;QACnBC,cAAcb,SAASY,IAAI;QAC3BE,WAAW,KAAK;QAChBC,YAAY,IAAI;IAClB;GAPWN;;IAUVV,OAAO;QAAEY,MAAMX,SAASgB,IAAI;QAAEF,WAAW,KAAK;IAAC;GAVrCL;;IAaVV,OAAO;QAAEY,MAAMX,SAASgB,IAAI;QAAEF,WAAW,KAAK;IAAC;GAbrCL;;IAgBVV,OAAO;QAAEY,MAAMX,SAASgB,IAAI;QAAEF,WAAW,KAAK;IAAC;GAhBrCL;;IAmBVV,OAAO;QAAEY,MAAMX,SAASiB,OAAO;QAAEH,WAAW,KAAK;IAAC;GAnBxCL;;IAsBVV,OAAO;QAAEY,MAAMX,SAASiB,OAAO;QAAEH,WAAW,KAAK;QAAED,cAAc;IAAE;GAtBzDJ;;IAyBVV,OAAO;QAAEY,MAAMX,SAASgB,IAAI;QAAEF,WAAW,KAAK;IAAC;GAzBrCL;;IA4BVV,OAAO;QAAEY,MAAMX,SAASgB,IAAI;QAAEF,WAAW,KAAK;IAAC;GA5BrCL;;IA+BVV,OAAO;QAAEY,MAAMX,SAASgB,IAAI;QAAEF,WAAW,KAAK;IAAC;GA/BrCL;;IAkCVV,OAAO;QAAEY,MAAMX,SAASkB,OAAO;QAAEJ,WAAW,KAAK;IAAC;GAlCxCL;;IAqCVV,OAAO;QAAEY,MAAMX,SAASgB,IAAI;QAAEF,WAAW,IAAI;IAAC;GArCpCL;;IAwCVV,OAAO;QAAEY,MAAMX,SAASgB,IAAI;QAAEF,WAAW,IAAI;IAAC;GAxCpCL;;IA2CVV,OAAO;QAAEY,MAAMX,SAASgB,IAAI;QAAEF,WAAW,IAAI;IAAC;GA3CpCL;;IA8CVV,OAAO;QAAEY,MAAMX,SAASkB,OAAO;QAAEL,cAAc,KAAK;IAAC;GA9C3CJ;;IAiDVP,QAAQ,IAAMG;GAjDJI;;IAoDVX,cAAc,IAAMS,eAAe;QAAEY,SAAS,IAAMb;IAAa;GApDvDG;;IAuDVP,QAAQ,IAAMM;GAvDJC;AAAAA;IADZL;GACYK"}
|
|
@@ -34,7 +34,10 @@ __decorate([
|
|
|
34
34
|
], Program.prototype, "userUuid", void 0);
|
|
35
35
|
__decorate([
|
|
36
36
|
ForeignKey(()=>NonConsumableProgram),
|
|
37
|
-
Column
|
|
37
|
+
Column({
|
|
38
|
+
type: DataType.UUID,
|
|
39
|
+
allowNull: true
|
|
40
|
+
})
|
|
38
41
|
], Program.prototype, "nonConsumableProgramUuid", void 0);
|
|
39
42
|
__decorate([
|
|
40
43
|
Column({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/dbmodels/program/Program.ts"],"sourcesContent":["import { Workout } from \"./Workout\";\nimport {\n BeforeDestroy, BelongsTo,\n Column,\n DataType,\n Default, ForeignKey,\n HasMany,\n Model,\n Table,\n} from \"sequelize-typescript\";\nimport {NonConsumableProgram} from \"../nonconsprogram/NonConsumableProgram\";\n\n@Table\nexport class Program extends Model<Program> {\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n defaultValue: DataType.UUID,\n allowNull: false,\n primaryKey: true,\n })\n declare programId: string;\n\n @Column({ type: DataType.UUID, allowNull: false })\n declare userUuid: string;\n\n @ForeignKey(() => NonConsumableProgram)\n @Column\n declare nonConsumableProgramUuid: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare startDate: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare programType: string;\n\n @Column({ type: DataType.DATE, allowNull: true })\n declare createdAt: Date;\n\n @HasMany(() => Workout, { foreignKey: \"programId\", onDelete: \"CASCADE\" })\n declare workout: Workout[];\n\n @BelongsTo(() => NonConsumableProgram)\n declare nonConsumableProgram: NonConsumableProgram;\n\n @BeforeDestroy\n static async deleteRelatedWorkouts(instance: Program) {\n const workouts = await instance.$get(\"workout\", { scope: \"workout\" });\n\n for (const workout of workouts) {\n await workout.destroy();\n }\n }\n}\n"],"names":["Workout","BeforeDestroy","BelongsTo","Column","DataType","Default","ForeignKey","HasMany","Model","Table","NonConsumableProgram","Program","deleteRelatedWorkouts","instance","workouts","$get","scope","workout","destroy","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","DATE","foreignKey","onDelete"],"mappings":";;;;;;AAAA,SAASA,OAAO,QAAQ,YAAY;AACpC,SACEC,aAAa,EAAEC,SAAS,EACxBC,MAAM,EACNC,QAAQ,EACRC,OAAO,EAAEC,UAAU,EACnBC,OAAO,EACPC,KAAK,EACLC,KAAK,QACA,uBAAuB;AAC9B,SAAQC,oBAAoB,QAAO,yCAAyC;AAG5E,WAAaC,UAAN,sBAAsBH;IAgC3B,aACaI,sBAAsBC,QAAiB,EAAE;QACpD,MAAMC,WAAW,MAAMD,SAASE,IAAI,CAAC,WAAW;YAAEC,OAAO;QAAU;QAEnE,KAAK,MAAMC,WAAWH,SAAU;YAC9B,MAAMG,QAAQC,OAAO;QACvB;IACF;AACF,EAAC;;IAvCEb,QAAQD,SAASe,MAAM;IACvBhB,OAAO;QACNiB,MAAMhB,SAASiB,IAAI;QACnBC,cAAclB,SAASiB,IAAI;QAC3BE,WAAW,KAAK;QAChBC,YAAY,IAAI;IAClB;GAPWb;;IAUVR,OAAO;QAAEiB,MAAMhB,SAASiB,IAAI;QAAEE,WAAW,KAAK;IAAC;GAVrCZ;;IAaVL,WAAW,IAAMI;IACjBP;
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/dbmodels/program/Program.ts"],"sourcesContent":["import { Workout } from \"./Workout\";\nimport {\n BeforeDestroy, BelongsTo,\n Column,\n DataType,\n Default, ForeignKey,\n HasMany,\n Model,\n Table,\n} from \"sequelize-typescript\";\nimport {NonConsumableProgram} from \"../nonconsprogram/NonConsumableProgram\";\n\n@Table\nexport class Program extends Model<Program> {\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n defaultValue: DataType.UUID,\n allowNull: false,\n primaryKey: true,\n })\n declare programId: string;\n\n @Column({ type: DataType.UUID, allowNull: false })\n declare userUuid: string;\n\n @ForeignKey(() => NonConsumableProgram)\n @Column({type: DataType.UUID, allowNull: true})\n declare nonConsumableProgramUuid: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare startDate: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare programType: string;\n\n @Column({ type: DataType.DATE, allowNull: true })\n declare createdAt: Date;\n\n @HasMany(() => Workout, { foreignKey: \"programId\", onDelete: \"CASCADE\" })\n declare workout: Workout[];\n\n @BelongsTo(() => NonConsumableProgram)\n declare nonConsumableProgram: NonConsumableProgram;\n\n @BeforeDestroy\n static async deleteRelatedWorkouts(instance: Program) {\n const workouts = await instance.$get(\"workout\", { scope: \"workout\" });\n\n for (const workout of workouts) {\n await workout.destroy();\n }\n }\n}\n"],"names":["Workout","BeforeDestroy","BelongsTo","Column","DataType","Default","ForeignKey","HasMany","Model","Table","NonConsumableProgram","Program","deleteRelatedWorkouts","instance","workouts","$get","scope","workout","destroy","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","DATE","foreignKey","onDelete"],"mappings":";;;;;;AAAA,SAASA,OAAO,QAAQ,YAAY;AACpC,SACEC,aAAa,EAAEC,SAAS,EACxBC,MAAM,EACNC,QAAQ,EACRC,OAAO,EAAEC,UAAU,EACnBC,OAAO,EACPC,KAAK,EACLC,KAAK,QACA,uBAAuB;AAC9B,SAAQC,oBAAoB,QAAO,yCAAyC;AAG5E,WAAaC,UAAN,sBAAsBH;IAgC3B,aACaI,sBAAsBC,QAAiB,EAAE;QACpD,MAAMC,WAAW,MAAMD,SAASE,IAAI,CAAC,WAAW;YAAEC,OAAO;QAAU;QAEnE,KAAK,MAAMC,WAAWH,SAAU;YAC9B,MAAMG,QAAQC,OAAO;QACvB;IACF;AACF,EAAC;;IAvCEb,QAAQD,SAASe,MAAM;IACvBhB,OAAO;QACNiB,MAAMhB,SAASiB,IAAI;QACnBC,cAAclB,SAASiB,IAAI;QAC3BE,WAAW,KAAK;QAChBC,YAAY,IAAI;IAClB;GAPWb;;IAUVR,OAAO;QAAEiB,MAAMhB,SAASiB,IAAI;QAAEE,WAAW,KAAK;IAAC;GAVrCZ;;IAaVL,WAAW,IAAMI;IACjBP,OAAO;QAACiB,MAAMhB,SAASiB,IAAI;QAAEE,WAAW,IAAI;IAAA;GAdlCZ;;IAiBVR,OAAO;QAAEiB,MAAMhB,SAASqB,IAAI;QAAEF,WAAW,KAAK;IAAC;GAjBrCZ;;IAoBVR,OAAO;QAAEiB,MAAMhB,SAASqB,IAAI;QAAEF,WAAW,IAAI;IAAC;GApBpCZ;;IAuBVR,OAAO;QAAEiB,MAAMhB,SAASsB,IAAI;QAAEH,WAAW,IAAI;IAAC;GAvBpCZ;;IA0BVJ,QAAQ,IAAMP,SAAS;QAAE2B,YAAY;QAAaC,UAAU;IAAU;GA1B5DjB;;IA6BVT,UAAU,IAAMQ;GA7BNC;;IAgCVV;GAhCUU;AAAAA;IADZF;GACYE"}
|
package/package.json
CHANGED
|
@@ -61,6 +61,12 @@ export class NonConsumableProgram extends Model {
|
|
|
61
61
|
@Column({ type: DataType.TEXT, allowNull: true })
|
|
62
62
|
declare productIdIos: string | null;
|
|
63
63
|
|
|
64
|
+
@Column({ type: DataType.TEXT, allowNull: true })
|
|
65
|
+
declare header: string | null;
|
|
66
|
+
|
|
67
|
+
@Column({ type: DataType.BOOLEAN, defaultValue: false })
|
|
68
|
+
declare isCustom: boolean;
|
|
69
|
+
|
|
64
70
|
@HasMany(() => TranslatedConsumableProgram)
|
|
65
71
|
declare translatedPrograms: TranslatedConsumableProgram[];
|
|
66
72
|
|
|
@@ -25,7 +25,7 @@ export class Program extends Model<Program> {
|
|
|
25
25
|
declare userUuid: string;
|
|
26
26
|
|
|
27
27
|
@ForeignKey(() => NonConsumableProgram)
|
|
28
|
-
@Column
|
|
28
|
+
@Column({type: DataType.UUID, allowNull: true})
|
|
29
29
|
declare nonConsumableProgramUuid: string;
|
|
30
30
|
|
|
31
31
|
@Column({ type: DataType.TEXT, allowNull: false })
|