oauth2-cli 2.0.2 → 2.0.3
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/CHANGELOG.md +7 -0
- package/dist/Client.js +16 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [2.0.3](https://github.com/battis/oauth2-cli/compare/oauth2-cli/2.0.2...oauth2-cli/2.0.3) (2026-03-31)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* include request info with bad response ([508ff58](https://github.com/battis/oauth2-cli/commit/508ff5872ae0fdfd6674a507f1d713890818cf6c))
|
|
11
|
+
|
|
5
12
|
## [2.0.2](https://github.com/battis/oauth2-cli/compare/oauth2-cli/2.0.1...oauth2-cli/2.0.2) (2026-03-27)
|
|
6
13
|
|
|
7
14
|
|
package/dist/Client.js
CHANGED
|
@@ -352,7 +352,22 @@ export class Client extends EventEmitter {
|
|
|
352
352
|
*/
|
|
353
353
|
async request(url, method = 'GET', body, headers = {}, dPoPOptions) {
|
|
354
354
|
const response = await this.requestRaw(url, method, body, headers, dPoPOptions);
|
|
355
|
-
|
|
355
|
+
try {
|
|
356
|
+
return await this.processResponse(response);
|
|
357
|
+
}
|
|
358
|
+
catch (error) {
|
|
359
|
+
throw new Error(`${this.name} request resulted in bad response`, {
|
|
360
|
+
cause: {
|
|
361
|
+
request: {
|
|
362
|
+
method,
|
|
363
|
+
url,
|
|
364
|
+
headers: Object.fromEntries(requestish.Headers.from(headers).entries()),
|
|
365
|
+
body: requestish.Body.from(body)
|
|
366
|
+
},
|
|
367
|
+
error
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
}
|
|
356
371
|
}
|
|
357
372
|
/**
|
|
358
373
|
* Request a protected resource using the client's access token.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oauth2-cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Acquire API access tokens via OAuth 2.0 / OpenID Connect within CLI tools",
|
|
5
5
|
"homepage": "https://github.com/battis/oauth2-cli/tree/main/packages/oauth2-cli#readme",
|
|
6
6
|
"repository": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"open": "^11.0.0",
|
|
24
24
|
"openid-client": "^6.8.2",
|
|
25
25
|
"ora": "^9.3.0",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
26
|
+
"gcrtl": "0.1.12",
|
|
27
|
+
"requestish": "0.1.12"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@battis/typescript-tricks": "^0.8.1",
|