@dgpholdings/greatoak-shared 1.2.75 → 1.2.76

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.
@@ -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", // Using a valid type from TSubscriptionType
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"];
@@ -1,5 +1,6 @@
1
1
  import type { TAiFitnessGoal, TAiBodyArea } from "../constants/AiExerciseVocabulary";
2
- import { TAuthType, TGender, TProfessionalCategory, TUserMetric, TUserType, TActivityLevel, TInjuryInfo } from "./TApiUser";
2
+ import { TAuthType, TGender, TProfessionalCategory, TUserMetric, TUserType, TInjuryInfo } from "./TApiUser";
3
+ import { TActivityLevel } from "./TUserPreferences";
3
4
  export type TOnboardingData = {
4
5
  userWeightKg: number;
5
6
  dob: Date;
@@ -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
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // TUserPreferences.ts
3
+ // Workout and training preferences for user profile
4
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dgpholdings/greatoak-shared",
3
- "version": "1.2.75",
3
+ "version": "1.2.76",
4
4
  "description": "Shared TypeScript types and utilities for @dgpholdings projects",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",