@openlifelog/sdk 1.0.7 → 1.0.9
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.d.mts +37 -1
- package/dist/index.d.ts +37 -1
- package/dist/index.js +40 -0
- package/dist/index.mjs +40 -0
- package/package.json +1 -1
- package/resources/ai.ts +23 -1
- package/resources/exercises.ts +28 -0
- package/types/ai.ts +27 -0
- package/types/exercise.ts +26 -0
package/dist/index.d.mts
CHANGED
|
@@ -247,6 +247,24 @@ interface QuickEntryFoodLogRequest {
|
|
|
247
247
|
loggedAt?: DateTime;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
+
interface MuscleGroupEntity {
|
|
251
|
+
id: UUID;
|
|
252
|
+
name: string;
|
|
253
|
+
medicalName?: string;
|
|
254
|
+
bodyPart?: string;
|
|
255
|
+
description?: string;
|
|
256
|
+
createdAt: DateTime;
|
|
257
|
+
deletedAt?: DateTime;
|
|
258
|
+
}
|
|
259
|
+
interface ExerciseEquipmentEntity {
|
|
260
|
+
id: UUID;
|
|
261
|
+
name: string;
|
|
262
|
+
category?: string;
|
|
263
|
+
description?: string;
|
|
264
|
+
isActive: boolean;
|
|
265
|
+
createdAt: DateTime;
|
|
266
|
+
deletedAt?: DateTime;
|
|
267
|
+
}
|
|
250
268
|
interface ExerciseCapabilities {
|
|
251
269
|
supportsWeight: boolean;
|
|
252
270
|
isBodyweight: boolean;
|
|
@@ -726,6 +744,21 @@ interface FoodInsightsResponse {
|
|
|
726
744
|
}
|
|
727
745
|
interface GetFoodInsightsParams extends DateRangeParams {
|
|
728
746
|
}
|
|
747
|
+
interface EnrichedExerciseData {
|
|
748
|
+
description: string;
|
|
749
|
+
exerciseType: string;
|
|
750
|
+
movementPattern: string;
|
|
751
|
+
forceDirection: string;
|
|
752
|
+
primaryMuscles: string[];
|
|
753
|
+
secondaryMuscles: string[];
|
|
754
|
+
equipment: string[];
|
|
755
|
+
}
|
|
756
|
+
interface ExerciseEnrichmentRequest {
|
|
757
|
+
exerciseName: string;
|
|
758
|
+
}
|
|
759
|
+
interface ExerciseEnrichmentResponse {
|
|
760
|
+
enrichedData: EnrichedExerciseData;
|
|
761
|
+
}
|
|
729
762
|
|
|
730
763
|
interface OpenLifeLogConfig {
|
|
731
764
|
apiKey?: string;
|
|
@@ -912,6 +945,8 @@ declare class ExercisesResource {
|
|
|
912
945
|
getFavorites(params?: ListExercisesParams): Promise<ListResponse<Exercise>>;
|
|
913
946
|
addToFavorites(exerciseId: string): Promise<void>;
|
|
914
947
|
removeFromFavorites(exerciseId: string): Promise<void>;
|
|
948
|
+
getMuscleGroups(): Promise<MuscleGroupEntity[]>;
|
|
949
|
+
getEquipment(): Promise<ExerciseEquipmentEntity[]>;
|
|
915
950
|
}
|
|
916
951
|
|
|
917
952
|
declare class WorkoutsResource {
|
|
@@ -1025,6 +1060,7 @@ declare class AIResource {
|
|
|
1025
1060
|
private http;
|
|
1026
1061
|
constructor(http: HttpClient);
|
|
1027
1062
|
getFoodInsights(params?: GetFoodInsightsParams): Promise<FoodInsightsResponse>;
|
|
1063
|
+
enrichExercise(request: ExerciseEnrichmentRequest): Promise<ExerciseEnrichmentResponse>;
|
|
1028
1064
|
}
|
|
1029
1065
|
|
|
1030
1066
|
declare class OpenLifeLog {
|
|
@@ -1109,4 +1145,4 @@ declare class UnitConversionError extends OpenLifeLogError {
|
|
|
1109
1145
|
constructor(message?: string, rawError?: any);
|
|
1110
1146
|
}
|
|
1111
1147
|
|
|
1112
|
-
export { ACTIVITY_METRICS, ALL_METRICS, type AddExerciseItem, type AddExercisesToWorkoutRequest, type AuthResponse, AuthenticationError, AuthorizationError, BODY_METRICS, type BulkCreateMetricEventsRequest, type BulkCreateNutritionGoalsRequest, type CopyNutritionGoalsRequest, type CountResponse, type CreateExerciseRequest, type CreateFoodLogRequest, type CreateFoodRequest, type CreateMetricEventRequest, type CreateNutritionGoalsRequest, type CreateProgramRequest, type CreateUserGoalRequest, type CreateWorkoutRequest, type CreateWorkoutSessionRequest, type CurrentWeekSchedule, type DailyGoalProgress, type DailyMetricAggregate, type DailyNutritionProgress, type DailyNutritionSummary, type DateRangeParams, type DateString, type DateTime, DistanceConverter, type EnrollInProgramRequest, type EnrollmentProgress, type Equipment, type ErrorResponse, type Exercise, type ExerciseCapabilities, type ExerciseCategory, type ExerciseHistory, type ExerciseHistoryEntry, type Food, type FoodInsightsResponse, type FoodLog, type ForceDirection, type GetDailyMetricParams, type GetDailySummaryParams, type GetFoodInsightsParams, type GoalProgress, type GoalProgressStatus, type GoalTargetType, HeightConverter, type Insight, type InsightSeverity, type InsightType, type ListExercisesParams, type ListFoodLogsParams, type ListFoodsParams, type ListMetricEventsParams, type ListNutritionGoalsHistoryParams, type ListParams, type ListResponse, type ListWorkoutSessionsParams, type ListWorkoutsParams, type LoginRequest, type MealType, type MeasurementSystem, type Metric, type MetricAggregationType, type MetricCategory, type MetricDefinition, type MetricEvent, type MovementPattern, type MuscleGroup, NetworkError, NotFoundError, type NutritionGoal, type NutritionGoalType, type NutritionProgress, type NutritionalInformation, OpenLifeLog, type OpenLifeLogConfig, OpenLifeLogError, type PageInfo, PaginatedIterator, type PasswordResetConfirm, type PasswordResetRequest, type PersonalRecord, type PersonalRecordHistory, type PersonalRecordHistoryEntry, type Program, type ProgramEnrollment, type ProgramMetadata, type ProgramScheduleDay, type ProgramScheduleExercise, type QuickEntryFoodLogRequest, RateLimitError, type Recommendation, type RecordType, SLEEP_METRICS, type SearchParams, ServerError, type ServingSize, type SessionExerciseDetail, type SessionStatus, type SetData, type SignupRequest, type SuccessResponse, TimeoutError, type UUID, UnitConversionError, UnitConverter, type UpdateEnrollmentRequest, type UpdateExerciseItem, type UpdateExerciseRequest, type UpdateFoodLogRequest, type UpdateFoodRequest, type UpdateMetricEventRequest, type UpdateNutritionGoalsRequest, type UpdatePreferencesRequest, type UpdateProgramRequest, type UpdateUserGoalRequest, type UpdateUserRequest, type UpdateWorkoutExerciseRequest, type UpdateWorkoutRequest, type UpdateWorkoutSessionRequest, type User, type UserGoal, type UserNutritionGoals, type UserPreferences, VITAL_METRICS, ValidationError, WELLNESS_METRICS, WeightConverter, type Workout, type WorkoutExercise, type WorkoutFormat, type WorkoutSession, createPaginatedIterator, createUnitConverter, OpenLifeLog as default, fetchAllPages, getMetricDefinition, getMetricsByCategory, hasMorePages };
|
|
1148
|
+
export { ACTIVITY_METRICS, ALL_METRICS, type AddExerciseItem, type AddExercisesToWorkoutRequest, type AuthResponse, AuthenticationError, AuthorizationError, BODY_METRICS, type BulkCreateMetricEventsRequest, type BulkCreateNutritionGoalsRequest, type CopyNutritionGoalsRequest, type CountResponse, type CreateExerciseRequest, type CreateFoodLogRequest, type CreateFoodRequest, type CreateMetricEventRequest, type CreateNutritionGoalsRequest, type CreateProgramRequest, type CreateUserGoalRequest, type CreateWorkoutRequest, type CreateWorkoutSessionRequest, type CurrentWeekSchedule, type DailyGoalProgress, type DailyMetricAggregate, type DailyNutritionProgress, type DailyNutritionSummary, type DateRangeParams, type DateString, type DateTime, DistanceConverter, type EnrichedExerciseData, type EnrollInProgramRequest, type EnrollmentProgress, type Equipment, type ErrorResponse, type Exercise, type ExerciseCapabilities, type ExerciseCategory, type ExerciseEnrichmentRequest, type ExerciseEnrichmentResponse, type ExerciseEquipmentEntity, type ExerciseHistory, type ExerciseHistoryEntry, type Food, type FoodInsightsResponse, type FoodLog, type ForceDirection, type GetDailyMetricParams, type GetDailySummaryParams, type GetFoodInsightsParams, type GoalProgress, type GoalProgressStatus, type GoalTargetType, HeightConverter, type Insight, type InsightSeverity, type InsightType, type ListExercisesParams, type ListFoodLogsParams, type ListFoodsParams, type ListMetricEventsParams, type ListNutritionGoalsHistoryParams, type ListParams, type ListResponse, type ListWorkoutSessionsParams, type ListWorkoutsParams, type LoginRequest, type MealType, type MeasurementSystem, type Metric, type MetricAggregationType, type MetricCategory, type MetricDefinition, type MetricEvent, type MovementPattern, type MuscleGroup, type MuscleGroupEntity, NetworkError, NotFoundError, type NutritionGoal, type NutritionGoalType, type NutritionProgress, type NutritionalInformation, OpenLifeLog, type OpenLifeLogConfig, OpenLifeLogError, type PageInfo, PaginatedIterator, type PasswordResetConfirm, type PasswordResetRequest, type PersonalRecord, type PersonalRecordHistory, type PersonalRecordHistoryEntry, type Program, type ProgramEnrollment, type ProgramMetadata, type ProgramScheduleDay, type ProgramScheduleExercise, type QuickEntryFoodLogRequest, RateLimitError, type Recommendation, type RecordType, SLEEP_METRICS, type SearchParams, ServerError, type ServingSize, type SessionExerciseDetail, type SessionStatus, type SetData, type SignupRequest, type SuccessResponse, TimeoutError, type UUID, UnitConversionError, UnitConverter, type UpdateEnrollmentRequest, type UpdateExerciseItem, type UpdateExerciseRequest, type UpdateFoodLogRequest, type UpdateFoodRequest, type UpdateMetricEventRequest, type UpdateNutritionGoalsRequest, type UpdatePreferencesRequest, type UpdateProgramRequest, type UpdateUserGoalRequest, type UpdateUserRequest, type UpdateWorkoutExerciseRequest, type UpdateWorkoutRequest, type UpdateWorkoutSessionRequest, type User, type UserGoal, type UserNutritionGoals, type UserPreferences, VITAL_METRICS, ValidationError, WELLNESS_METRICS, WeightConverter, type Workout, type WorkoutExercise, type WorkoutFormat, type WorkoutSession, createPaginatedIterator, createUnitConverter, OpenLifeLog as default, fetchAllPages, getMetricDefinition, getMetricsByCategory, hasMorePages };
|
package/dist/index.d.ts
CHANGED
|
@@ -247,6 +247,24 @@ interface QuickEntryFoodLogRequest {
|
|
|
247
247
|
loggedAt?: DateTime;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
+
interface MuscleGroupEntity {
|
|
251
|
+
id: UUID;
|
|
252
|
+
name: string;
|
|
253
|
+
medicalName?: string;
|
|
254
|
+
bodyPart?: string;
|
|
255
|
+
description?: string;
|
|
256
|
+
createdAt: DateTime;
|
|
257
|
+
deletedAt?: DateTime;
|
|
258
|
+
}
|
|
259
|
+
interface ExerciseEquipmentEntity {
|
|
260
|
+
id: UUID;
|
|
261
|
+
name: string;
|
|
262
|
+
category?: string;
|
|
263
|
+
description?: string;
|
|
264
|
+
isActive: boolean;
|
|
265
|
+
createdAt: DateTime;
|
|
266
|
+
deletedAt?: DateTime;
|
|
267
|
+
}
|
|
250
268
|
interface ExerciseCapabilities {
|
|
251
269
|
supportsWeight: boolean;
|
|
252
270
|
isBodyweight: boolean;
|
|
@@ -726,6 +744,21 @@ interface FoodInsightsResponse {
|
|
|
726
744
|
}
|
|
727
745
|
interface GetFoodInsightsParams extends DateRangeParams {
|
|
728
746
|
}
|
|
747
|
+
interface EnrichedExerciseData {
|
|
748
|
+
description: string;
|
|
749
|
+
exerciseType: string;
|
|
750
|
+
movementPattern: string;
|
|
751
|
+
forceDirection: string;
|
|
752
|
+
primaryMuscles: string[];
|
|
753
|
+
secondaryMuscles: string[];
|
|
754
|
+
equipment: string[];
|
|
755
|
+
}
|
|
756
|
+
interface ExerciseEnrichmentRequest {
|
|
757
|
+
exerciseName: string;
|
|
758
|
+
}
|
|
759
|
+
interface ExerciseEnrichmentResponse {
|
|
760
|
+
enrichedData: EnrichedExerciseData;
|
|
761
|
+
}
|
|
729
762
|
|
|
730
763
|
interface OpenLifeLogConfig {
|
|
731
764
|
apiKey?: string;
|
|
@@ -912,6 +945,8 @@ declare class ExercisesResource {
|
|
|
912
945
|
getFavorites(params?: ListExercisesParams): Promise<ListResponse<Exercise>>;
|
|
913
946
|
addToFavorites(exerciseId: string): Promise<void>;
|
|
914
947
|
removeFromFavorites(exerciseId: string): Promise<void>;
|
|
948
|
+
getMuscleGroups(): Promise<MuscleGroupEntity[]>;
|
|
949
|
+
getEquipment(): Promise<ExerciseEquipmentEntity[]>;
|
|
915
950
|
}
|
|
916
951
|
|
|
917
952
|
declare class WorkoutsResource {
|
|
@@ -1025,6 +1060,7 @@ declare class AIResource {
|
|
|
1025
1060
|
private http;
|
|
1026
1061
|
constructor(http: HttpClient);
|
|
1027
1062
|
getFoodInsights(params?: GetFoodInsightsParams): Promise<FoodInsightsResponse>;
|
|
1063
|
+
enrichExercise(request: ExerciseEnrichmentRequest): Promise<ExerciseEnrichmentResponse>;
|
|
1028
1064
|
}
|
|
1029
1065
|
|
|
1030
1066
|
declare class OpenLifeLog {
|
|
@@ -1109,4 +1145,4 @@ declare class UnitConversionError extends OpenLifeLogError {
|
|
|
1109
1145
|
constructor(message?: string, rawError?: any);
|
|
1110
1146
|
}
|
|
1111
1147
|
|
|
1112
|
-
export { ACTIVITY_METRICS, ALL_METRICS, type AddExerciseItem, type AddExercisesToWorkoutRequest, type AuthResponse, AuthenticationError, AuthorizationError, BODY_METRICS, type BulkCreateMetricEventsRequest, type BulkCreateNutritionGoalsRequest, type CopyNutritionGoalsRequest, type CountResponse, type CreateExerciseRequest, type CreateFoodLogRequest, type CreateFoodRequest, type CreateMetricEventRequest, type CreateNutritionGoalsRequest, type CreateProgramRequest, type CreateUserGoalRequest, type CreateWorkoutRequest, type CreateWorkoutSessionRequest, type CurrentWeekSchedule, type DailyGoalProgress, type DailyMetricAggregate, type DailyNutritionProgress, type DailyNutritionSummary, type DateRangeParams, type DateString, type DateTime, DistanceConverter, type EnrollInProgramRequest, type EnrollmentProgress, type Equipment, type ErrorResponse, type Exercise, type ExerciseCapabilities, type ExerciseCategory, type ExerciseHistory, type ExerciseHistoryEntry, type Food, type FoodInsightsResponse, type FoodLog, type ForceDirection, type GetDailyMetricParams, type GetDailySummaryParams, type GetFoodInsightsParams, type GoalProgress, type GoalProgressStatus, type GoalTargetType, HeightConverter, type Insight, type InsightSeverity, type InsightType, type ListExercisesParams, type ListFoodLogsParams, type ListFoodsParams, type ListMetricEventsParams, type ListNutritionGoalsHistoryParams, type ListParams, type ListResponse, type ListWorkoutSessionsParams, type ListWorkoutsParams, type LoginRequest, type MealType, type MeasurementSystem, type Metric, type MetricAggregationType, type MetricCategory, type MetricDefinition, type MetricEvent, type MovementPattern, type MuscleGroup, NetworkError, NotFoundError, type NutritionGoal, type NutritionGoalType, type NutritionProgress, type NutritionalInformation, OpenLifeLog, type OpenLifeLogConfig, OpenLifeLogError, type PageInfo, PaginatedIterator, type PasswordResetConfirm, type PasswordResetRequest, type PersonalRecord, type PersonalRecordHistory, type PersonalRecordHistoryEntry, type Program, type ProgramEnrollment, type ProgramMetadata, type ProgramScheduleDay, type ProgramScheduleExercise, type QuickEntryFoodLogRequest, RateLimitError, type Recommendation, type RecordType, SLEEP_METRICS, type SearchParams, ServerError, type ServingSize, type SessionExerciseDetail, type SessionStatus, type SetData, type SignupRequest, type SuccessResponse, TimeoutError, type UUID, UnitConversionError, UnitConverter, type UpdateEnrollmentRequest, type UpdateExerciseItem, type UpdateExerciseRequest, type UpdateFoodLogRequest, type UpdateFoodRequest, type UpdateMetricEventRequest, type UpdateNutritionGoalsRequest, type UpdatePreferencesRequest, type UpdateProgramRequest, type UpdateUserGoalRequest, type UpdateUserRequest, type UpdateWorkoutExerciseRequest, type UpdateWorkoutRequest, type UpdateWorkoutSessionRequest, type User, type UserGoal, type UserNutritionGoals, type UserPreferences, VITAL_METRICS, ValidationError, WELLNESS_METRICS, WeightConverter, type Workout, type WorkoutExercise, type WorkoutFormat, type WorkoutSession, createPaginatedIterator, createUnitConverter, OpenLifeLog as default, fetchAllPages, getMetricDefinition, getMetricsByCategory, hasMorePages };
|
|
1148
|
+
export { ACTIVITY_METRICS, ALL_METRICS, type AddExerciseItem, type AddExercisesToWorkoutRequest, type AuthResponse, AuthenticationError, AuthorizationError, BODY_METRICS, type BulkCreateMetricEventsRequest, type BulkCreateNutritionGoalsRequest, type CopyNutritionGoalsRequest, type CountResponse, type CreateExerciseRequest, type CreateFoodLogRequest, type CreateFoodRequest, type CreateMetricEventRequest, type CreateNutritionGoalsRequest, type CreateProgramRequest, type CreateUserGoalRequest, type CreateWorkoutRequest, type CreateWorkoutSessionRequest, type CurrentWeekSchedule, type DailyGoalProgress, type DailyMetricAggregate, type DailyNutritionProgress, type DailyNutritionSummary, type DateRangeParams, type DateString, type DateTime, DistanceConverter, type EnrichedExerciseData, type EnrollInProgramRequest, type EnrollmentProgress, type Equipment, type ErrorResponse, type Exercise, type ExerciseCapabilities, type ExerciseCategory, type ExerciseEnrichmentRequest, type ExerciseEnrichmentResponse, type ExerciseEquipmentEntity, type ExerciseHistory, type ExerciseHistoryEntry, type Food, type FoodInsightsResponse, type FoodLog, type ForceDirection, type GetDailyMetricParams, type GetDailySummaryParams, type GetFoodInsightsParams, type GoalProgress, type GoalProgressStatus, type GoalTargetType, HeightConverter, type Insight, type InsightSeverity, type InsightType, type ListExercisesParams, type ListFoodLogsParams, type ListFoodsParams, type ListMetricEventsParams, type ListNutritionGoalsHistoryParams, type ListParams, type ListResponse, type ListWorkoutSessionsParams, type ListWorkoutsParams, type LoginRequest, type MealType, type MeasurementSystem, type Metric, type MetricAggregationType, type MetricCategory, type MetricDefinition, type MetricEvent, type MovementPattern, type MuscleGroup, type MuscleGroupEntity, NetworkError, NotFoundError, type NutritionGoal, type NutritionGoalType, type NutritionProgress, type NutritionalInformation, OpenLifeLog, type OpenLifeLogConfig, OpenLifeLogError, type PageInfo, PaginatedIterator, type PasswordResetConfirm, type PasswordResetRequest, type PersonalRecord, type PersonalRecordHistory, type PersonalRecordHistoryEntry, type Program, type ProgramEnrollment, type ProgramMetadata, type ProgramScheduleDay, type ProgramScheduleExercise, type QuickEntryFoodLogRequest, RateLimitError, type Recommendation, type RecordType, SLEEP_METRICS, type SearchParams, ServerError, type ServingSize, type SessionExerciseDetail, type SessionStatus, type SetData, type SignupRequest, type SuccessResponse, TimeoutError, type UUID, UnitConversionError, UnitConverter, type UpdateEnrollmentRequest, type UpdateExerciseItem, type UpdateExerciseRequest, type UpdateFoodLogRequest, type UpdateFoodRequest, type UpdateMetricEventRequest, type UpdateNutritionGoalsRequest, type UpdatePreferencesRequest, type UpdateProgramRequest, type UpdateUserGoalRequest, type UpdateUserRequest, type UpdateWorkoutExerciseRequest, type UpdateWorkoutRequest, type UpdateWorkoutSessionRequest, type User, type UserGoal, type UserNutritionGoals, type UserPreferences, VITAL_METRICS, ValidationError, WELLNESS_METRICS, WeightConverter, type Workout, type WorkoutExercise, type WorkoutFormat, type WorkoutSession, createPaginatedIterator, createUnitConverter, OpenLifeLog as default, fetchAllPages, getMetricDefinition, getMetricsByCategory, hasMorePages };
|
package/dist/index.js
CHANGED
|
@@ -1469,6 +1469,30 @@ var ExercisesResource = class {
|
|
|
1469
1469
|
async removeFromFavorites(exerciseId) {
|
|
1470
1470
|
await this.http.delete(`/v1/exercises/${exerciseId}/favorite`);
|
|
1471
1471
|
}
|
|
1472
|
+
/**
|
|
1473
|
+
* Get all muscle groups
|
|
1474
|
+
*
|
|
1475
|
+
* @example
|
|
1476
|
+
* ```typescript
|
|
1477
|
+
* const muscleGroups = await client.exercises.getMuscleGroups();
|
|
1478
|
+
* ```
|
|
1479
|
+
*/
|
|
1480
|
+
async getMuscleGroups() {
|
|
1481
|
+
const response = await this.http.get("/v1/exercises/muscle-groups");
|
|
1482
|
+
return response.data;
|
|
1483
|
+
}
|
|
1484
|
+
/**
|
|
1485
|
+
* Get all exercise equipment
|
|
1486
|
+
*
|
|
1487
|
+
* @example
|
|
1488
|
+
* ```typescript
|
|
1489
|
+
* const equipment = await client.exercises.getEquipment();
|
|
1490
|
+
* ```
|
|
1491
|
+
*/
|
|
1492
|
+
async getEquipment() {
|
|
1493
|
+
const response = await this.http.get("/v1/exercises/equipment");
|
|
1494
|
+
return response.data;
|
|
1495
|
+
}
|
|
1472
1496
|
};
|
|
1473
1497
|
|
|
1474
1498
|
// resources/workouts.ts
|
|
@@ -2222,6 +2246,22 @@ var AIResource = class {
|
|
|
2222
2246
|
const response = await this.http.get("/v1/ai/food-insights", params);
|
|
2223
2247
|
return response.data;
|
|
2224
2248
|
}
|
|
2249
|
+
/**
|
|
2250
|
+
* Enrich exercise information using AI
|
|
2251
|
+
*
|
|
2252
|
+
* @example
|
|
2253
|
+
* ```typescript
|
|
2254
|
+
* const enriched = await client.ai.enrichExercise({
|
|
2255
|
+
* exerciseName: 'Bench Press'
|
|
2256
|
+
* });
|
|
2257
|
+
* console.log(enriched.enrichedData.description);
|
|
2258
|
+
* console.log(enriched.enrichedData.primaryMuscles);
|
|
2259
|
+
* ```
|
|
2260
|
+
*/
|
|
2261
|
+
async enrichExercise(request) {
|
|
2262
|
+
const response = await this.http.post("/v1/ai/enrich-exercise", request);
|
|
2263
|
+
return response.data;
|
|
2264
|
+
}
|
|
2225
2265
|
};
|
|
2226
2266
|
|
|
2227
2267
|
// client.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1415,6 +1415,30 @@ var ExercisesResource = class {
|
|
|
1415
1415
|
async removeFromFavorites(exerciseId) {
|
|
1416
1416
|
await this.http.delete(`/v1/exercises/${exerciseId}/favorite`);
|
|
1417
1417
|
}
|
|
1418
|
+
/**
|
|
1419
|
+
* Get all muscle groups
|
|
1420
|
+
*
|
|
1421
|
+
* @example
|
|
1422
|
+
* ```typescript
|
|
1423
|
+
* const muscleGroups = await client.exercises.getMuscleGroups();
|
|
1424
|
+
* ```
|
|
1425
|
+
*/
|
|
1426
|
+
async getMuscleGroups() {
|
|
1427
|
+
const response = await this.http.get("/v1/exercises/muscle-groups");
|
|
1428
|
+
return response.data;
|
|
1429
|
+
}
|
|
1430
|
+
/**
|
|
1431
|
+
* Get all exercise equipment
|
|
1432
|
+
*
|
|
1433
|
+
* @example
|
|
1434
|
+
* ```typescript
|
|
1435
|
+
* const equipment = await client.exercises.getEquipment();
|
|
1436
|
+
* ```
|
|
1437
|
+
*/
|
|
1438
|
+
async getEquipment() {
|
|
1439
|
+
const response = await this.http.get("/v1/exercises/equipment");
|
|
1440
|
+
return response.data;
|
|
1441
|
+
}
|
|
1418
1442
|
};
|
|
1419
1443
|
|
|
1420
1444
|
// resources/workouts.ts
|
|
@@ -2168,6 +2192,22 @@ var AIResource = class {
|
|
|
2168
2192
|
const response = await this.http.get("/v1/ai/food-insights", params);
|
|
2169
2193
|
return response.data;
|
|
2170
2194
|
}
|
|
2195
|
+
/**
|
|
2196
|
+
* Enrich exercise information using AI
|
|
2197
|
+
*
|
|
2198
|
+
* @example
|
|
2199
|
+
* ```typescript
|
|
2200
|
+
* const enriched = await client.ai.enrichExercise({
|
|
2201
|
+
* exerciseName: 'Bench Press'
|
|
2202
|
+
* });
|
|
2203
|
+
* console.log(enriched.enrichedData.description);
|
|
2204
|
+
* console.log(enriched.enrichedData.primaryMuscles);
|
|
2205
|
+
* ```
|
|
2206
|
+
*/
|
|
2207
|
+
async enrichExercise(request) {
|
|
2208
|
+
const response = await this.http.post("/v1/ai/enrich-exercise", request);
|
|
2209
|
+
return response.data;
|
|
2210
|
+
}
|
|
2171
2211
|
};
|
|
2172
2212
|
|
|
2173
2213
|
// client.ts
|
package/package.json
CHANGED
package/resources/ai.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { HttpClient } from '../utils/http';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
FoodInsightsResponse,
|
|
4
|
+
GetFoodInsightsParams,
|
|
5
|
+
ExerciseEnrichmentRequest,
|
|
6
|
+
ExerciseEnrichmentResponse
|
|
7
|
+
} from '../types';
|
|
3
8
|
|
|
4
9
|
/**
|
|
5
10
|
* AI resource
|
|
@@ -23,4 +28,21 @@ export class AIResource {
|
|
|
23
28
|
const response = await this.http.get<FoodInsightsResponse>('/v1/ai/food-insights', params);
|
|
24
29
|
return response.data;
|
|
25
30
|
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Enrich exercise information using AI
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const enriched = await client.ai.enrichExercise({
|
|
38
|
+
* exerciseName: 'Bench Press'
|
|
39
|
+
* });
|
|
40
|
+
* console.log(enriched.enrichedData.description);
|
|
41
|
+
* console.log(enriched.enrichedData.primaryMuscles);
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
async enrichExercise(request: ExerciseEnrichmentRequest): Promise<ExerciseEnrichmentResponse> {
|
|
45
|
+
const response = await this.http.post<ExerciseEnrichmentResponse>('/v1/ai/enrich-exercise', request);
|
|
46
|
+
return response.data;
|
|
47
|
+
}
|
|
26
48
|
}
|
package/resources/exercises.ts
CHANGED
|
@@ -6,6 +6,8 @@ import type {
|
|
|
6
6
|
ListExercisesParams,
|
|
7
7
|
ListResponse,
|
|
8
8
|
CountResponse,
|
|
9
|
+
MuscleGroupEntity,
|
|
10
|
+
ExerciseEquipmentEntity,
|
|
9
11
|
} from '../types';
|
|
10
12
|
import { createPaginatedIterator, type PaginatedIterator } from '../utils/pagination';
|
|
11
13
|
|
|
@@ -109,4 +111,30 @@ export class ExercisesResource {
|
|
|
109
111
|
async removeFromFavorites(exerciseId: string): Promise<void> {
|
|
110
112
|
await this.http.delete(`/v1/exercises/${exerciseId}/favorite`);
|
|
111
113
|
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Get all muscle groups
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```typescript
|
|
120
|
+
* const muscleGroups = await client.exercises.getMuscleGroups();
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
async getMuscleGroups(): Promise<MuscleGroupEntity[]> {
|
|
124
|
+
const response = await this.http.get<MuscleGroupEntity[]>('/v1/exercises/muscle-groups');
|
|
125
|
+
return response.data;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Get all exercise equipment
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* const equipment = await client.exercises.getEquipment();
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
async getEquipment(): Promise<ExerciseEquipmentEntity[]> {
|
|
137
|
+
const response = await this.http.get<ExerciseEquipmentEntity[]>('/v1/exercises/equipment');
|
|
138
|
+
return response.data;
|
|
139
|
+
}
|
|
112
140
|
}
|
package/types/ai.ts
CHANGED
|
@@ -53,3 +53,30 @@ export interface FoodInsightsResponse {
|
|
|
53
53
|
* Get food insights parameters
|
|
54
54
|
*/
|
|
55
55
|
export interface GetFoodInsightsParams extends DateRangeParams {}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Enriched exercise data from AI
|
|
59
|
+
*/
|
|
60
|
+
export interface EnrichedExerciseData {
|
|
61
|
+
description: string;
|
|
62
|
+
exerciseType: string;
|
|
63
|
+
movementPattern: string;
|
|
64
|
+
forceDirection: string;
|
|
65
|
+
primaryMuscles: string[];
|
|
66
|
+
secondaryMuscles: string[];
|
|
67
|
+
equipment: string[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Exercise enrichment request
|
|
72
|
+
*/
|
|
73
|
+
export interface ExerciseEnrichmentRequest {
|
|
74
|
+
exerciseName: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Exercise enrichment response
|
|
79
|
+
*/
|
|
80
|
+
export interface ExerciseEnrichmentResponse {
|
|
81
|
+
enrichedData: EnrichedExerciseData;
|
|
82
|
+
}
|
package/types/exercise.ts
CHANGED
|
@@ -13,6 +13,32 @@ import type {
|
|
|
13
13
|
* Exercise types
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Muscle group entity from database
|
|
18
|
+
*/
|
|
19
|
+
export interface MuscleGroupEntity {
|
|
20
|
+
id: UUID;
|
|
21
|
+
name: string;
|
|
22
|
+
medicalName?: string;
|
|
23
|
+
bodyPart?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
createdAt: DateTime;
|
|
26
|
+
deletedAt?: DateTime;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Exercise equipment entity from database
|
|
31
|
+
*/
|
|
32
|
+
export interface ExerciseEquipmentEntity {
|
|
33
|
+
id: UUID;
|
|
34
|
+
name: string;
|
|
35
|
+
category?: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
isActive: boolean;
|
|
38
|
+
createdAt: DateTime;
|
|
39
|
+
deletedAt?: DateTime;
|
|
40
|
+
}
|
|
41
|
+
|
|
16
42
|
/**
|
|
17
43
|
* Exercise capabilities
|
|
18
44
|
*/
|