Update whoop extension to use Api V2
Description
Upgrade whoop extension to use API V2 (since V1 was deprecated a few days ago)
Checklist
- [x] I read the extension guidelines
- [x] I read the documentation about publishing
- [x] I ran
npm run buildand tested this distribution build in Raycast - [x] I checked that files in the
assetsfolder are used by the extension itself - [x] I checked that assets used in the
READMEare located outside the metadata folder if they were not generated with our metadata tool
Thank you for your contribution! :tada:
🔔 @Josha1len you might want to have a look.
You can use this guide to learn how to check out the Pull Request locally in order to test it.
📋 Quick checkout commands
BRANCH="fix-whoop-integration"
FORK_URL="https://github.com/Zeko369/raycast-extensions.git"
EXTENSION_NAME="whoop"
REPO_NAME="raycast-extensions"
git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev
We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.
Greptile Overview
Greptile Summary
This PR successfully migrates the WHOOP extension from the deprecated API V1 to V2. The migration includes comprehensive updates to all API endpoints (changed from /v1 to /v2), type definitions regenerated from the OpenAPI spec, and proper handling of breaking changes.
Key Changes:
- Regenerated API client (
whoop.api.ts) from V2 OpenAPI spec with updated types and endpoints - Removed 100+ line
sportNameslookup table since V2 API provides sport names directly viasport_namefield - Updated type names:
Workout→WorkoutV2,PaginatedRecoveryResponse→RecoveryCollection,PaginatedWorkoutResponse→WorkoutCollection - Changed
zone_durationtozone_durationsin workout scores - Added backward compatibility for sleep ID comparisons (V1 numeric vs V2 string IDs)
- Properly updated CHANGELOG with migration details
The migration is clean and maintains backward compatibility where needed. All type changes are consistently applied across the codebase.
Confidence Score: 5/5
- This PR is safe to merge - it's a straightforward API version migration with proper type updates and backward compatibility
- The migration is well-executed with auto-generated API types from OpenAPI spec, consistent updates across all files, proper changelog documentation, and thoughtful backward compatibility for ID format changes. The author tested the build and the changes align perfectly with moving from deprecated V1 to V2 API.
- No files require special attention
Important Files Changed
| Filename | Overview |
|---|---|
| extensions/whoop/CHANGELOG.md | Added changelog entry for API V2 migration following proper format with {PR_MERGE_DATE} placeholder |
| extensions/whoop/src/biometrics.tsx | Updated types and sleep ID comparison to handle V2 string IDs with backward compatibility for V1 numeric IDs |
| extensions/whoop/src/helpers/whoop.api.ts | Regenerated API client from OpenAPI spec: all endpoints migrated from /v1 to /v2, types updated including WorkoutV2, RecoveryCollection, ZoneDurations |
| extensions/whoop/src/workouts.tsx | Replaced Workout with WorkoutV2, removed getSportName() helper, uses workout.sport_name directly, updated zone_duration to zone_durations |
This pull request has been automatically marked as stale because it did not have any recent activity.
It will be closed if no further activity occurs in the next 7 days to keep our backlog clean 😊
Yo... will a ping un-stall this this?
thanks for this. how often does generate-api-schema need to be run? just wondering if it needs some instructions on README
Thanks @Zeko369! Looks like a great update. 🚀
thanks for this. how often does
generate-api-schemaneed to be run? just wondering if it needs some instructions on README
When they next release a new API so in a few years I hope... Should be fine, till then 😅
This pull request has been automatically marked as stale because it did not have any recent activity.
It will be closed if no further activity occurs in the next 7 days to keep our backlog clean 😊
Happy holidays everyone and sorry for the ping, but this is about to get auto-closed... could we get it merged or is there something missing here?
This pull request has been automatically marked as stale because it did not have any recent activity.
It will be closed if no further activity occurs in the next 7 days to keep our backlog clean 😊
This pull request has been automatically marked as stale because it did not have any recent activity.
It will be closed if no further activity occurs in the next 7 days to keep our backlog clean 😊
This pull request has been automatically closed due to inactivity.
Feel free to comment in the thread when you're ready to continue working on it 🙂
You can also catch us in Slack if you want to discuss this.
Published to the Raycast Store: https://raycast.com/josha1len/whoop
:tada: :tada: :tada:
We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.