@oauth2-cli/qui-cli 1.1.3 → 1.2.1

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,34 +2,41 @@
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.1.3](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/1.1.2...qui-cli-plugin/1.1.3) (2026-03-04)
5
+ ## [1.2.1](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/1.2.0...qui-cli-plugin/1.2.1) (2026-03-06)
6
+
7
+ Bump to requestish@01.1.6
8
+
9
+ ## [1.2.0](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/1.1.3...qui-cli-plugin/1.2.0) (2026-03-05)
10
+
11
+ ### Features
6
12
 
13
+ - added prepareRequest hook ([3deaaaa](https://github.com/battis/oauth2-cli/commit/3deaaaa1ec8939b507953f436f0cd500f01736e8))
14
+ - make URLSearchParams even more 'ish', accepting all JSON primitives ([b1c2a25](https://github.com/battis/oauth2-cli/commit/b1c2a25c29267c070070f7cd304bb31f854485e4))
15
+
16
+ ## [1.1.3](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/1.1.2...qui-cli-plugin/1.1.3) (2026-03-04)
7
17
 
8
18
  ### Bug Fixes
9
19
 
10
- * allow requestish.Body.ish request bodies as intended ([f12a2ce](https://github.com/battis/oauth2-cli/commit/f12a2ceb1c517f6fd90b33c8c71da7f987af640d))
20
+ - allow requestish.Body.ish request bodies as intended ([f12a2ce](https://github.com/battis/oauth2-cli/commit/f12a2ceb1c517f6fd90b33c8c71da7f987af640d))
11
21
 
12
22
  ## [1.1.2](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/1.1.1...qui-cli-plugin/1.1.2) (2026-03-04)
13
23
 
14
-
15
24
  ### Bug Fixes
16
25
 
17
- * improve JSOn debugging output ([a197307](https://github.com/battis/oauth2-cli/commit/a19730721ac53666a2c4e4e4982abf85353386e3))
18
- * improved response debugging output ([2c63583](https://github.com/battis/oauth2-cli/commit/2c635834e2e2a21c519b3d3bcec8ac26b1d70bbf))
26
+ - improve JSOn debugging output ([a197307](https://github.com/battis/oauth2-cli/commit/a19730721ac53666a2c4e4e4982abf85353386e3))
27
+ - improved response debugging output ([2c63583](https://github.com/battis/oauth2-cli/commit/2c635834e2e2a21c519b3d3bcec8ac26b1d70bbf))
19
28
 
20
29
  ## [1.1.1](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/1.1.0...qui-cli-plugin/1.1.1) (2026-03-04)
21
30
 
22
-
23
31
  ### Bug Fixes
24
32
 
25
- * extend Client without breaking Client ([1115a71](https://github.com/battis/oauth2-cli/commit/1115a714228294b7fd2057706504645a48f94cb8))
33
+ - extend Client without breaking Client ([1115a71](https://github.com/battis/oauth2-cli/commit/1115a714228294b7fd2057706504645a48f94cb8))
26
34
 
27
35
  ## [1.1.0](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/1.0.3...qui-cli-plugin/1.1.0) (2026-03-04)
28
36
 
29
-
30
37
  ### Features
31
38
 
32
- * improve logging of request information ([f138d2e](https://github.com/battis/oauth2-cli/commit/f138d2ed048c87480ffb9d272024ce90943beca2))
39
+ - improve logging of request information ([f138d2e](https://github.com/battis/oauth2-cli/commit/f138d2ed048c87480ffb9d272024ce90943beca2))
33
40
 
34
41
  ## [1.0.3](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/1.0.2...qui-cli-plugin/1.0.3) (2026-03-03)
35
42
 
package/dist/Client.d.ts CHANGED
@@ -19,6 +19,7 @@ export declare class Client<C extends OAuth2CLI.Credentials = OAuth2CLI.Credenti
19
19
  handleAuthorizationCodeRedirect(request: Request, session: OAuth2CLI.Localhost.Server): Promise<OAuth2CLI.Token.Response>;
20
20
  protected refreshTokenGrant({ refresh_token, inject }?: Parameters<OAuth2CLI.Client['refreshTokenGrant']>[0]): Promise<OAuth2CLI.Token.Response | undefined>;
21
21
  protected save(response: OAuth2CLI.Token.Response): Promise<OAuth2CLI.Token.Response>;
22
+ protected prepareRequest(config: OpenIDClient.Configuration, accessToken: string, url: URL, method: string, body?: OpenIDClient.FetchBody, headers?: Headers | undefined, options?: OpenIDClient.DPoPOptions | undefined): Promise<Parameters<(typeof OpenIDClient)['fetchProtectedResource']>>;
22
23
  request(url: URL.ish, method?: string, body?: Body.ish, headers?: Headers.ish, dPoPOptions?: OpenIDClient.DPoPOptions): Promise<Response>;
23
24
  requestJSON<J extends JSONValue = JSONValue>(url: URL.ish, method?: string, body?: Body.ish, headers?: Headers.ish, dPoPOptions?: OpenIDClient.DPoPOptions): Promise<J>;
24
25
  }
package/dist/Client.js CHANGED
@@ -53,10 +53,18 @@ export class Client extends OAuth2CLI.Client {
53
53
  Log.debug(`Persisting ${this.name} refresh token (if present and storage configured):\n${Log.syntaxColor(response)}`);
54
54
  return await super.save(response);
55
55
  }
56
+ async prepareRequest(config, accessToken, url, method, body, headers, options) {
57
+ Log.debug(`Prepared request to ${this.name}:\n${Log.syntaxColor({ method, url, headers: Object.fromEntries(headers?.entries() || []), body })}`);
58
+ return [config, accessToken, url, method, body, headers, options];
59
+ }
56
60
  async request(url, method = 'GET', body, headers = {}, dPoPOptions) {
57
61
  Log.debug(`Sending request to ${this.name}:\n${Log.syntaxColor({
58
- request: { method, url, headers, body, dPoPOptions }
59
- })}`);
62
+ request: {
63
+ method,
64
+ url,
65
+ dPoPOptions
66
+ }
67
+ })}${body || headers ? ` injecting: ${Log.syntaxColor({ headers, body })}` : ''}`);
60
68
  const response = await super.request(url, method, body, headers, dPoPOptions);
61
69
  Log.debug(`Received response from ${this.name}:\n${Log.syntaxColor({
62
70
  ok: response.ok,
@@ -19,6 +19,7 @@ export declare class Client<C extends OAuth2CLI.Credentials = OAuth2CLI.Credenti
19
19
  handleAuthorizationCodeRedirect(request: Request, session: OAuth2CLI.Localhost.Server): Promise<OAuth2CLI.Token.Response>;
20
20
  protected refreshTokenGrant({ refresh_token, inject }?: Parameters<OAuth2CLI.Client['refreshTokenGrant']>[0]): Promise<OAuth2CLI.Token.Response | undefined>;
21
21
  protected save(response: OAuth2CLI.Token.Response): Promise<OAuth2CLI.Token.Response>;
22
+ protected prepareRequest(config: OpenIDClient.Configuration, accessToken: string, url: URL, method: string, body?: OpenIDClient.FetchBody, headers?: Headers | undefined, options?: OpenIDClient.DPoPOptions | undefined): Promise<Parameters<(typeof OpenIDClient)['fetchProtectedResource']>>;
22
23
  request(url: URL.ish, method?: string, body?: Body.ish, headers?: Headers.ish, dPoPOptions?: OpenIDClient.DPoPOptions): Promise<Response>;
23
24
  requestJSON<J extends JSONValue = JSONValue>(url: URL.ish, method?: string, body?: Body.ish, headers?: Headers.ish, dPoPOptions?: OpenIDClient.DPoPOptions): Promise<J>;
24
25
  }
@@ -53,10 +53,18 @@ export class Client extends OAuth2CLI.Client {
53
53
  Log.debug(`Persisting ${this.name} refresh token (if present and storage configured):\n${Log.syntaxColor(response)}`);
54
54
  return await super.save(response);
55
55
  }
56
+ async prepareRequest(config, accessToken, url, method, body, headers, options) {
57
+ Log.debug(`Prepared request to ${this.name}:\n${Log.syntaxColor({ method, url, headers: Object.fromEntries(headers?.entries() || []), body })}`);
58
+ return [config, accessToken, url, method, body, headers, options];
59
+ }
56
60
  async request(url, method = 'GET', body, headers = {}, dPoPOptions) {
57
61
  Log.debug(`Sending request to ${this.name}:\n${Log.syntaxColor({
58
- request: { method, url, headers, body, dPoPOptions }
59
- })}`);
62
+ request: {
63
+ method,
64
+ url,
65
+ dPoPOptions
66
+ }
67
+ })}${body || headers ? ` injecting: ${Log.syntaxColor({ headers, body })}` : ''}`);
60
68
  const response = await super.request(url, method, body, headers, dPoPOptions);
61
69
  Log.debug(`Received response from ${this.name}:\n${Log.syntaxColor({
62
70
  ok: response.ok,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oauth2-cli/qui-cli",
3
- "version": "1.1.3",
3
+ "version": "1.2.1",
4
4
  "description": "@qui-cli/plugin wrapper for oauth2-cli",
5
5
  "homepage": "https://github.com/battis/oauth2-cli/tree/main/packages/qui-cli#readme",
6
6
  "repository": {
@@ -17,8 +17,8 @@
17
17
  "types": "./dist/index.d.ts",
18
18
  "dependencies": {
19
19
  "@qui-cli/colors": "^3.2.3",
20
- "oauth2-cli": "1.0.3",
21
- "requestish": "0.1.3"
20
+ "oauth2-cli": "1.1.1",
21
+ "requestish": "0.1.6"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@battis/descriptive-types": "^0.2.6",