@dgpholdings/greatoak-shared 1.2.75 → 1.2.77
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/__mocks__/user.mock.js +19 -6
- package/dist/constants/AiExerciseVocabulary.d.ts +0 -15
- package/dist/types/TApiAuth.d.ts +24 -5
- package/dist/types/TApiUser.d.ts +2 -7
- package/dist/types/TUserPreferences.d.ts +34 -0
- package/dist/types/TUserPreferences.js +4 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mockUser = void 0;
|
|
4
4
|
exports.mockUser = {
|
|
5
|
+
// TUserPreferences fields (flat in TUserMetric)
|
|
6
|
+
trainingLocation: "gym",
|
|
7
|
+
preferredDurationMinutes: 45,
|
|
8
|
+
fitnessGoals: ["hypertrophy"],
|
|
9
|
+
preferredEquipment: ["weights"],
|
|
10
|
+
preferCompoundMovements: true,
|
|
11
|
+
includeWarmup: "ai_decide",
|
|
12
|
+
includeCooldown: "ai_decide",
|
|
13
|
+
warmupStyle: null,
|
|
14
|
+
favouriteMuscleGroups: ["Chest", "Back", "Legs"],
|
|
15
|
+
blacklistedExerciseIds: [],
|
|
16
|
+
fitnessLevel: "moderately-active",
|
|
17
|
+
bodyFatPercentage: 15,
|
|
18
|
+
metricSystem: "EU",
|
|
19
|
+
appLanguage: "en",
|
|
20
|
+
preferencesUpdatedAt: new Date("2023-01-01").toISOString(),
|
|
21
|
+
femaleHealth: null, // Male user
|
|
22
|
+
// TUserMetric-specific fields
|
|
5
23
|
userId: "mock-user-123",
|
|
6
24
|
userCode: "MOCK123",
|
|
7
25
|
userType: "regular",
|
|
@@ -10,13 +28,8 @@ exports.mockUser = {
|
|
|
10
28
|
weightKg: 75,
|
|
11
29
|
heightCm: 180,
|
|
12
30
|
gender: "male",
|
|
13
|
-
appLanguage: "en",
|
|
14
|
-
metricSystem: "EU",
|
|
15
|
-
fitnessLevel: "moderately-active",
|
|
16
|
-
fitnessGoals: ["hypertrophy"],
|
|
17
|
-
bodyFatPercentage: 15,
|
|
18
31
|
subscriptionStatus: "none",
|
|
19
|
-
subscriptionType: "trial",
|
|
32
|
+
subscriptionType: "trial",
|
|
20
33
|
subscriptionTier: "none",
|
|
21
34
|
subscriptionWillRenew: false,
|
|
22
35
|
subscriptionStore: null,
|
|
@@ -42,21 +42,6 @@ export interface TAiUserInjury {
|
|
|
42
42
|
note?: string;
|
|
43
43
|
isActive: boolean;
|
|
44
44
|
}
|
|
45
|
-
export interface TAiUserProfile {
|
|
46
|
-
userId: string;
|
|
47
|
-
height: number;
|
|
48
|
-
weight: number;
|
|
49
|
-
bodyFatPercent?: number;
|
|
50
|
-
age: number;
|
|
51
|
-
fitnessGoals: TAiFitnessGoal[];
|
|
52
|
-
fitnessLevel: TAiFitnessLevel;
|
|
53
|
-
availableEquipment: TAiEquipmentType[];
|
|
54
|
-
trainsAtHome: boolean;
|
|
55
|
-
injuries: TAiUserInjury[];
|
|
56
|
-
avoidBodyAreas: TAiBodyArea[];
|
|
57
|
-
onboardingCompletedAt: string;
|
|
58
|
-
onboardingVersion: string;
|
|
59
|
-
}
|
|
60
45
|
export declare const AI_ENERGY_LEVEL_OPTIONS: readonly ["fresh", "normal", "tired", "exhausted"];
|
|
61
46
|
export type TAiEnergyLevel = (typeof AI_ENERGY_LEVEL_OPTIONS)[number];
|
|
62
47
|
export declare const AI_INTENT_CHIPS: readonly ["leg-day", "upper-body", "full-body", "push-day", "pull-day", "cardio-focused", "back-and-biceps", "chest-and-triceps", "legs-and-glutes", "core-and-abs", "mobility-and-flexibility", "Surprise me"];
|
package/dist/types/TApiAuth.d.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import type { TAiFitnessGoal, TAiBodyArea } from "../constants/AiExerciseVocabulary";
|
|
2
|
-
import { TAuthType, TGender, TProfessionalCategory, TUserMetric, TUserType,
|
|
2
|
+
import { TAuthType, TGender, TProfessionalCategory, TUserMetric, TUserType, TInjuryInfo } from "./TApiUser";
|
|
3
|
+
import { TActivityLevel, TStablePreferences, TFemaleHealthContext } from "./TUserPreferences";
|
|
4
|
+
/**
|
|
5
|
+
* TOnboardingData: Core user profile data collected during onboarding
|
|
6
|
+
* Does NOT include workout preferences - those come from TStablePreferences
|
|
7
|
+
*/
|
|
3
8
|
export type TOnboardingData = {
|
|
4
|
-
|
|
9
|
+
weightKg: number;
|
|
10
|
+
heightCm: number;
|
|
5
11
|
dob: Date;
|
|
6
12
|
gender: TGender;
|
|
7
|
-
userHeightCm: number;
|
|
8
|
-
metricSystem: "US" | "EU";
|
|
9
13
|
bodyFatPercentage: number;
|
|
14
|
+
metricSystem: "US" | "EU";
|
|
15
|
+
appLanguage: string;
|
|
10
16
|
fitnessGoals: TAiFitnessGoal[];
|
|
11
17
|
fitnessLevel: TActivityLevel;
|
|
12
18
|
avoidBodyAreas?: TAiBodyArea[];
|
|
@@ -20,10 +26,23 @@ export type TOnboardingData = {
|
|
|
20
26
|
email?: string;
|
|
21
27
|
fullName?: string;
|
|
22
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Anonymous signup request
|
|
31
|
+
* = Core onboarding data + device info + OPTIONAL workout preferences
|
|
32
|
+
*/
|
|
23
33
|
export type TApiSignupAnonymousReq = Omit<TOnboardingData, "userCode"> & {
|
|
24
34
|
model: string;
|
|
25
|
-
appLanguage: string;
|
|
26
35
|
deviceUniqueId: string;
|
|
36
|
+
trainingLocation?: TStablePreferences["trainingLocation"];
|
|
37
|
+
preferredDurationMinutes?: TStablePreferences["preferredDurationMinutes"];
|
|
38
|
+
preferredEquipment?: TStablePreferences["preferredEquipment"];
|
|
39
|
+
preferCompoundMovements?: TStablePreferences["preferCompoundMovements"];
|
|
40
|
+
includeWarmup?: TStablePreferences["includeWarmup"];
|
|
41
|
+
includeCooldown?: TStablePreferences["includeCooldown"];
|
|
42
|
+
warmupStyle?: TStablePreferences["warmupStyle"];
|
|
43
|
+
favouriteMuscleGroups?: TStablePreferences["favouriteMuscleGroups"];
|
|
44
|
+
blacklistedExerciseIds?: TStablePreferences["blacklistedExerciseIds"];
|
|
45
|
+
femaleHealth?: TFemaleHealthContext | null;
|
|
27
46
|
};
|
|
28
47
|
export type TApiSignupAnonymousRes = TSignInRes & {
|
|
29
48
|
authType: "anonymous";
|
package/dist/types/TApiUser.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TAiFitnessGoal, TAiUserInjury } from "../constants/AiExerciseVocabulary";
|
|
2
2
|
import { TGdprData } from "./commonTypes";
|
|
3
|
+
import { TUserPreferences } from "./TUserPreferences";
|
|
3
4
|
export type TAuthType = "email" | "apple" | "anonymous" | "token";
|
|
4
5
|
export type TGender = "male" | "female" | "unmentioned";
|
|
5
6
|
export type TUserType = "regular" | "professional";
|
|
@@ -11,12 +12,11 @@ export type TSubscriptionStatus = "active" | "cancelled" | "expired" | "trial" |
|
|
|
11
12
|
export type TSubscriptionType = "monthly" | "yearly" | "trial";
|
|
12
13
|
export type TSubscriptionTier = "enthusiast" | "pro" | "none";
|
|
13
14
|
export type TAppStore = "app_store" | "play_store" | null;
|
|
14
|
-
export type TActivityLevel = "sedentary" | "lightly-active" | "moderately-active" | "very-active";
|
|
15
15
|
export type TInjuryInfo = {
|
|
16
16
|
injuries: TAiUserInjury[];
|
|
17
17
|
createdAt: Date;
|
|
18
18
|
};
|
|
19
|
-
export type TUserMetric = {
|
|
19
|
+
export type TUserMetric = TUserPreferences & {
|
|
20
20
|
userId: string;
|
|
21
21
|
dob: Date;
|
|
22
22
|
userCode: string;
|
|
@@ -24,14 +24,9 @@ export type TUserMetric = {
|
|
|
24
24
|
userType: TUserType;
|
|
25
25
|
professionType?: TProfessionalCategory;
|
|
26
26
|
gender: TGender;
|
|
27
|
-
appLanguage: string;
|
|
28
|
-
fitnessGoals: TAiFitnessGoal[];
|
|
29
27
|
weightKg?: number;
|
|
30
28
|
heightCm?: number;
|
|
31
29
|
emailAddress?: string;
|
|
32
|
-
fitnessLevel?: TActivityLevel;
|
|
33
|
-
bodyFatPercentage?: number;
|
|
34
|
-
metricSystem: "US" | "EU";
|
|
35
30
|
injuryInfo?: TInjuryInfo;
|
|
36
31
|
subscriptionStatus: TSubscriptionStatus;
|
|
37
32
|
subscriptionType: TSubscriptionType;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TAiFitnessGoal } from "../constants";
|
|
2
|
+
import { TBodyPart } from "./TApiExercise";
|
|
3
|
+
export type TTrainingLocation = "gym" | "home" | "both";
|
|
4
|
+
export type TPreferredDuration = 20 | 30 | 45 | 60 | 90 | 120;
|
|
5
|
+
export type TAIDecision = "yes" | "no" | "ai_decide";
|
|
6
|
+
export type TWarmupStyle = "dynamic_stretching" | "light_cardio";
|
|
7
|
+
export type TPreferredEquipment = "machines" | "weights" | "free_hand";
|
|
8
|
+
export type TStablePreferences = {
|
|
9
|
+
trainingLocation: TTrainingLocation;
|
|
10
|
+
preferredDurationMinutes: TPreferredDuration;
|
|
11
|
+
fitnessGoals: TAiFitnessGoal[];
|
|
12
|
+
preferredEquipment: TPreferredEquipment[];
|
|
13
|
+
preferCompoundMovements: boolean;
|
|
14
|
+
includeWarmup: TAIDecision;
|
|
15
|
+
includeCooldown: TAIDecision;
|
|
16
|
+
warmupStyle: TWarmupStyle | null;
|
|
17
|
+
favouriteMuscleGroups: TBodyPart[];
|
|
18
|
+
blacklistedExerciseIds: string[];
|
|
19
|
+
fitnessLevel?: TActivityLevel;
|
|
20
|
+
bodyFatPercentage?: number;
|
|
21
|
+
metricSystem: "US" | "EU";
|
|
22
|
+
appLanguage: string;
|
|
23
|
+
preferencesUpdatedAt: string;
|
|
24
|
+
};
|
|
25
|
+
export type TActivityLevel = "sedentary" | "lightly-active" | "moderately-active" | "very-active";
|
|
26
|
+
export type TFemaleHealthContext = {
|
|
27
|
+
isPregnant: boolean;
|
|
28
|
+
trimester: 1 | 2 | 3 | null;
|
|
29
|
+
isOnPeriod: boolean;
|
|
30
|
+
femaleHealthUpdatedAt: string;
|
|
31
|
+
};
|
|
32
|
+
export type TUserPreferences = TStablePreferences & {
|
|
33
|
+
femaleHealth: TFemaleHealthContext | null;
|
|
34
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export type * from "./adminApi/TApiAttachment";
|
|
|
5
5
|
export type * from "./TApiTemplateData";
|
|
6
6
|
export type * from "./TApiBillingPlan";
|
|
7
7
|
export type * from "./TApiUser";
|
|
8
|
+
export type * from "./TUserPreferences";
|
|
8
9
|
export type * from "./TApiTemplateShop";
|
|
9
10
|
export type * from "./commonTypes";
|
|
10
11
|
export type * from "./TApiRevenueCat";
|