build: update openapi spec and regenerate api client - #305
Conversation
📝 WalkthroughWalkthroughThe pull request extends the OpenAPI specification with new user information and body measurements API endpoints, removes nullability constraints from existing routine schema fields, updates the internal Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #305 +/- ##
=======================================
Coverage 69.29% 69.29%
=======================================
Files 14 14
Lines 508 508
Branches 157 157
=======================================
Hits 352 352
Misses 97 97
Partials 59 59 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
✨ PR Review
LGTM
Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how
There was a problem hiding this comment.
Code Review
This pull request introduces new API endpoints for user information and body measurements, along with corresponding updates to the generated client code, schemas, and mocks. It also refines rep range logic and corrects API call signatures in the client utility. Feedback was provided to improve the consistency of the body measurement schema by appending a _cm suffix to several properties, such as abdomen and waist, to align with existing fields like neck_cm.
| "abdomen": { | ||
| "type": "number", | ||
| "nullable": true, | ||
| "example": 85 | ||
| }, |
There was a problem hiding this comment.
For consistency with other measurement properties that have a _cm suffix (e.g., neck_cm, shoulder_cm), consider renaming this property to abdomen_cm.
This would improve the predictability of the API schema for consumers. This suggestion also applies to the following properties in both BodyMeasurement and PutBodyMeasurement schemas:
waisthipsleft_thighright_thighleft_calfright_calf
There was a problem hiding this comment.
🧹 Nitpick comments (1)
openapi-spec.json (1)
334-1330: Newuser/infoandbody_measurementsendpoints are in the spec/generated client but not wired intocreateClientor any MCP tool.The regenerated client now exposes
getV1UserInfo,getV1BodyMeasurements,postV1BodyMeasurements,getV1BodyMeasurementsDate, andputV1BodyMeasurementsDate, butsrc/utils/hevyClientKubb.tsdoes not add corresponding wrappers and there are no MCP tools for them. If that is intentional (to be done in a follow-up PR), no action needed; otherwise consider exposing them now so the generated code is actually reachable.Want me to draft the wrapper methods in
hevyClientKubb.tsand/or scaffold MCP tools (src/tools/users.ts,src/tools/measurements.ts) in a follow-up?🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@openapi-spec.json` around lines 334 - 1330, The client spec added endpoints (operationIds getV1UserInfo, getV1BodyMeasurements, postV1BodyMeasurements, getV1BodyMeasurementsDate, putV1BodyMeasurementsDate) but src/utils/hevyClientKubb.ts doesn't expose wrappers and there are no MCP tools; fix by adding thin wrapper methods in hevyClientKubb.ts that call the generated client operations (use the same operationId names to find generated functions) and then scaffold corresponding MCP tool modules (e.g., src/tools/users.ts exporting a getUserInfo wrapper and src/tools/measurements.ts exporting listMeasurements, createMeasurement, getMeasurementByDate, updateMeasurementByDate) that import the new hevyClientKubb methods and re-export ergonomic functions for use by the app or tests.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@openapi-spec.json`:
- Around line 334-1330: The client spec added endpoints (operationIds
getV1UserInfo, getV1BodyMeasurements, postV1BodyMeasurements,
getV1BodyMeasurementsDate, putV1BodyMeasurementsDate) but
src/utils/hevyClientKubb.ts doesn't expose wrappers and there are no MCP tools;
fix by adding thin wrapper methods in hevyClientKubb.ts that call the generated
client operations (use the same operationId names to find generated functions)
and then scaffold corresponding MCP tool modules (e.g., src/tools/users.ts
exporting a getUserInfo wrapper and src/tools/measurements.ts exporting
listMeasurements, createMeasurement, getMeasurementByDate,
updateMeasurementByDate) that import the new hevyClientKubb methods and
re-export ergonomic functions for use by the app or tests.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 717ad267-e7cd-4051-b237-13b27846728a
⛔ Files ignored due to path filters (206)
src/generated/.kubb/config.tsis excluded by!**/generated/**src/generated/client/api/getV1BodyMeasurements.tsis excluded by!**/generated/**src/generated/client/api/getV1BodyMeasurementsDate.tsis excluded by!**/generated/**src/generated/client/api/getV1ExerciseHistoryExercisetemplateid.tsis excluded by!**/generated/**src/generated/client/api/getV1ExerciseTemplates.tsis excluded by!**/generated/**src/generated/client/api/getV1ExerciseTemplatesExercisetemplateid.tsis excluded by!**/generated/**src/generated/client/api/getV1RoutineFolders.tsis excluded by!**/generated/**src/generated/client/api/getV1RoutineFoldersFolderid.tsis excluded by!**/generated/**src/generated/client/api/getV1Routines.tsis excluded by!**/generated/**src/generated/client/api/getV1RoutinesRoutineid.tsis excluded by!**/generated/**src/generated/client/api/getV1UserInfo.tsis excluded by!**/generated/**src/generated/client/api/getV1Workouts.tsis excluded by!**/generated/**src/generated/client/api/getV1WorkoutsCount.tsis excluded by!**/generated/**src/generated/client/api/getV1WorkoutsEvents.tsis excluded by!**/generated/**src/generated/client/api/getV1WorkoutsWorkoutid.tsis excluded by!**/generated/**src/generated/client/api/index.tsis excluded by!**/generated/**src/generated/client/api/postV1BodyMeasurements.tsis excluded by!**/generated/**src/generated/client/api/postV1ExerciseTemplates.tsis excluded by!**/generated/**src/generated/client/api/postV1RoutineFolders.tsis excluded by!**/generated/**src/generated/client/api/postV1Routines.tsis excluded by!**/generated/**src/generated/client/api/postV1Workouts.tsis excluded by!**/generated/**src/generated/client/api/putV1BodyMeasurementsDate.tsis excluded by!**/generated/**src/generated/client/api/putV1RoutinesRoutineid.tsis excluded by!**/generated/**src/generated/client/api/putV1WorkoutsWorkoutid.tsis excluded by!**/generated/**src/generated/client/bodyMeasurement.jsonis excluded by!**/generated/**src/generated/client/createCustomExerciseRequestBody.jsonis excluded by!**/generated/**src/generated/client/customExerciseType.jsonis excluded by!**/generated/**src/generated/client/deletedWorkout.jsonis excluded by!**/generated/**src/generated/client/equipmentCategory.jsonis excluded by!**/generated/**src/generated/client/exercise.jsonis excluded by!**/generated/**src/generated/client/exerciseHistoryEntry.jsonis excluded by!**/generated/**src/generated/client/exerciseTemplate.jsonis excluded by!**/generated/**src/generated/client/mocks/createBodyMeasurement.tsis excluded by!**/generated/**src/generated/client/mocks/createCreateCustomExerciseRequestBody.tsis excluded by!**/generated/**src/generated/client/mocks/createCustomExerciseType.tsis excluded by!**/generated/**src/generated/client/mocks/createDeletedWorkout.tsis excluded by!**/generated/**src/generated/client/mocks/createEquipmentCategory.tsis excluded by!**/generated/**src/generated/client/mocks/createExercise.tsis excluded by!**/generated/**src/generated/client/mocks/createExerciseHistoryEntry.tsis excluded by!**/generated/**src/generated/client/mocks/createExerciseTemplate.tsis excluded by!**/generated/**src/generated/client/mocks/createGetV1BodyMeasurements.tsis excluded by!**/generated/**src/generated/client/mocks/createGetV1BodyMeasurementsDate.tsis excluded by!**/generated/**src/generated/client/mocks/createGetV1ExerciseHistoryExercisetemplateid.tsis excluded by!**/generated/**src/generated/client/mocks/createGetV1ExerciseTemplates.tsis excluded by!**/generated/**src/generated/client/mocks/createGetV1ExerciseTemplatesExercisetemplateid.tsis excluded by!**/generated/**src/generated/client/mocks/createGetV1RoutineFolders.tsis excluded by!**/generated/**src/generated/client/mocks/createGetV1RoutineFoldersFolderid.tsis excluded by!**/generated/**src/generated/client/mocks/createGetV1Routines.tsis excluded by!**/generated/**src/generated/client/mocks/createGetV1RoutinesRoutineid.tsis excluded by!**/generated/**src/generated/client/mocks/createGetV1UserInfo.tsis excluded by!**/generated/**src/generated/client/mocks/createGetV1Workouts.tsis excluded by!**/generated/**src/generated/client/mocks/createGetV1WorkoutsCount.tsis excluded by!**/generated/**src/generated/client/mocks/createGetV1WorkoutsEvents.tsis excluded by!**/generated/**src/generated/client/mocks/createGetV1WorkoutsWorkoutid.tsis excluded by!**/generated/**src/generated/client/mocks/createMuscleGroup.tsis excluded by!**/generated/**src/generated/client/mocks/createPaginatedWorkoutEvents.tsis excluded by!**/generated/**src/generated/client/mocks/createPostRoutineFolderRequestBody.tsis excluded by!**/generated/**src/generated/client/mocks/createPostRoutinesRequestBody.tsis excluded by!**/generated/**src/generated/client/mocks/createPostRoutinesRequestExercise.tsis excluded by!**/generated/**src/generated/client/mocks/createPostRoutinesRequestSet.tsis excluded by!**/generated/**src/generated/client/mocks/createPostV1BodyMeasurements.tsis excluded by!**/generated/**src/generated/client/mocks/createPostV1ExerciseTemplates.tsis excluded by!**/generated/**src/generated/client/mocks/createPostV1RoutineFolders.tsis excluded by!**/generated/**src/generated/client/mocks/createPostV1Routines.tsis excluded by!**/generated/**src/generated/client/mocks/createPostV1Workouts.tsis excluded by!**/generated/**src/generated/client/mocks/createPostWorkoutsRequestBody.tsis excluded by!**/generated/**src/generated/client/mocks/createPostWorkoutsRequestExercise.tsis excluded by!**/generated/**src/generated/client/mocks/createPostWorkoutsRequestSet.tsis excluded by!**/generated/**src/generated/client/mocks/createPutBodyMeasurement.tsis excluded by!**/generated/**src/generated/client/mocks/createPutRoutinesRequestBody.tsis excluded by!**/generated/**src/generated/client/mocks/createPutRoutinesRequestExercise.tsis excluded by!**/generated/**src/generated/client/mocks/createPutRoutinesRequestSet.tsis excluded by!**/generated/**src/generated/client/mocks/createPutV1BodyMeasurementsDate.tsis excluded by!**/generated/**src/generated/client/mocks/createPutV1RoutinesRoutineid.tsis excluded by!**/generated/**src/generated/client/mocks/createPutV1WorkoutsWorkoutid.tsis excluded by!**/generated/**src/generated/client/mocks/createRoutine.tsis excluded by!**/generated/**src/generated/client/mocks/createRoutineFolder.tsis excluded by!**/generated/**src/generated/client/mocks/createSet.tsis excluded by!**/generated/**src/generated/client/mocks/createUpdatedWorkout.tsis excluded by!**/generated/**src/generated/client/mocks/createUserInfo.tsis excluded by!**/generated/**src/generated/client/mocks/createUserInfoResponse.tsis excluded by!**/generated/**src/generated/client/mocks/createWorkout.tsis excluded by!**/generated/**src/generated/client/mocks/index.tsis excluded by!**/generated/**src/generated/client/muscleGroup.jsonis excluded by!**/generated/**src/generated/client/paginatedWorkoutEvents.jsonis excluded by!**/generated/**src/generated/client/postRoutineFolderRequestBody.jsonis excluded by!**/generated/**src/generated/client/postRoutinesRequestBody.jsonis excluded by!**/generated/**src/generated/client/postRoutinesRequestExercise.jsonis excluded by!**/generated/**src/generated/client/postRoutinesRequestSet.jsonis excluded by!**/generated/**src/generated/client/postWorkoutsRequestBody.jsonis excluded by!**/generated/**src/generated/client/postWorkoutsRequestExercise.jsonis excluded by!**/generated/**src/generated/client/postWorkoutsRequestSet.jsonis excluded by!**/generated/**src/generated/client/putBodyMeasurement.jsonis excluded by!**/generated/**src/generated/client/putRoutinesRequestBody.jsonis excluded by!**/generated/**src/generated/client/putRoutinesRequestExercise.jsonis excluded by!**/generated/**src/generated/client/putRoutinesRequestSet.jsonis excluded by!**/generated/**src/generated/client/routine.jsonis excluded by!**/generated/**src/generated/client/routineFolder.jsonis excluded by!**/generated/**src/generated/client/schemas/bodyMeasurementSchema.tsis excluded by!**/generated/**src/generated/client/schemas/createCustomExerciseRequestBodySchema.tsis excluded by!**/generated/**src/generated/client/schemas/customExerciseTypeSchema.tsis excluded by!**/generated/**src/generated/client/schemas/deletedWorkoutSchema.tsis excluded by!**/generated/**src/generated/client/schemas/equipmentCategorySchema.tsis excluded by!**/generated/**src/generated/client/schemas/exerciseHistoryEntrySchema.tsis excluded by!**/generated/**src/generated/client/schemas/exerciseSchema.tsis excluded by!**/generated/**src/generated/client/schemas/exerciseTemplateSchema.tsis excluded by!**/generated/**src/generated/client/schemas/getV1BodyMeasurementsDateSchema.tsis excluded by!**/generated/**src/generated/client/schemas/getV1BodyMeasurementsSchema.tsis excluded by!**/generated/**src/generated/client/schemas/getV1ExerciseHistoryExercisetemplateidSchema.tsis excluded by!**/generated/**src/generated/client/schemas/getV1ExerciseTemplatesExercisetemplateidSchema.tsis excluded by!**/generated/**src/generated/client/schemas/getV1ExerciseTemplatesSchema.tsis excluded by!**/generated/**src/generated/client/schemas/getV1RoutineFoldersFolderidSchema.tsis excluded by!**/generated/**src/generated/client/schemas/getV1RoutineFoldersSchema.tsis excluded by!**/generated/**src/generated/client/schemas/getV1RoutinesRoutineidSchema.tsis excluded by!**/generated/**src/generated/client/schemas/getV1RoutinesSchema.tsis excluded by!**/generated/**src/generated/client/schemas/getV1UserInfoSchema.tsis excluded by!**/generated/**src/generated/client/schemas/getV1WorkoutsCountSchema.tsis excluded by!**/generated/**src/generated/client/schemas/getV1WorkoutsEventsSchema.tsis excluded by!**/generated/**src/generated/client/schemas/getV1WorkoutsSchema.tsis excluded by!**/generated/**src/generated/client/schemas/getV1WorkoutsWorkoutidSchema.tsis excluded by!**/generated/**src/generated/client/schemas/index.tsis excluded by!**/generated/**src/generated/client/schemas/muscleGroupSchema.tsis excluded by!**/generated/**src/generated/client/schemas/paginatedWorkoutEventsSchema.tsis excluded by!**/generated/**src/generated/client/schemas/postRoutineFolderRequestBodySchema.tsis excluded by!**/generated/**src/generated/client/schemas/postRoutinesRequestBodySchema.tsis excluded by!**/generated/**src/generated/client/schemas/postRoutinesRequestExerciseSchema.tsis excluded by!**/generated/**src/generated/client/schemas/postRoutinesRequestSetSchema.tsis excluded by!**/generated/**src/generated/client/schemas/postV1BodyMeasurementsSchema.tsis excluded by!**/generated/**src/generated/client/schemas/postV1ExerciseTemplatesSchema.tsis excluded by!**/generated/**src/generated/client/schemas/postV1RoutineFoldersSchema.tsis excluded by!**/generated/**src/generated/client/schemas/postV1RoutinesSchema.tsis excluded by!**/generated/**src/generated/client/schemas/postV1WorkoutsSchema.tsis excluded by!**/generated/**src/generated/client/schemas/postWorkoutsRequestBodySchema.tsis excluded by!**/generated/**src/generated/client/schemas/postWorkoutsRequestExerciseSchema.tsis excluded by!**/generated/**src/generated/client/schemas/postWorkoutsRequestSetSchema.tsis excluded by!**/generated/**src/generated/client/schemas/putBodyMeasurementSchema.tsis excluded by!**/generated/**src/generated/client/schemas/putRoutinesRequestBodySchema.tsis excluded by!**/generated/**src/generated/client/schemas/putRoutinesRequestExerciseSchema.tsis excluded by!**/generated/**src/generated/client/schemas/putRoutinesRequestSetSchema.tsis excluded by!**/generated/**src/generated/client/schemas/putV1BodyMeasurementsDateSchema.tsis excluded by!**/generated/**src/generated/client/schemas/putV1RoutinesRoutineidSchema.tsis excluded by!**/generated/**src/generated/client/schemas/putV1WorkoutsWorkoutidSchema.tsis excluded by!**/generated/**src/generated/client/schemas/routineFolderSchema.tsis excluded by!**/generated/**src/generated/client/schemas/routineSchema.tsis excluded by!**/generated/**src/generated/client/schemas/setSchema.tsis excluded by!**/generated/**src/generated/client/schemas/updatedWorkoutSchema.tsis excluded by!**/generated/**src/generated/client/schemas/userInfoResponseSchema.tsis excluded by!**/generated/**src/generated/client/schemas/userInfoSchema.tsis excluded by!**/generated/**src/generated/client/schemas/workoutSchema.tsis excluded by!**/generated/**src/generated/client/set.jsonis excluded by!**/generated/**src/generated/client/types/BodyMeasurement.tsis excluded by!**/generated/**src/generated/client/types/CreateCustomExerciseRequestBody.tsis excluded by!**/generated/**src/generated/client/types/CustomExerciseType.tsis excluded by!**/generated/**src/generated/client/types/DeletedWorkout.tsis excluded by!**/generated/**src/generated/client/types/EquipmentCategory.tsis excluded by!**/generated/**src/generated/client/types/Exercise.tsis excluded by!**/generated/**src/generated/client/types/ExerciseHistoryEntry.tsis excluded by!**/generated/**src/generated/client/types/ExerciseTemplate.tsis excluded by!**/generated/**src/generated/client/types/GetV1BodyMeasurements.tsis excluded by!**/generated/**src/generated/client/types/GetV1BodyMeasurementsDate.tsis excluded by!**/generated/**src/generated/client/types/GetV1ExerciseHistoryExercisetemplateid.tsis excluded by!**/generated/**src/generated/client/types/GetV1ExerciseTemplates.tsis excluded by!**/generated/**src/generated/client/types/GetV1ExerciseTemplatesExercisetemplateid.tsis excluded by!**/generated/**src/generated/client/types/GetV1RoutineFolders.tsis excluded by!**/generated/**src/generated/client/types/GetV1RoutineFoldersFolderid.tsis excluded by!**/generated/**src/generated/client/types/GetV1Routines.tsis excluded by!**/generated/**src/generated/client/types/GetV1RoutinesRoutineid.tsis excluded by!**/generated/**src/generated/client/types/GetV1UserInfo.tsis excluded by!**/generated/**src/generated/client/types/GetV1Workouts.tsis excluded by!**/generated/**src/generated/client/types/GetV1WorkoutsCount.tsis excluded by!**/generated/**src/generated/client/types/GetV1WorkoutsEvents.tsis excluded by!**/generated/**src/generated/client/types/GetV1WorkoutsWorkoutid.tsis excluded by!**/generated/**src/generated/client/types/MuscleGroup.tsis excluded by!**/generated/**src/generated/client/types/PaginatedWorkoutEvents.tsis excluded by!**/generated/**src/generated/client/types/PostRoutineFolderRequestBody.tsis excluded by!**/generated/**src/generated/client/types/PostRoutinesRequestBody.tsis excluded by!**/generated/**src/generated/client/types/PostRoutinesRequestExercise.tsis excluded by!**/generated/**src/generated/client/types/PostRoutinesRequestSet.tsis excluded by!**/generated/**src/generated/client/types/PostV1BodyMeasurements.tsis excluded by!**/generated/**src/generated/client/types/PostV1ExerciseTemplates.tsis excluded by!**/generated/**src/generated/client/types/PostV1RoutineFolders.tsis excluded by!**/generated/**src/generated/client/types/PostV1Routines.tsis excluded by!**/generated/**src/generated/client/types/PostV1Workouts.tsis excluded by!**/generated/**src/generated/client/types/PostWorkoutsRequestBody.tsis excluded by!**/generated/**src/generated/client/types/PostWorkoutsRequestExercise.tsis excluded by!**/generated/**src/generated/client/types/PostWorkoutsRequestSet.tsis excluded by!**/generated/**src/generated/client/types/PutBodyMeasurement.tsis excluded by!**/generated/**src/generated/client/types/PutRoutinesRequestBody.tsis excluded by!**/generated/**src/generated/client/types/PutRoutinesRequestExercise.tsis excluded by!**/generated/**src/generated/client/types/PutRoutinesRequestSet.tsis excluded by!**/generated/**src/generated/client/types/PutV1BodyMeasurementsDate.tsis excluded by!**/generated/**src/generated/client/types/PutV1RoutinesRoutineid.tsis excluded by!**/generated/**src/generated/client/types/PutV1WorkoutsWorkoutid.tsis excluded by!**/generated/**src/generated/client/types/Routine.tsis excluded by!**/generated/**src/generated/client/types/RoutineFolder.tsis excluded by!**/generated/**src/generated/client/types/Set.tsis excluded by!**/generated/**src/generated/client/types/UpdatedWorkout.tsis excluded by!**/generated/**src/generated/client/types/UserInfo.tsis excluded by!**/generated/**src/generated/client/types/UserInfoResponse.tsis excluded by!**/generated/**src/generated/client/types/Workout.tsis excluded by!**/generated/**src/generated/client/types/index.tsis excluded by!**/generated/**src/generated/client/updatedWorkout.jsonis excluded by!**/generated/**src/generated/client/userInfo.jsonis excluded by!**/generated/**src/generated/client/userInfoResponse.jsonis excluded by!**/generated/**src/generated/client/workout.jsonis excluded by!**/generated/**src/generated/index.tsis excluded by!**/generated/**
📒 Files selected for processing (3)
openapi-spec.jsonsrc/tools/routines.tssrc/utils/hevyClientKubb.ts
# [1.22.0](v1.21.20...v1.22.0) (2026-04-23) ### Features * update openapi spec and regenerate api client ([#305](#305)) ([0bfad15](0bfad15))
Brings in body-measurements MCP tools (chrisdoc#306) and regenerated Kubb client (chrisdoc#305) from upstream; preserves fork-only Streamable HTTP and OAuth 2.1 transports.
Update the Hevy OpenAPI spec to the latest version and regenerate the API client.
Changes
npm run build:clientdatanow beforeheadersto match new generated signatures)buildRepRangereturn type to useundefinedinstead ofnullfor optional fields, matching the regenerated typesSummary by CodeRabbit
New Features
Bug Fixes
✨ PR Description
Purpose: Regenerate API client from updated OpenAPI spec to add body measurements and user info endpoints.
Main changes:
Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how