oauth2-cli 1.2.5 → 1.2.8

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 CHANGED
@@ -2,47 +2,53 @@
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
- ## [1.2.5](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.2.4...oauth2-cli/1.2.5) (2026-03-08)
5
+ ## [1.2.8](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.2.7...oauth2-cli/1.2.8) (2026-03-17)
6
+
7
+ ### Bug Fixes
8
+
9
+ - log unparseable body if unparseable as JSON ([183bcc7](https://github.com/battis/oauth2-cli/commit/183bcc750f4f2dded5bc5f4d9fbc01fb6624e651))
6
10
 
11
+ ## [1.2.6](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.2.5...oauth2-cli/1.2.6) (2026-03-10)
7
12
 
8
13
  ### Bug Fixes
9
14
 
10
- * use the full power of requestish to build request URL ([ff4da89](https://github.com/battis/oauth2-cli/commit/ff4da8900e83df0d4dbd941058084523ad7ce3a6))
15
+ - update dev vs peer dependencies ([f21dc01](https://github.com/battis/oauth2-cli/commit/f21dc0108fcc786fa6edd5015fa835da856a9af0))
11
16
 
12
- ## [1.2.4](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.2.3...oauth2-cli/1.2.4) (2026-03-08)
17
+ ## [1.2.5](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.2.4...oauth2-cli/1.2.5) (2026-03-08)
18
+
19
+ ### Bug Fixes
20
+
21
+ - use the full power of requestish to build request URL ([ff4da89](https://github.com/battis/oauth2-cli/commit/ff4da8900e83df0d4dbd941058084523ad7ce3a6))
13
22
 
23
+ ## [1.2.4](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.2.3...oauth2-cli/1.2.4) (2026-03-08)
14
24
 
15
25
  ### Bug Fixes
16
26
 
17
- * actually fix base_url completion removing search params ([2575df7](https://github.com/battis/oauth2-cli/commit/2575df7250ec1c5c0ba76ab5f7babc40b2e5a07d))
27
+ - actually fix base_url completion removing search params ([2575df7](https://github.com/battis/oauth2-cli/commit/2575df7250ec1c5c0ba76ab5f7babc40b2e5a07d))
18
28
 
19
29
  ## [1.2.3](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.2.2...oauth2-cli/1.2.3) (2026-03-08)
20
30
 
21
31
  ## [1.2.2](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.2.1...oauth2-cli/1.2.2) (2026-03-08)
22
32
 
23
-
24
33
  ### Bug Fixes
25
34
 
26
- * don't lose search params when building url from base or credentials.issuer ([a328c96](https://github.com/battis/oauth2-cli/commit/a328c9693d0a39cccc7d6f38bd24065b6f633c1b))
35
+ - don't lose search params when building url from base or credentials.issuer ([a328c96](https://github.com/battis/oauth2-cli/commit/a328c9693d0a39cccc7d6f38bd24065b6f633c1b))
27
36
 
28
37
  ## [1.2.1](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.2.0...oauth2-cli/1.2.1) (2026-03-08)
29
38
 
30
-
31
39
  ### Bug Fixes
32
40
 
33
- * still more detail on JSON error ([d9d28ce](https://github.com/battis/oauth2-cli/commit/d9d28ce8145a5c29288f28317041e8545b232a1e))
41
+ - still more detail on JSON error ([d9d28ce](https://github.com/battis/oauth2-cli/commit/d9d28ce8145a5c29288f28317041e8545b232a1e))
34
42
 
35
43
  ## [1.2.0](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.1.5...oauth2-cli/1.2.0) (2026-03-08)
36
44
 
37
-
38
45
  ### Features
39
46
 
40
- * add prepareResponse hook ([c1ada04](https://github.com/battis/oauth2-cli/commit/c1ada04c20f08a5dac11414b44ea188f4aafe76d))
41
-
47
+ - add prepareResponse hook ([c1ada04](https://github.com/battis/oauth2-cli/commit/c1ada04c20f08a5dac11414b44ea188f4aafe76d))
42
48
 
43
49
  ### Bug Fixes
44
50
 
45
- * more detailed error response on JSON parse fail ([b8c414d](https://github.com/battis/oauth2-cli/commit/b8c414d650a7acfce8d2d297639fbecddd5f2382))
51
+ - more detailed error response on JSON parse fail ([b8c414d](https://github.com/battis/oauth2-cli/commit/b8c414d650a7acfce8d2d297639fbecddd5f2382))
46
52
 
47
53
  ## [1.1.5](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.1.4...oauth2-cli/1.1.5) (2026-03-07)
48
54
 
package/dist/Client.js CHANGED
@@ -287,12 +287,13 @@ export class Client extends EventEmitter {
287
287
  /** Parse a fetch response as JSON, typing it as J */
288
288
  async toJSON(response) {
289
289
  if (response.ok) {
290
+ const body = await response.text();
290
291
  try {
291
- return (await response.json());
292
+ return JSON.parse(body);
292
293
  }
293
- catch (cause) {
294
+ catch (error) {
294
295
  throw new Error(`${this.name} response could not be parsed as JSON`, {
295
- cause
296
+ cause: { error, body }
296
297
  });
297
298
  }
298
299
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oauth2-cli",
3
- "version": "1.2.5",
3
+ "version": "1.2.8",
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": {
@@ -16,19 +16,18 @@
16
16
  "main": "./dist/index.js",
17
17
  "types": "./dist/index.d.ts",
18
18
  "dependencies": {
19
- "@qui-cli/colors": "^3.2.3",
19
+ "@battis/descriptive-types": "^0.2.6",
20
20
  "async-mutex": "^0.5.0",
21
21
  "express": "^5.2.1",
22
22
  "oauth4webapi": "^3.8.5",
23
23
  "open": "^11.0.0",
24
24
  "openid-client": "^6.8.2",
25
25
  "ora": "^9.3.0",
26
- "requestish": "0.1.10",
27
- "gcrtl": "0.1.11"
26
+ "requestish": "0.1.12",
27
+ "gcrtl": "0.1.12"
28
28
  },
29
29
  "devDependencies": {
30
- "@battis/descriptive-types": "^0.2.6",
31
- "@battis/typescript-tricks": "^0.8.0",
30
+ "@battis/typescript-tricks": "^0.8.1",
32
31
  "@tsconfig/node24": "^24.0.4",
33
32
  "@types/express": "^5.0.6",
34
33
  "@types/node": "^24.12.0",
@@ -38,6 +37,8 @@
38
37
  "typescript": "^5.9.3"
39
38
  },
40
39
  "peerDependencies": {
40
+ "@qui-cli/colors": ">=3.2",
41
+ "@types/ejs": "*",
41
42
  "ejs": "*"
42
43
  },
43
44
  "peerDependencyMeta": {