@dgpholdings/greatoak-shared 1.2.77 → 1.2.79
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.
|
@@ -13,6 +13,7 @@ export type TApiAiQuickStartWorkoutReq = {
|
|
|
13
13
|
/**
|
|
14
14
|
* Optional: How much time the user has for the workout.
|
|
15
15
|
* Helps the AI determine the number of exercises and sets.
|
|
16
|
+
* If not provided, defaults to user's saved preferredDurationMinutes preference.
|
|
16
17
|
*/
|
|
17
18
|
availableTimeMinutes?: number;
|
|
18
19
|
/**
|
|
@@ -22,6 +23,7 @@ export type TApiAiQuickStartWorkoutReq = {
|
|
|
22
23
|
timezone: string;
|
|
23
24
|
/**
|
|
24
25
|
* Whether the user intends to work out at home or at the gym today.
|
|
26
|
+
* If not provided, defaults to user's saved trainingLocation preference.
|
|
25
27
|
*/
|
|
26
28
|
workoutLocation: "home" | "gym";
|
|
27
29
|
/**
|
|
@@ -29,6 +31,22 @@ export type TApiAiQuickStartWorkoutReq = {
|
|
|
29
31
|
* Can influence warm-up duration and intensity (e.g., morning stiffness vs. evening fatigue, Afternoon: (Peak Performance)).
|
|
30
32
|
*/
|
|
31
33
|
workoutTime: "morning" | "afternoon" | "evening" | "night";
|
|
34
|
+
/**
|
|
35
|
+
* Optional: Female health context override for this specific workout.
|
|
36
|
+
* Indicates if the user is on their period today, which helps the AI:
|
|
37
|
+
* - Adjust workout intensity and volume appropriately
|
|
38
|
+
* - Include more stretching and mobility work
|
|
39
|
+
* - Avoid high-impact movements if needed
|
|
40
|
+
* - Consider energy levels more conservatively
|
|
41
|
+
*
|
|
42
|
+
* If provided, this overrides the user's saved femaleHealth.isOnPeriod preference for this workout only.
|
|
43
|
+
* If not provided, the worker will use the value from the user's profile.
|
|
44
|
+
*
|
|
45
|
+
* Note: This is a session-level override. The createJobController will optionally sync this
|
|
46
|
+
* value back to the user's profile asynchronously (fire-and-forget) to keep preferences in sync,
|
|
47
|
+
* but the job creation and processing are not dependent on this sync succeeding.
|
|
48
|
+
*/
|
|
49
|
+
isOnPeriod?: boolean;
|
|
32
50
|
};
|
|
33
51
|
export type TAiEnrichedContext = {
|
|
34
52
|
qdrantFilters: {
|
package/dist/utils/time.util.js
CHANGED
|
@@ -25,15 +25,7 @@ const getDaysAndHoursDifference = ({ oldDate, newDate, }) => {
|
|
|
25
25
|
};
|
|
26
26
|
exports.getDaysAndHoursDifference = getDaysAndHoursDifference;
|
|
27
27
|
const isUserAllowedToUpdate = ({ createdAt, updatedAt }) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
oldDate: updatedAt,
|
|
31
|
-
newDate: now,
|
|
32
|
-
});
|
|
33
|
-
const diffUserCreationAndLastUpdate = (0, exports.getDaysAndHoursDifference)({
|
|
34
|
-
oldDate: createdAt,
|
|
35
|
-
newDate: updatedAt,
|
|
36
|
-
});
|
|
37
|
-
return diffUserCreationAndLastUpdate.hours <= 1 || sinceLastUpdated.hours > 8;
|
|
28
|
+
// Time restriction removed - users can always update their profile
|
|
29
|
+
return true;
|
|
38
30
|
};
|
|
39
31
|
exports.isUserAllowedToUpdate = isUserAllowedToUpdate;
|