@oauth2-cli/qui-cli 0.5.8 → 0.5.9

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,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
+ ## [0.5.9](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.8...qui-cli-plugin/0.5.9) (2026-01-17)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * debug request/response/JSON from Client rather than plugin ([2ed73e1](https://github.com/battis/oauth2-cli/commit/2ed73e18089ffed4fe75d717d523fc86e2ae7f91))
11
+
5
12
  ## [0.5.8](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.7...qui-cli-plugin/0.5.8) (2026-01-17)
6
13
 
7
14
 
@@ -0,0 +1,7 @@
1
+ import { JSONValue } from '@battis/typescript-tricks';
2
+ import * as OAuth2CLI from 'oauth2-cli';
3
+ import { DPoPOptions, FetchBody } from 'openid-client';
4
+ export declare class Client extends OAuth2CLI.Client {
5
+ request(url: URL | string, method?: string, body?: FetchBody, headers?: Headers, dPoPOptions?: DPoPOptions): Promise<Response>;
6
+ requestJSON<T extends JSONValue = JSONValue>(url: URL | string, method?: string, body?: FetchBody, headers?: Headers, dPoPOptions?: DPoPOptions): Promise<T>;
7
+ }
package/dist/Client.js ADDED
@@ -0,0 +1,15 @@
1
+ import { Log } from '@qui-cli/log';
2
+ import * as OAuth2CLI from 'oauth2-cli';
3
+ export class Client extends OAuth2CLI.Client {
4
+ async request(url, method, body, headers, dPoPOptions) {
5
+ Log.debug({ request: { method, url, headers, body, dPoPOptions } });
6
+ const response = await super.request(url, method, body, headers, dPoPOptions);
7
+ Log.debug({ response });
8
+ return response;
9
+ }
10
+ async requestJSON(url, method, body, headers, dPoPOptions) {
11
+ const json = await super.requestJSON(url, method, body, headers, dPoPOptions);
12
+ Log.debug({ json });
13
+ return json;
14
+ }
15
+ }
package/dist/Module.d.ts CHANGED
@@ -4,7 +4,7 @@ export declare const configure: (proposal?: import("./OAuth2.js").ConfigurationP
4
4
  export declare const options: () => import("@qui-cli/plugin").Options;
5
5
  export declare const init: ({ values }: import("@qui-cli/plugin").ExpectedArguments<typeof this.options>) => Promise<void>;
6
6
  export declare const getToken: () => Promise<import("oauth2-cli/dist/Token.js").Token | undefined>;
7
- export declare const getClient: () => import("oauth2-cli/dist/Client.js").Client;
7
+ export declare const getClient: () => import("./Client.js").Client;
8
8
  export declare const request: (url: string | URL, method?: string | undefined, body?: import("openid-client").FetchBody, headers?: Headers | undefined, dPoPOptions?: import("openid-client").DPoPOptions | undefined) => Promise<Response>;
9
9
  export declare const requestJSON: <T extends import("@battis/typescript-tricks").JSONValue>(url: string | URL, method?: string | undefined, body?: import("openid-client").FetchBody, headers?: Headers | undefined, dPoPOptions?: import("openid-client").DPoPOptions | undefined) => Promise<T>;
10
10
  export declare const fetch: (endpoint: string | URL | Request, init?: RequestInit | undefined) => Promise<Response>;
package/dist/OAuth2.d.ts CHANGED
@@ -2,7 +2,9 @@ import { PathString, URLString } from '@battis/descriptive-types';
2
2
  import { JSONValue } from '@battis/typescript-tricks';
3
3
  import * as Plugin from '@qui-cli/plugin';
4
4
  import * as OAuth2CLI from 'oauth2-cli';
5
- export * from 'oauth2-cli';
5
+ import { Client } from './Client.js';
6
+ export { Credentials, FileStorage, Token, TokenStorage } from 'oauth2-cli';
7
+ export * from './Client.js';
6
8
  export * from './EnvironmentStorage.js';
7
9
  type ParamNames = 'clientId' | 'clientSecret' | 'scope' | 'redirectUri' | 'authorizationEndpoint' | 'tokenEndpoint' | 'tokenPath' | 'accessToken';
8
10
  type EnvironmentVars = Record<ParamNames, string>;
@@ -36,7 +38,7 @@ export type ConfigurationProposal = Partial<Omit<Configuration, 'opt' | 'env' |
36
38
  env?: Partial<EnvironmentVars>;
37
39
  man?: Partial<Usage>;
38
40
  };
39
- export declare class OAuth2Plugin<C extends OAuth2CLI.Client = OAuth2CLI.Client> {
41
+ export declare class OAuth2Plugin<C extends Client = Client> {
40
42
  readonly name: string;
41
43
  [key: string]: unknown;
42
44
  private static names;
package/dist/OAuth2.js CHANGED
@@ -5,7 +5,8 @@ import { Root } from '@qui-cli/root';
5
5
  import path from 'node:path';
6
6
  import * as OAuth2CLI from 'oauth2-cli';
7
7
  import { EnvironmentStorage } from './EnvironmentStorage.js';
8
- export * from 'oauth2-cli';
8
+ export { FileStorage, Token } from 'oauth2-cli';
9
+ export * from './Client.js';
9
10
  export * from './EnvironmentStorage.js';
10
11
  export class OAuth2Plugin {
11
12
  name;
@@ -181,14 +182,10 @@ export class OAuth2Plugin {
181
182
  return this.getClient().getToken();
182
183
  }
183
184
  request(...args) {
184
- const [url, method, body, headers, dPoPOptions] = args;
185
- Log.debug({ request: { method, url, headers, body, dPoPOptions } });
186
185
  return this.getClient().request(...args);
187
186
  }
188
187
  requestJSON(...args) {
189
- const response = this.getClient().requestJSON(...args);
190
- Log.debug({ response });
191
- return response;
188
+ return this.getClient().requestJSON(...args);
192
189
  }
193
190
  fetch(...args) {
194
191
  return this.getClient().fetch(...args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oauth2-cli/qui-cli",
3
- "version": "0.5.8",
3
+ "version": "0.5.9",
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": {