@andreasnlarsen/whoop-cli 0.1.3 → 0.1.4

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.
@@ -59,15 +59,17 @@ export const exchangeAuthCode = async (config, code) => {
59
59
  redirect_uri: config.redirectUri,
60
60
  });
61
61
  };
62
- export const refreshAuthToken = async (config, refreshToken, scope) => {
62
+ export const refreshAuthToken = async (config, refreshToken) => {
63
63
  if (!refreshToken)
64
64
  throw usageError('Refresh token is required');
65
+ // WHOOP docs (OAuth refresh flow) require scope=offline in refresh requests.
66
+ // Using token-issued scope strings here can produce malformed refresh requests.
65
67
  return exchange(config, {
66
68
  grant_type: 'refresh_token',
67
69
  refresh_token: refreshToken,
68
70
  client_id: config.clientId,
69
71
  client_secret: config.clientSecret,
70
- ...(scope ? { scope } : {}),
72
+ scope: 'offline',
71
73
  });
72
74
  };
73
75
  export const parseAuthInput = (input) => {
@@ -41,7 +41,7 @@ export const refreshProfileToken = async (profileName) => withRefreshLock(profil
41
41
  if (!refreshToken) {
42
42
  throw authError('No refresh token available. Re-run whoop auth login with offline scope.');
43
43
  }
44
- const refreshed = await refreshAuthToken(toOAuthConfig(profile), refreshToken, profile.tokens?.scope);
44
+ const refreshed = await refreshAuthToken(toOAuthConfig(profile), refreshToken);
45
45
  profile.tokens = tokenFromOAuth(refreshed, refreshToken);
46
46
  await saveProfile(profileName, profile);
47
47
  return profile;
@@ -14,7 +14,7 @@ metadata:
14
14
  homepage: https://github.com/andreasnlarsen/whoop-cli
15
15
  install:
16
16
  - kind: node
17
- package: "@andreasnlarsen/whoop-cli"
17
+ package: "@andreasnlarsen/whoop-cli@0.1.3"
18
18
  bins:
19
19
  - whoop
20
20
  label: Install whoop-cli from npm
@@ -37,7 +37,7 @@ Use the installed `whoop` command.
37
37
  If `whoop` is missing:
38
38
 
39
39
  ```bash
40
- npm install -g @andreasnlarsen/whoop-cli
40
+ npm install -g @andreasnlarsen/whoop-cli@0.1.3
41
41
  ```
42
42
 
43
43
  Optional OpenClaw skill install from package bundle:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andreasnlarsen/whoop-cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Open-source WHOOP CLI for humans and agents",
5
5
  "type": "module",
6
6
  "license": "MIT",