90dc-core 1.9.4 → 1.9.5

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.
@@ -32,4 +32,7 @@ export declare class PersistedUser extends Model {
32
32
  changeUtilityEmail: boolean;
33
33
  subscription: Subscription;
34
34
  nonConsumablePrograms: NonConsumableProgram[];
35
+ coachUuid?: string;
36
+ coach?: PersistedUser;
37
+ clients?: PersistedUser[];
35
38
  }
@@ -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 { BelongsToMany, Column, DataType, Default, HasOne, Index, Model, Table } from "sequelize-typescript";
7
+ import { BelongsTo, BelongsToMany, Column, DataType, Default, HasMany, HasOne, Index, Model, Table } from "sequelize-typescript";
8
8
  import { Subscription } from "./Subscription";
9
9
  import { UserPrograms } from "./nonconsprogram/UserNonConsumableProgram";
10
10
  import { NonConsumableProgram } from "./nonconsprogram/NonConsumableProgram";
@@ -191,6 +191,18 @@ __decorate([
191
191
  through: ()=>UserPrograms
192
192
  })
193
193
  ], PersistedUser.prototype, "nonConsumablePrograms", void 0);
194
+ __decorate([
195
+ Column({
196
+ type: DataType.UUID,
197
+ allowNull: true
198
+ })
199
+ ], PersistedUser.prototype, "coachUuid", void 0);
200
+ __decorate([
201
+ BelongsTo(()=>PersistedUser, 'coachUuid')
202
+ ], PersistedUser.prototype, "coach", void 0);
203
+ __decorate([
204
+ HasMany(()=>PersistedUser, 'coachUuid')
205
+ ], PersistedUser.prototype, "clients", void 0);
194
206
  PersistedUser = __decorate([
195
207
  Table
196
208
  ], PersistedUser);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/dbmodels/PersistedUser.ts"],"sourcesContent":["import {BelongsToMany, Column, DataType, Default, HasOne, Index, Model, Table} from \"sequelize-typescript\";\nimport { Subscription } from \"./Subscription\";\nimport {UserPrograms} from \"./nonconsprogram/UserNonConsumableProgram\";\nimport {NonConsumableProgram} from \"./nonconsprogram/NonConsumableProgram\";\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(() => Subscription)\n declare subscription: Subscription;\n\n @BelongsToMany(() => NonConsumableProgram, { through: () => UserPrograms })\n declare nonConsumablePrograms: NonConsumableProgram[];\n}\n"],"names":["BelongsToMany","Column","DataType","Default","HasOne","Index","Model","Table","Subscription","UserPrograms","NonConsumableProgram","PersistedUser","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","unique","BOOLEAN","through"],"mappings":";;;;;;AAAA,SAAQA,aAAa,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEC,KAAK,QAAO,uBAAuB;AAC3G,SAAUC,YAAY,QAAQ,iBAAiB;AAC/C,SAAQC,YAAY,QAAO,4CAA4C;AACvE,SAAQC,oBAAoB,QAAO,wCAAwC;AAG3E,WAAaC,gBAAN,4BAA4BL;AAkGnC,EAAC;;IAhGEH,QAAQD,SAASU,MAAM;IACvBX,OAAO;QACNY,MAAMX,SAASY,IAAI;QACnBC,cAAcb,SAASY,IAAI;QAC3BE,WAAW,KAAK;QAChBC,YAAY,IAAI;IAClB;GARWN;;IAWVN;IACAJ,OAAO;QAAEY,MAAMX,SAASgB,IAAI;QAAEF,WAAW,KAAK;QAAEG,QAAQ,KAAK;IAAC;GAZpDR;;IAeVV,OAAO;QAAEY,MAAMX,SAASgB,IAAI;QAAEF,WAAW,KA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AI;QAAEF,WAAW,IAAI;IAAC;GA/DpCL;;IAkEVV,OAAO;QAAEY,MAAMX,SAASgB,IAAI;QAAEF,WAAW,IAAI;IAAC;GAlEpCL;;IAqEVV,OAAO;QAAEY,MAAMX,SAASgB,IAAI;QAAEF,WAAW,IAAI;IAAC;GArEpCL;;IAwEVV,OAAO;QAAEY,MAAMX,SAASgB,IAAI;QAAEF,WAAW,IAAI;IAAC;GAxEpCL;;IA2EVV,OAAO;QAAEY,MAAMX,SAASgB,IAAI;QAAEF,WAAW,IAAI;IAAC;GA3EpCL;;IA8EVV,OAAO;QAAEY,MAAMX,SAASgB,IAAI;QAAEF,WAAW,IAAI;IAAC;GA9EpCL;;IAiFVV,OAAO;QAAEY,MAAMX,SAASkB,OAAO;QAAEJ,WAAW,IAAI;IAAC;GAjFvCL;;IAoFVV,OAAO;QAAEY,MAAMX,SAASkB,OAAO;QAAEJ,WAAW,IAAI;IAAC;GApFvCL;;IAuFVV,OAAO;QAAEY,MAAMX,SAASkB,OAAO;QAAEJ,WAAW,IAAI;IAAC;GAvFvCL;;IA0FVV,OAAO;QAAEY,MAAMX,SAASkB,OAAO;QAAEJ,WAAW,IAAI;IAAC;GA1FvCL;;IA6FVP,OAAO,IAAMI;GA7FHG;;IAgGVX,cAAc,IAAMU,sBAAsB;QAAEW,SAAS,IAAMZ;IAAa;GAhG9DE;AAAAA;IADZJ;GACYI"}
1
+ {"version":3,"sources":["../../../src/lib/dbmodels/PersistedUser.ts"],"sourcesContent":["import {\n BelongsTo,\n BelongsToMany,\n Column,\n DataType,\n Default,\n HasMany,\n HasOne,\n Index,\n Model,\n Table\n} from \"sequelize-typescript\";\nimport { Subscription } from \"./Subscription\";\nimport {UserPrograms} from \"./nonconsprogram/UserNonConsumableProgram\";\nimport {NonConsumableProgram} from \"./nonconsprogram/NonConsumableProgram\";\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(() => Subscription)\n declare subscription: Subscription;\n\n @BelongsToMany(() => NonConsumableProgram, { through: () => UserPrograms })\n declare nonConsumablePrograms: NonConsumableProgram[];\n\n @Column({ type: DataType.UUID, allowNull: true })\n declare coachUuid?: string;\n\n @BelongsTo(() => PersistedUser, 'coachUuid')\n declare coach?: PersistedUser;\n\n @HasMany(() => PersistedUser, 'coachUuid')\n declare clients?: PersistedUser[];\n}\n"],"names":["BelongsTo","BelongsToMany","Column","DataType","Default","HasMany","HasOne","Index","Model","Table","Subscription","UserPrograms","NonConsumableProgram","PersistedUser","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","unique","BOOLEAN","through"],"mappings":";;;;;;AAAA,SACEA,SAAS,EACTC,aAAa,EACbC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,OAAO,EACPC,MAAM,EACNC,KAAK,EACLC,KAAK,EACLC,KAAK,QACA,uBAAuB;AAC9B,SAAUC,YAAY,QAAQ,iBAAiB;AAC/C,SAAQC,YAAY,QAAO,4CAA4C;AACvE,SAAQC,oBAAoB,QAAO,wCAAwC;AAG3E,WAAaC,gBAAN,4BAA4BL;AA2GnC,EAAC;;IAzGEJ,QAAQD,SAASW,MAAM;IACvBZ,OAAO;QACNa,MAAMZ,SAASa,IAAI;QACnBC,cAAcd,SAASa,IAAI;QAC3BE,WAAW,KAAK;QAChBC,YAAY,IAAI;IAClB;GARWN;;IAWVN;IACAL,OAAO;QAAEa,MAAMZ,SAASiB,IAAI;QAAEF,WAAW,KAAK;QAAEG,QAAQ,KAAK;IAAC;GAZpDR;;IAeVX,OAAO;QAAEa,MAAMZ,SAASiB,IAAI;QAAEF,WAAW,KAAK;IAAC;GAfrCL;;IAkBVX,OAAO;QAAEa,MAAMZ,SAASiB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L;;IAkEVX,OAAO;QAAEa,MAAMZ,SAASiB,IAAI;QAAEF,WAAW,IAAI;IAAC;GAlEpCL;;IAqEVX,OAAO;QAAEa,MAAMZ,SAASiB,IAAI;QAAEF,WAAW,IAAI;IAAC;GArEpCL;;IAwEVX,OAAO;QAAEa,MAAMZ,SAASiB,IAAI;QAAEF,WAAW,IAAI;IAAC;GAxEpCL;;IA2EVX,OAAO;QAAEa,MAAMZ,SAASiB,IAAI;QAAEF,WAAW,IAAI;IAAC;GA3EpCL;;IA8EVX,OAAO;QAAEa,MAAMZ,SAASiB,IAAI;QAAEF,WAAW,IAAI;IAAC;GA9EpCL;;IAiFVX,OAAO;QAAEa,MAAMZ,SAASmB,OAAO;QAAEJ,WAAW,IAAI;IAAC;GAjFvCL;;IAoFVX,OAAO;QAAEa,MAAMZ,SAASmB,OAAO;QAAEJ,WAAW,IAAI;IAAC;GApFvCL;;IAuFVX,OAAO;QAAEa,MAAMZ,SAASmB,OAAO;QAAEJ,WAAW,IAAI;IAAC;GAvFvCL;;IA0FVX,OAAO;QAAEa,MAAMZ,SAASmB,OAAO;QAAEJ,WAAW,IAAI;IAAC;GA1FvCL;;IA6FVP,OAAO,IAAMI;GA7FHG;;IAgGVZ,cAAc,IAAMW,sBAAsB;QAAEW,SAAS,IAAMZ;IAAa;GAhG9DE;;IAmGVX,OAAO;QAAEa,MAAMZ,SAASa,IAAI;QAAEE,WAAW,IAAI;IAAC;GAnGpCL;;IAsGVb,UAAU,IAAMa,eAAe;GAtGrBA;;IAyGVR,QAAQ,IAAMQ,eAAe;GAzGnBA;AAAAA;IADZJ;GACYI"}
@@ -0,0 +1,5 @@
1
+ import { Model } from "sequelize-typescript";
2
+ export declare class UserCoach extends Model {
3
+ userUuid: string;
4
+ coachUuid: string;
5
+ }
@@ -0,0 +1,23 @@
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, ForeignKey, Model, Table } from "sequelize-typescript";
8
+ import { PersistedUser } from "./PersistedUser";
9
+ export let UserCoach = class UserCoach extends Model {
10
+ };
11
+ __decorate([
12
+ ForeignKey(()=>PersistedUser),
13
+ Column(DataType.UUID)
14
+ ], UserCoach.prototype, "userUuid", void 0);
15
+ __decorate([
16
+ ForeignKey(()=>PersistedUser),
17
+ Column(DataType.UUID)
18
+ ], UserCoach.prototype, "coachUuid", void 0);
19
+ UserCoach = __decorate([
20
+ Table
21
+ ], UserCoach);
22
+
23
+ //# sourceMappingURL=UserCoach.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/dbmodels/UserCoach.ts"],"sourcesContent":["import { Column, DataType, ForeignKey, Model, Table } from \"sequelize-typescript\";\nimport { PersistedUser } from \"./PersistedUser\";\n\n@Table\nexport class UserCoach extends Model {\n @ForeignKey(() => PersistedUser)\n @Column(DataType.UUID)\n declare userUuid: string;\n\n @ForeignKey(() => PersistedUser)\n @Column(DataType.UUID)\n declare coachUuid: string;\n}\n"],"names":["Column","DataType","ForeignKey","Model","Table","PersistedUser","UserCoach","UUID"],"mappings":";;;;;;AAAA,SAASA,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAClF,SAASC,aAAa,QAAQ,kBAAkB;AAGhD,WAAaC,YAAN,wBAAwBH;AAQ/B,EAAC;;IAPID,WAAW,IAAMG;IACjBL,OAAOC,SAASM,IAAI;GAFZD;;IAKRJ,WAAW,IAAMG;IACjBL,OAAOC,SAASM,IAAI;GANZD;AAAAA;IADZF;GACYE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "90dc-core",
3
- "version": "1.9.4",
3
+ "version": "1.9.5",
4
4
  "description": "A package that contains utils and interfaces used to create 90dc",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1,4 +1,15 @@
1
- import {BelongsToMany, Column, DataType, Default, HasOne, Index, Model, Table} from "sequelize-typescript";
1
+ import {
2
+ BelongsTo,
3
+ BelongsToMany,
4
+ Column,
5
+ DataType,
6
+ Default,
7
+ HasMany,
8
+ HasOne,
9
+ Index,
10
+ Model,
11
+ Table
12
+ } from "sequelize-typescript";
2
13
  import { Subscription } from "./Subscription";
3
14
  import {UserPrograms} from "./nonconsprogram/UserNonConsumableProgram";
4
15
  import {NonConsumableProgram} from "./nonconsprogram/NonConsumableProgram";
@@ -102,4 +113,13 @@ export class PersistedUser extends Model {
102
113
 
103
114
  @BelongsToMany(() => NonConsumableProgram, { through: () => UserPrograms })
104
115
  declare nonConsumablePrograms: NonConsumableProgram[];
116
+
117
+ @Column({ type: DataType.UUID, allowNull: true })
118
+ declare coachUuid?: string;
119
+
120
+ @BelongsTo(() => PersistedUser, 'coachUuid')
121
+ declare coach?: PersistedUser;
122
+
123
+ @HasMany(() => PersistedUser, 'coachUuid')
124
+ declare clients?: PersistedUser[];
105
125
  }
@@ -0,0 +1,13 @@
1
+ import { Column, DataType, ForeignKey, Model, Table } from "sequelize-typescript";
2
+ import { PersistedUser } from "./PersistedUser";
3
+
4
+ @Table
5
+ export class UserCoach extends Model {
6
+ @ForeignKey(() => PersistedUser)
7
+ @Column(DataType.UUID)
8
+ declare userUuid: string;
9
+
10
+ @ForeignKey(() => PersistedUser)
11
+ @Column(DataType.UUID)
12
+ declare coachUuid: string;
13
+ }