90dc-core 1.5.2 → 1.5.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.
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/dbmodels/PersistedUser.js +1 -10
- package/dist/lib/dbmodels/PersistedUser.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +3 -3
- package/src/lib/dbmodels/PersistedUser.ts +1 -10
- package/dist/index.d.ts +0 -7
- package/dist/lib/Errors/Errors.d.ts +0 -20
- package/dist/lib/dbmodels/PersistedUser.d.ts +0 -33
- package/dist/lib/dbmodels/UsersFriends.d.ts +0 -6
- package/dist/lib/models/BlueprintInterfaces.d.ts +0 -34
- package/dist/lib/models/ExerciseInterfaces.d.ts +0 -36
- package/dist/lib/models/ProgramInterfaces.d.ts +0 -24
- package/dist/lib/models/UserInterfaces.d.ts +0 -154
- package/dist/lib/models/WorkoutInterfaces.d.ts +0 -28
- package/dist/lib/utils/AuthenticationUtil.d.ts +0 -18
- package/dist/lib/utils/Logger.d.ts +0 -15
package/dist/index.js
CHANGED
|
@@ -6,9 +6,9 @@ export * from "./lib/models/UserInterfaces";
|
|
|
6
6
|
//DB Models
|
|
7
7
|
export * from "./lib/dbmodels/UsersFriends";
|
|
8
8
|
export * from "./lib/dbmodels/PersistedUser";
|
|
9
|
-
export * from "./lib/dbmodels/UserBadges";
|
|
10
|
-
export * from "./lib/dbmodels/UserStreaks";
|
|
11
|
-
export * from "./lib/dbmodels/Badge";
|
|
9
|
+
export * from "./lib/dbmodels/UserBadges.js";
|
|
10
|
+
export * from "./lib/dbmodels/UserStreaks.js";
|
|
11
|
+
export * from "./lib/dbmodels/Badge.js";
|
|
12
12
|
//Utils
|
|
13
13
|
export * from "./lib/utils/Logger";
|
|
14
14
|
|
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\"\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
|
|
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.js\"\nexport * from \"./lib/dbmodels/UserStreaks.js\"\nexport * from \"./lib/dbmodels/Badge.js\"\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,+BAA8B;AAC5C,cAAc,gCAA+B;AAC7C,cAAc,0BAAyB;AAEvC,OAAO;AACP,cAAc,qBAAoB"}
|
|
@@ -4,10 +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 {
|
|
8
|
-
import { Badge } from "./Badge";
|
|
9
|
-
import { UserBadges } from "./UserBadges";
|
|
10
|
-
import { UserStreak } from "./UserStreaks";
|
|
7
|
+
import { Column, DataType, Default, Index, Model, Table } from "sequelize-typescript";
|
|
11
8
|
export let PersistedUser = class PersistedUser extends Model {
|
|
12
9
|
};
|
|
13
10
|
__decorate([
|
|
@@ -189,12 +186,6 @@ __decorate([
|
|
|
189
186
|
allowNull: true
|
|
190
187
|
})
|
|
191
188
|
], PersistedUser.prototype, "subscription", void 0);
|
|
192
|
-
__decorate([
|
|
193
|
-
BelongsToMany(()=>Badge, ()=>UserBadges)
|
|
194
|
-
], PersistedUser.prototype, "badges", void 0);
|
|
195
|
-
__decorate([
|
|
196
|
-
HasOne(()=>UserStreak)
|
|
197
|
-
], PersistedUser.prototype, "userStreak", void 0);
|
|
198
189
|
PersistedUser = __decorate([
|
|
199
190
|
Table
|
|
200
191
|
], PersistedUser);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/dbmodels/PersistedUser.ts"],"sourcesContent":["import {
|
|
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":";;;;;;AAAA,SAASA,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,KAAK,EAAEC,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAItF,WAAaC,gBAAN,4BAA4BF;AA+FnC,EAAC;;IA7FEF,QAAQD,SAASM,MAAM;IACvBP,OAAO;QACNQ,MAAMP,SAASQ,IAAI;QACnBC,cAAcT,SAASQ,IAAI;QAC3BE,WAAW,KAAK;QAChBC,YAAY,IAAI;IAClB;GARWN;;IAWVH;IACAH,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,KAAK;QAAEG,QAAQ,KAAK;IAAC;GAZpDR;;IAeVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,KAAK;IAAC;GAfrCL;;IAkBVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GAlBpCL;;IAqBVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GArBpCL;;IAwBVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GAxBpCL;;IA2BVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GA3BpCL;;IA8BVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GA9BpCL;;IAiCVN,OAAO;QAAEQ,MAAMP,SAASc,OAAO;QAAEJ,WAAW,IAAI;IAAC;GAjCvCL;;IAoCVN,OAAO;QAAEQ,MAAMP,SAASc,OAAO;QAAEJ,WAAW,IAAI;IAAC;GApCvCL;;IAuCVN,OAAO;QAAEQ,MAAMP,SAASc,OAAO;QAAEJ,WAAW,IAAI;IAAC;GAvCvCL;;IA0CVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GA1CpCL;;IA6CVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GA7CpCL;;IAgDVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GAhDpCL;;IAmDVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GAnDpCL;;IAsDVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GAtDpCL;;IAyDVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GAzDpCL;;IA4DVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GA5DpCL;;IA+DVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GA/DpCL;;IAkEVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GAlEpCL;;IAqEVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GArEpCL;;IAwEVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GAxEpCL;;IA2EVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GA3EpCL;;IA8EVN,OAAO;QAAEQ,MAAMP,SAASY,IAAI;QAAEF,WAAW,IAAI;IAAC;GA9EpCL;;IAiFVN,OAAO;QAAEQ,MAAMP,SAASc,OAAO;QAAEJ,WAAW,IAAI;IAAC;GAjFvCL;;IAoFVN,OAAO;QAAEQ,MAAMP,SAASc,OAAO;QAAEJ,WAAW,IAAI;IAAC;GApFvCL;;IAuFVN,OAAO;QAAEQ,MAAMP,SAASc,OAAO;QAAEJ,WAAW,IAAI;IAAC;GAvFvCL;;IA0FVN,OAAO;QAAEQ,MAAMP,SAASc,OAAO;QAAEJ,WAAW,IAAI;IAAC;GA1FvCL;;IA6FVN,OAAO;QAAEQ,MAAMP,SAASe,KAAK;QAAEL,WAAW,IAAI;IAAC;GA7FrCL;AAAAA;IADZD;GACYC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -7,9 +7,9 @@ export * from "./lib/models/UserInterfaces";
|
|
|
7
7
|
//DB Models
|
|
8
8
|
export * from "./lib/dbmodels/UsersFriends"
|
|
9
9
|
export * from "./lib/dbmodels/PersistedUser"
|
|
10
|
-
export * from "./lib/dbmodels/UserBadges"
|
|
11
|
-
export * from "./lib/dbmodels/UserStreaks"
|
|
12
|
-
export * from "./lib/dbmodels/Badge"
|
|
10
|
+
export * from "./lib/dbmodels/UserBadges.js"
|
|
11
|
+
export * from "./lib/dbmodels/UserStreaks.js"
|
|
12
|
+
export * from "./lib/dbmodels/Badge.js"
|
|
13
13
|
|
|
14
14
|
//Utils
|
|
15
15
|
export * from "./lib/utils/Logger"
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Column, DataType, Default, Index, Model, Table } from "sequelize-typescript";
|
|
2
2
|
import type { Subscription } from "../models/UserInterfaces";
|
|
3
|
-
import { Badge } from "./Badge";
|
|
4
|
-
import { UserBadges } from "./UserBadges";
|
|
5
|
-
import { UserStreak } from "./UserStreaks";
|
|
6
3
|
|
|
7
4
|
@Table
|
|
8
5
|
export class PersistedUser extends Model {
|
|
@@ -100,10 +97,4 @@ export class PersistedUser extends Model {
|
|
|
100
97
|
|
|
101
98
|
@Column({ type: DataType.JSONB, allowNull: true })
|
|
102
99
|
declare subscription: Subscription;
|
|
103
|
-
|
|
104
|
-
@BelongsToMany(() => Badge, () => UserBadges)
|
|
105
|
-
declare badges: Badge[];
|
|
106
|
-
|
|
107
|
-
@HasOne(() => UserStreak)
|
|
108
|
-
declare userStreak: UserStreak;
|
|
109
100
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from "./lib/models/ProgramInterfaces";
|
|
2
|
-
export * from "./lib/models/ExerciseInterfaces";
|
|
3
|
-
export * from "./lib/models/WorkoutInterfaces";
|
|
4
|
-
export * from "./lib/models/UserInterfaces";
|
|
5
|
-
export * from "./lib/dbmodels/UsersFriends";
|
|
6
|
-
export * from "./lib/dbmodels/PersistedUser";
|
|
7
|
-
export * from "./lib/utils/Logger";
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare class ExerciseNotFound extends Error {
|
|
2
|
-
error: {};
|
|
3
|
-
constructor(message: object);
|
|
4
|
-
}
|
|
5
|
-
export declare class ExerciseAlreadyUsed extends Error {
|
|
6
|
-
error: {};
|
|
7
|
-
constructor(message: object);
|
|
8
|
-
}
|
|
9
|
-
export declare class AppleTransactionError extends Error {
|
|
10
|
-
error: {};
|
|
11
|
-
constructor(message: string);
|
|
12
|
-
}
|
|
13
|
-
export declare class ProgramNotFound extends Error {
|
|
14
|
-
error: {};
|
|
15
|
-
constructor(message: object);
|
|
16
|
-
}
|
|
17
|
-
export declare class NotificationNotSent extends Error {
|
|
18
|
-
error: {};
|
|
19
|
-
constructor(message: object);
|
|
20
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Model } from "sequelize-typescript";
|
|
2
|
-
import type { Subscription } from "../models/UserInterfaces";
|
|
3
|
-
export declare class PersistedUser extends Model {
|
|
4
|
-
userUuid: string;
|
|
5
|
-
email: string;
|
|
6
|
-
password: string;
|
|
7
|
-
firstName?: string;
|
|
8
|
-
lastName?: string;
|
|
9
|
-
avatar: string;
|
|
10
|
-
sex: string;
|
|
11
|
-
goal: string;
|
|
12
|
-
isFreeVersion: boolean;
|
|
13
|
-
allowsEmail: boolean;
|
|
14
|
-
gotParentalConsent: boolean;
|
|
15
|
-
weightGoal: string;
|
|
16
|
-
role: 'default' | 'admin';
|
|
17
|
-
level: string;
|
|
18
|
-
type: string;
|
|
19
|
-
days: number;
|
|
20
|
-
dateOfBirth: string;
|
|
21
|
-
metricSystem: string;
|
|
22
|
-
height: string;
|
|
23
|
-
weight: string;
|
|
24
|
-
activeProgramId: string;
|
|
25
|
-
registrationDate: string;
|
|
26
|
-
registrationService: 'apple' | 'google' | 'facebook' | 'native';
|
|
27
|
-
utilityEmail: string;
|
|
28
|
-
emailConfirmed: boolean;
|
|
29
|
-
utilityEmailConfirmed: boolean;
|
|
30
|
-
changeEmail: boolean;
|
|
31
|
-
changeUtilityEmail: boolean;
|
|
32
|
-
subscription: Subscription;
|
|
33
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { SupersetModel } from "./WorkoutInterfaces";
|
|
2
|
-
export interface ExerciseBlueprint {
|
|
3
|
-
uuid: string;
|
|
4
|
-
hasPriority: boolean;
|
|
5
|
-
isCompound: boolean;
|
|
6
|
-
homeWorkout: boolean;
|
|
7
|
-
needsEquipment: boolean;
|
|
8
|
-
isSuperset: boolean;
|
|
9
|
-
isFixed: boolean;
|
|
10
|
-
muscle: string;
|
|
11
|
-
rir: number;
|
|
12
|
-
order: number;
|
|
13
|
-
reps: string;
|
|
14
|
-
sets: string;
|
|
15
|
-
}
|
|
16
|
-
export interface ProgramBlueprint {
|
|
17
|
-
programId: string;
|
|
18
|
-
title: string;
|
|
19
|
-
level: string;
|
|
20
|
-
numberOfDays: number;
|
|
21
|
-
workouts: WorkoutBlueprint[];
|
|
22
|
-
}
|
|
23
|
-
export interface WorkoutBlueprint {
|
|
24
|
-
uuid: string;
|
|
25
|
-
title: string;
|
|
26
|
-
duration: string;
|
|
27
|
-
exercises: ExerciseBlueprint[];
|
|
28
|
-
superset: SupersetModel[];
|
|
29
|
-
}
|
|
30
|
-
export interface SupersetBlueprint {
|
|
31
|
-
uuid: string;
|
|
32
|
-
workout: WorkoutBlueprint;
|
|
33
|
-
exercise: ExerciseBlueprint[];
|
|
34
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ProgramBlueprint } from "./BlueprintInterfaces";
|
|
2
|
-
export interface ExerciseModel {
|
|
3
|
-
uuid: string;
|
|
4
|
-
name: string;
|
|
5
|
-
level: string[];
|
|
6
|
-
isCompound: boolean;
|
|
7
|
-
needsEquipment: boolean;
|
|
8
|
-
hasPriority: boolean;
|
|
9
|
-
hasVariations: boolean;
|
|
10
|
-
variations: object;
|
|
11
|
-
muscles: string[];
|
|
12
|
-
homeWorkout: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface ExerciseProgressRequest {
|
|
15
|
-
exerciseUuid: string;
|
|
16
|
-
reps: string;
|
|
17
|
-
weight: string;
|
|
18
|
-
}
|
|
19
|
-
export interface ExerciseProgressGetRequest {
|
|
20
|
-
exerciseUuid: string;
|
|
21
|
-
}
|
|
22
|
-
export interface ExerciseBlueprint {
|
|
23
|
-
uuid: string;
|
|
24
|
-
hasPriority: boolean;
|
|
25
|
-
isCompound: boolean;
|
|
26
|
-
homeWorkout: boolean;
|
|
27
|
-
needsEquipment: boolean;
|
|
28
|
-
isSuperset: boolean;
|
|
29
|
-
isFixed: boolean;
|
|
30
|
-
muscle: string;
|
|
31
|
-
rir: number;
|
|
32
|
-
order: number;
|
|
33
|
-
reps: string;
|
|
34
|
-
sets: string;
|
|
35
|
-
program: ProgramBlueprint;
|
|
36
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { WorkoutBlueprint } from "./BlueprintInterfaces";
|
|
2
|
-
export interface ProgramModel {
|
|
3
|
-
programId: string;
|
|
4
|
-
userUuid: string;
|
|
5
|
-
}
|
|
6
|
-
export interface ProgramIdRequest {
|
|
7
|
-
programId: string;
|
|
8
|
-
}
|
|
9
|
-
export interface ProgramUserRequest {
|
|
10
|
-
userUuid: string;
|
|
11
|
-
}
|
|
12
|
-
export interface UserProgramOptions {
|
|
13
|
-
level: string;
|
|
14
|
-
type: string;
|
|
15
|
-
numberOfDays: number;
|
|
16
|
-
userUuid: string;
|
|
17
|
-
}
|
|
18
|
-
export interface ProgramBlueprint {
|
|
19
|
-
programId: string;
|
|
20
|
-
title: string;
|
|
21
|
-
level: string;
|
|
22
|
-
numberOfDays: number;
|
|
23
|
-
workouts: WorkoutBlueprint[];
|
|
24
|
-
}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import type jwt from "jsonwebtoken";
|
|
2
|
-
export interface UserTypes {
|
|
3
|
-
userUuid: string;
|
|
4
|
-
email: string;
|
|
5
|
-
firstName: string;
|
|
6
|
-
lastName: string;
|
|
7
|
-
avatar: string;
|
|
8
|
-
role: string;
|
|
9
|
-
}
|
|
10
|
-
export interface VerificationStatus {
|
|
11
|
-
status: string;
|
|
12
|
-
}
|
|
13
|
-
export interface TransactionsResponse {
|
|
14
|
-
revision: string;
|
|
15
|
-
bundleId: string;
|
|
16
|
-
environment: string;
|
|
17
|
-
hasMore: boolean;
|
|
18
|
-
signedTransactions: string[];
|
|
19
|
-
errorCode?: number;
|
|
20
|
-
}
|
|
21
|
-
export interface UserInfoModel {
|
|
22
|
-
userUuid: string;
|
|
23
|
-
height: string;
|
|
24
|
-
weight: string;
|
|
25
|
-
}
|
|
26
|
-
export interface Subscription {
|
|
27
|
-
type: "android" | "ios";
|
|
28
|
-
[key: string]: string;
|
|
29
|
-
}
|
|
30
|
-
export interface SingleTransactionResponse {
|
|
31
|
-
revision: string;
|
|
32
|
-
bundleId: string;
|
|
33
|
-
environment: string;
|
|
34
|
-
hasMore: boolean;
|
|
35
|
-
signedTransactionInfo: string;
|
|
36
|
-
errorCode?: number;
|
|
37
|
-
}
|
|
38
|
-
export interface SubscriptionStatus {
|
|
39
|
-
originalTransactionId: string;
|
|
40
|
-
status: number;
|
|
41
|
-
signedTransactionInfo: string;
|
|
42
|
-
signedRenewalInfo: string;
|
|
43
|
-
}
|
|
44
|
-
export interface SubscriptionStatusResponse {
|
|
45
|
-
environment: string;
|
|
46
|
-
bundleId: string;
|
|
47
|
-
data: [
|
|
48
|
-
{
|
|
49
|
-
subscriptionGroupIdentifier: string;
|
|
50
|
-
lastTransactions: SubscriptionStatus[];
|
|
51
|
-
}
|
|
52
|
-
];
|
|
53
|
-
errorCode?: number;
|
|
54
|
-
}
|
|
55
|
-
export interface SubscriptionStatusResponseError {
|
|
56
|
-
errorCode: number;
|
|
57
|
-
errorMessage: string;
|
|
58
|
-
}
|
|
59
|
-
export interface SubscriptionStatusResult {
|
|
60
|
-
originalTransactionId: string;
|
|
61
|
-
status: number;
|
|
62
|
-
signedTransactionInfo: string | jwt.JwtPayload | null;
|
|
63
|
-
signedRenewalInfo: string | jwt.JwtPayload | null;
|
|
64
|
-
}
|
|
65
|
-
export interface SignedTransactions {
|
|
66
|
-
transactionId: string;
|
|
67
|
-
originalTransactionId: string;
|
|
68
|
-
webOrderLineItemId: string;
|
|
69
|
-
bundleId: string;
|
|
70
|
-
productId: string;
|
|
71
|
-
subscriptionGroupIdentifier: string;
|
|
72
|
-
purchaseDate: number;
|
|
73
|
-
originalPurchaseDate: number;
|
|
74
|
-
expiresDate: number;
|
|
75
|
-
quantity: number;
|
|
76
|
-
type: string;
|
|
77
|
-
inAppOwnershipType: string;
|
|
78
|
-
signedDate: number;
|
|
79
|
-
environment: string;
|
|
80
|
-
transactionReason: string;
|
|
81
|
-
storefront: string;
|
|
82
|
-
storefrontId: string;
|
|
83
|
-
}
|
|
84
|
-
export interface Credentials {
|
|
85
|
-
refresh_token?: string | null;
|
|
86
|
-
expiry_date?: number | null;
|
|
87
|
-
access_token?: string | null;
|
|
88
|
-
token_type?: string | null;
|
|
89
|
-
id_token?: string | null;
|
|
90
|
-
scope?: string;
|
|
91
|
-
}
|
|
92
|
-
export interface LoginRequest {
|
|
93
|
-
email: string;
|
|
94
|
-
password: string;
|
|
95
|
-
}
|
|
96
|
-
export interface UserPhotoRequest {
|
|
97
|
-
base64: string;
|
|
98
|
-
}
|
|
99
|
-
export interface ProgressPhoto {
|
|
100
|
-
date: Date;
|
|
101
|
-
progressPhoto: string;
|
|
102
|
-
userUuid: string;
|
|
103
|
-
}
|
|
104
|
-
export interface ForgotPassword {
|
|
105
|
-
uuid: string;
|
|
106
|
-
userUuid: string;
|
|
107
|
-
token: string;
|
|
108
|
-
date: Date;
|
|
109
|
-
}
|
|
110
|
-
export interface RefreshPayload {
|
|
111
|
-
userUuid: string;
|
|
112
|
-
}
|
|
113
|
-
export interface TokenRequest {
|
|
114
|
-
token: string;
|
|
115
|
-
}
|
|
116
|
-
export interface RefreshRequest {
|
|
117
|
-
refreshToken: string;
|
|
118
|
-
}
|
|
119
|
-
export interface UuidRequest {
|
|
120
|
-
userUuid: string;
|
|
121
|
-
}
|
|
122
|
-
export interface EmailRequest {
|
|
123
|
-
email: string;
|
|
124
|
-
}
|
|
125
|
-
export interface TitleRequest {
|
|
126
|
-
title: string;
|
|
127
|
-
}
|
|
128
|
-
export interface UserPhoto {
|
|
129
|
-
base64: string;
|
|
130
|
-
title: string;
|
|
131
|
-
}
|
|
132
|
-
export default interface AuthenticationToken {
|
|
133
|
-
type: string;
|
|
134
|
-
contents: string;
|
|
135
|
-
}
|
|
136
|
-
export interface RestorePasswordRequest {
|
|
137
|
-
email: string;
|
|
138
|
-
}
|
|
139
|
-
export interface BeforeSubscriptionOptions {
|
|
140
|
-
firstName: string;
|
|
141
|
-
lastName: string;
|
|
142
|
-
sex: string;
|
|
143
|
-
goal: string;
|
|
144
|
-
weightGoal: string;
|
|
145
|
-
level: string;
|
|
146
|
-
type: string;
|
|
147
|
-
days: number;
|
|
148
|
-
}
|
|
149
|
-
export interface AfterSubscriptionOptions {
|
|
150
|
-
dateOfBirth: string;
|
|
151
|
-
metricSystem: string;
|
|
152
|
-
height: string;
|
|
153
|
-
weight: string;
|
|
154
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { ExerciseBlueprint } from "./BlueprintInterfaces";
|
|
2
|
-
export interface WorkoutModel {
|
|
3
|
-
uuid: string;
|
|
4
|
-
isFinished: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface SupersetModel {
|
|
7
|
-
uuid: string;
|
|
8
|
-
}
|
|
9
|
-
export interface WorkoutExerciseModel {
|
|
10
|
-
WorkoutUuid: string;
|
|
11
|
-
ExerciseUuid: string;
|
|
12
|
-
}
|
|
13
|
-
export interface SupersetExerciseModel {
|
|
14
|
-
SupersetUuid: string;
|
|
15
|
-
ExerciseUuid: string;
|
|
16
|
-
}
|
|
17
|
-
export interface WorkoutBlueprint {
|
|
18
|
-
uuid: string;
|
|
19
|
-
title: string;
|
|
20
|
-
duration: string;
|
|
21
|
-
exercises: ExerciseBlueprint[];
|
|
22
|
-
superset: SupersetModel[];
|
|
23
|
-
}
|
|
24
|
-
export interface SupersetBlueprint {
|
|
25
|
-
uuid: string;
|
|
26
|
-
workout: WorkoutBlueprint;
|
|
27
|
-
exercise: ExerciseBlueprint[];
|
|
28
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { PersistedUser } from "../dbmodels/PersistedUser";
|
|
2
|
-
import type { Credentials, SignedTransactions, SubscriptionStatusResult, VerificationStatus } from "../models/UserInterfaces";
|
|
3
|
-
export default class AuthenticationUtil {
|
|
4
|
-
private static readonly ACCESS_SECRET;
|
|
5
|
-
static fetchUserWithTokenInfo(token: string): Promise<PersistedUser | null>;
|
|
6
|
-
static verifyAppleReceipt(data: string): Promise<VerificationStatus>;
|
|
7
|
-
static verifyTokenAndFetchUser(token: string): Promise<PersistedUser | null | false>;
|
|
8
|
-
static generateAppleJWT(): any;
|
|
9
|
-
static getAppleTransactions(originalTransactionId: string): Promise<SignedTransactions[]>;
|
|
10
|
-
static getAndroidAccessToken(): Promise<Credentials>;
|
|
11
|
-
static getAndroidSubscriptionsStatuses(token: string): Promise<any>;
|
|
12
|
-
static isAndroidSubscriptionsActive(token: string): Promise<boolean>;
|
|
13
|
-
static isAppleSubscriptionActive(transactionId: string): Promise<boolean>;
|
|
14
|
-
static getAppleSubscriptionsStatuses(transactionId: string): Promise<SubscriptionStatusResult[]>;
|
|
15
|
-
static getSingleAppleTransactionsInfo(transactionId: string): Promise<{
|
|
16
|
-
signedTransactionInfo: any;
|
|
17
|
-
}>;
|
|
18
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Debugger } from "debug";
|
|
2
|
-
export declare class Log {
|
|
3
|
-
private static instance;
|
|
4
|
-
private readonly debugLib;
|
|
5
|
-
constructor(debug: Debugger);
|
|
6
|
-
static getInstance(): Log;
|
|
7
|
-
static extendInstance(name: string): Log;
|
|
8
|
-
debug(message: string): void;
|
|
9
|
-
info(message: string): void;
|
|
10
|
-
warn(message: string): void;
|
|
11
|
-
error(message: string | unknown, error?: unknown): void;
|
|
12
|
-
catchError(error: unknown): void;
|
|
13
|
-
catchErrorAndLogUuid(error: unknown): string;
|
|
14
|
-
extend(extensionName: string): Log;
|
|
15
|
-
}
|