@dgpholdings/greatoak-shared 1.1.99 → 1.1.102

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.
@@ -1,55 +1,26 @@
1
1
  import { TAuthType, TFitnessGoal, TGender, TProfessionalCategory, TUserMetric, TUserType } from "./TApiUser";
2
- export type TApiSignupReq = {
3
- email: string;
4
- password: string;
5
- model: string;
6
- appLanguage: string;
7
- deviceUniqueId: string;
8
- captchaToken: string;
9
- };
10
2
  export type TOnboardingData = {
11
3
  userWeightKg: number;
12
4
  dob: Date;
13
5
  gender: TGender;
14
6
  fitnessGoal: TFitnessGoal;
15
7
  fitnessLevel: number;
8
+ gdprShareWorkoutHistory: boolean;
9
+ gdprSharePersonalInfo: boolean;
16
10
  userCode: string;
17
11
  userType: TUserType;
18
12
  professionType?: TProfessionalCategory;
19
13
  email?: string;
20
14
  };
21
- export type TApiSignupRes = TApiSigninRes & {
22
- authType: "email";
23
- };
24
15
  export type TApiSignupAnonymousReq = Omit<TOnboardingData, "userCode"> & {
25
16
  model: string;
26
17
  appLanguage: string;
27
18
  deviceUniqueId: string;
28
19
  };
29
- export type TApiSignupAnonymousRes = TApiSigninRes & {
20
+ export type TApiSignupAnonymousRes = TSignInRes & {
30
21
  authType: "anonymous";
31
22
  };
32
- export type TApiSigninAppleReq = {
33
- email?: string;
34
- identityToken: string;
35
- model: string;
36
- appLanguage: string;
37
- deviceUniqueId: string;
38
- };
39
- export type TApiSigninAppleRes = TApiSigninRes & {
40
- authType: "apple";
41
- };
42
- export type TApiSigninEmailReq = {
43
- email: string;
44
- password: string;
45
- model: string;
46
- deviceUniqueId: string;
47
- captchaToken: string;
48
- };
49
- export type TApiSigninEmailRes = TApiSigninRes & {
50
- authType: "email";
51
- };
52
- export type TApiSigninRes = {
23
+ export type TSignInRes = {
53
24
  status: 200;
54
25
  token: string;
55
26
  user: TUserMetric;
@@ -64,13 +35,4 @@ export type TApiSignInTokenReq = {
64
35
  deviceUniqueId: string;
65
36
  isLimited: boolean;
66
37
  };
67
- export type TApiSignInTokenRes = {
68
- message: string;
69
- } & ({
70
- status: 200;
71
- token: string;
72
- user?: TUserMetric;
73
- authType: TAuthType;
74
- } | {
75
- status: 500;
76
- });
38
+ export type TApiSignInTokenRes = TSignInRes;
@@ -0,0 +1,64 @@
1
+ import { TRecord } from "./commonTypes";
2
+ export type TClientData = {
3
+ clientId: string;
4
+ trainerPlanId: string;
5
+ planName: string;
6
+ planCode: string;
7
+ fullName?: string;
8
+ clientEmail?: string;
9
+ totalSessions: number;
10
+ lastWorkoutDate: Date;
11
+ };
12
+ export type TClientSessionData = {
13
+ exerciseId: string;
14
+ records: TRecord[];
15
+ };
16
+ export type TApiClientProgressSaveReq = {
17
+ planId?: string;
18
+ planName?: string;
19
+ planCode?: string;
20
+ sessionRecord: TClientSessionData[];
21
+ sessionStartTimestamp: string;
22
+ };
23
+ export type TApiClientProgressSaveRes = {
24
+ status: 200 | 500;
25
+ message?: string;
26
+ state: "success" | "failed";
27
+ };
28
+ export type TClientWorkoutHistory = {
29
+ clientId: string;
30
+ trainerId?: string;
31
+ planId?: string;
32
+ planName: string;
33
+ planCode: string;
34
+ fullName?: string;
35
+ clientEmail?: string;
36
+ totalCompletedSessions: number;
37
+ lastWorkoutDate: Date;
38
+ sessions: {
39
+ sessionRecord: TClientSessionData[];
40
+ userDuration: number;
41
+ createdAt: Date;
42
+ }[];
43
+ createdAt: Date;
44
+ updatedAt: Date;
45
+ };
46
+ export type TApiGetTrainerClientListReq = {};
47
+ export type TApiGetTrainerClientListRes = {
48
+ status: 200 | 400 | 500;
49
+ message?: string;
50
+ state: "success" | "failed";
51
+ clients: TClientData[];
52
+ };
53
+ export type TApiTrainerGetClientWorkoutHistoryReq = {
54
+ clientId: string;
55
+ };
56
+ export type TApiTrainerGetClientWorkoutHistoryRes = {
57
+ status: 200 | 400 | 500;
58
+ message?: string;
59
+ state: "success" | "failed";
60
+ clientId: string;
61
+ fullName?: string;
62
+ clientEmail?: string;
63
+ history: Pick<TClientWorkoutHistory, "totalCompletedSessions" | "planId" | "sessions">[];
64
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -17,6 +17,7 @@ export type TTemplateShopDb = {
17
17
  es?: string;
18
18
  fr?: string;
19
19
  };
20
+ version: string;
20
21
  planCode: string;
21
22
  gender: "male" | "female" | "all";
22
23
  slug: string;
@@ -38,6 +39,7 @@ export type TTemplateShopDb = {
38
39
  thumbnailImageUrl: string;
39
40
  isPremium: boolean;
40
41
  } | {
42
+ version: number;
41
43
  avatarImgName: string;
42
44
  type: "trainer-created";
43
45
  ownerId: string;
@@ -1,3 +1,4 @@
1
+ import { TGdprData } from "./commonTypes";
1
2
  export type TAuthType = "email" | "apple" | "anonymous";
2
3
  export type TGender = "male" | "female" | "unmentioned";
3
4
  export type TUserType = "regular" | "professional";
@@ -30,6 +31,7 @@ export type TUserMetric = {
30
31
  subscriptionWillRenew: boolean;
31
32
  subscriptionStore: TAppStore;
32
33
  subscriptionLastUpdatedAt: number;
34
+ gdpr: TGdprData;
33
35
  createdAt: Date;
34
36
  updatedAt?: Date;
35
37
  };
@@ -50,37 +52,3 @@ export type TApiIsUserExistsRes = {
50
52
  state: boolean;
51
53
  status: 403 | 404 | 400 | 200;
52
54
  };
53
- export type TApiGetUserProfileReq = {};
54
- export type TApiGetUserProfileRes = {
55
- user: TUserMetric;
56
- status: 200;
57
- } | {
58
- status: 400;
59
- message?: string;
60
- };
61
- export type TUser = {
62
- username?: string;
63
- email: string;
64
- isVerified: boolean;
65
- password: string;
66
- appLanguage: string;
67
- billingPlanType: "monthly" | "annually" | "free";
68
- billingPlanVersion?: string;
69
- billingPlanGeoCountryCode: string;
70
- paymentMethod?: "credit_card" | "paypal" | "apple_pay" | "upi";
71
- billingPlanNextDueDate?: string;
72
- devices: {
73
- model: string;
74
- deviceId: string;
75
- }[];
76
- recoveryIssuedTimeStamp: number;
77
- recoveryVerifyToken: string;
78
- authMethod: TAuthType;
79
- gender?: TGender;
80
- dob?: Date;
81
- weightKg?: number;
82
- heightCm?: number;
83
- bodyFatPercentage?: number;
84
- fitnessGoal: TFitnessGoal;
85
- fitnessLevel: number;
86
- };
@@ -61,3 +61,18 @@ export type TTemplateExercise = {
61
61
  restTimeSecs?: number;
62
62
  initialRecords: TRecord[];
63
63
  };
64
+ export type TGdprData = {
65
+ consentVersion: string;
66
+ consentTimestamp: string;
67
+ consentStatus: "full" | "minimal" | "withdrawn";
68
+ dataSharing: {
69
+ withTrainers: boolean;
70
+ marketplaceAnalytics: boolean;
71
+ marketingCommunications: boolean;
72
+ };
73
+ consentHistory: Array<{
74
+ version: string;
75
+ status: string;
76
+ timestamp: string;
77
+ }>;
78
+ };
@@ -8,3 +8,4 @@ export type * from "./TApiUser";
8
8
  export type * from "./TApiTemplateShop";
9
9
  export type * from "./commonTypes";
10
10
  export type * from "./TApiRevenueCat";
11
+ export type * from "./TApiClientProgress";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dgpholdings/greatoak-shared",
3
- "version": "1.1.99",
3
+ "version": "1.1.102",
4
4
  "description": "Shared TypeScript types and utilities for @dgpholdings projects",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",