extensions icon indicating copy to clipboard operation
extensions copied to clipboard

Update whoop extension to use Api V2

Open Zeko369 opened this issue 3 months ago • 8 comments

Description

Upgrade whoop extension to use API V2 (since V1 was deprecated a few days ago)

Checklist

Zeko369 avatar Nov 20 '25 12:11 Zeko369

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.

raycastbot avatar Nov 20 '25 12:11 raycastbot

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 sportNames lookup table since V2 API provides sport names directly via sport_name field
  • Updated type names: WorkoutWorkoutV2, PaginatedRecoveryResponseRecoveryCollection, PaginatedWorkoutResponseWorkoutCollection
  • Changed zone_duration to zone_durations in 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

greptile-apps[bot] avatar Nov 20 '25 13:11 greptile-apps[bot]

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 😊

raycastbot avatar Dec 07 '25 16:12 raycastbot

Yo... will a ping un-stall this this?

Zeko369 avatar Dec 07 '25 18:12 Zeko369

thanks for this. how often does generate-api-schema need to be run? just wondering if it needs some instructions on README

peduarte avatar Dec 08 '25 10:12 peduarte

Thanks @Zeko369! Looks like a great update. 🚀

Josha1len avatar Dec 09 '25 00:12 Josha1len

thanks for this. how often does generate-api-schema need 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 😅

Zeko369 avatar Dec 09 '25 06:12 Zeko369

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 😊

raycastbot avatar Dec 24 '25 06:12 raycastbot

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?

Zeko369 avatar Dec 28 '25 07:12 Zeko369

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 😊

raycastbot avatar Jan 12 '26 08:01 raycastbot

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 😊

raycastbot avatar Jan 30 '26 03:01 raycastbot

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.

raycastbot avatar Feb 06 '26 03:02 raycastbot

Published to the Raycast Store: https://raycast.com/josha1len/whoop

github-actions[bot] avatar Feb 12 '26 11:02 github-actions[bot]

:tada: :tada: :tada:

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

raycastbot avatar Feb 12 '26 11:02 raycastbot