@oauth2-cli/qui-cli 1.1.0 → 1.1.2
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 +15 -0
- package/dist/Client.d.ts +1 -1
- package/dist/Client.js +24 -9
- package/extendable/Client.d.ts +1 -1
- package/extendable/Client.js +24 -9
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
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.2](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/1.1.1...qui-cli-plugin/1.1.2) (2026-03-04)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* improve JSOn debugging output ([a197307](https://github.com/battis/oauth2-cli/commit/a19730721ac53666a2c4e4e4982abf85353386e3))
|
|
11
|
+
* improved response debugging output ([2c63583](https://github.com/battis/oauth2-cli/commit/2c635834e2e2a21c519b3d3bcec8ac26b1d70bbf))
|
|
12
|
+
|
|
13
|
+
## [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)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* extend Client without breaking Client ([1115a71](https://github.com/battis/oauth2-cli/commit/1115a714228294b7fd2057706504645a48f94cb8))
|
|
19
|
+
|
|
5
20
|
## [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)
|
|
6
21
|
|
|
7
22
|
|
package/dist/Client.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare class Client<C extends OAuth2CLI.Credentials = OAuth2CLI.Credenti
|
|
|
17
17
|
getConfiguration(): Promise<OpenIDClient.Configuration>;
|
|
18
18
|
authorize(): Promise<OAuth2CLI.Token.Response>;
|
|
19
19
|
handleAuthorizationCodeRedirect(request: Request, session: OAuth2CLI.Localhost.Server): Promise<OAuth2CLI.Token.Response>;
|
|
20
|
-
protected refreshTokenGrant(
|
|
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
22
|
request(url: requestish.URL.ish, method?: string, body?: OpenIDClient.FetchBody, headers?: requestish.Headers.ish, dPoPOptions?: OpenIDClient.DPoPOptions): Promise<Response>;
|
|
23
23
|
requestJSON<J extends JSONValue = JSONValue>(url: requestish.URL.ish, method?: string, body?: OpenIDClient.FetchBody, headers?: requestish.Headers.ish, dPoPOptions?: OpenIDClient.DPoPOptions): Promise<J>;
|
package/dist/Client.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Colors } from '@qui-cli/colors';
|
|
1
2
|
import { Log } from '@qui-cli/log';
|
|
2
3
|
import * as OAuth2CLI from 'oauth2-cli';
|
|
3
4
|
/**
|
|
@@ -37,27 +38,41 @@ export class Client extends OAuth2CLI.Client {
|
|
|
37
38
|
Log.debug(`Received ${this.name} authorization code response:\n${Log.syntaxColor(response)}`);
|
|
38
39
|
return response;
|
|
39
40
|
}
|
|
40
|
-
async refreshTokenGrant(
|
|
41
|
-
Log.debug(`
|
|
42
|
-
const refreshed = await super.refreshTokenGrant(
|
|
43
|
-
|
|
41
|
+
async refreshTokenGrant({ refresh_token, inject } = {}) {
|
|
42
|
+
Log.debug(`Attempting to refresh ${this.name} access token:\n${Log.syntaxColor({ refresh_token, inject })}`);
|
|
43
|
+
const refreshed = await super.refreshTokenGrant({ refresh_token, inject });
|
|
44
|
+
if (refreshed) {
|
|
45
|
+
Log.debug(`Received refreshed ${this.name} access token:\n${Log.syntaxColor(refreshed)}`);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
Log.debug(`${this.name} token refresh failed`);
|
|
49
|
+
}
|
|
44
50
|
return refreshed;
|
|
45
51
|
}
|
|
46
52
|
async save(response) {
|
|
47
|
-
Log.debug(`Persisting ${this.name} refresh token
|
|
53
|
+
Log.debug(`Persisting ${this.name} refresh token (if present and storage configured):\n${Log.syntaxColor(response)}`);
|
|
48
54
|
return await super.save(response);
|
|
49
55
|
}
|
|
50
56
|
async request(url, method, body, headers, dPoPOptions) {
|
|
51
|
-
Log.debug(`Sending request to ${this.name}
|
|
57
|
+
Log.debug(`Sending request to ${this.name}:\n${Log.syntaxColor({
|
|
52
58
|
request: { method, url, headers, body, dPoPOptions }
|
|
53
|
-
});
|
|
59
|
+
})}`);
|
|
54
60
|
const response = await super.request(url, method, body, headers, dPoPOptions);
|
|
55
|
-
Log.debug(`Received response from ${this.name}:\n${Log.syntaxColor(
|
|
61
|
+
Log.debug(`Received response from ${this.name}:\n${Log.syntaxColor({
|
|
62
|
+
ok: response.ok,
|
|
63
|
+
status: response.status,
|
|
64
|
+
headers: Object.fromEntries(response.headers.entries()),
|
|
65
|
+
body: response.body ? '<not yet parsed>' : null
|
|
66
|
+
})}`);
|
|
56
67
|
return response;
|
|
57
68
|
}
|
|
58
69
|
async requestJSON(url, method, body, headers, dPoPOptions) {
|
|
59
70
|
const json = await super.requestJSON(url, method, body, headers, dPoPOptions);
|
|
60
|
-
Log.debug(`Parsed JSON from ${this.name} response:\n${
|
|
71
|
+
Log.debug(`Parsed JSON from ${this.name} response:\n${typeof json === 'object' && json
|
|
72
|
+
? Log.syntaxColor(json)
|
|
73
|
+
: typeof json === 'string'
|
|
74
|
+
? Colors.quotedValue(`"${json}"`)
|
|
75
|
+
: Colors.value(json)}`);
|
|
61
76
|
return json;
|
|
62
77
|
}
|
|
63
78
|
}
|
package/extendable/Client.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare class Client<C extends OAuth2CLI.Credentials = OAuth2CLI.Credenti
|
|
|
17
17
|
getConfiguration(): Promise<OpenIDClient.Configuration>;
|
|
18
18
|
authorize(): Promise<OAuth2CLI.Token.Response>;
|
|
19
19
|
handleAuthorizationCodeRedirect(request: Request, session: OAuth2CLI.Localhost.Server): Promise<OAuth2CLI.Token.Response>;
|
|
20
|
-
protected refreshTokenGrant(
|
|
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
22
|
request(url: requestish.URL.ish, method?: string, body?: OpenIDClient.FetchBody, headers?: requestish.Headers.ish, dPoPOptions?: OpenIDClient.DPoPOptions): Promise<Response>;
|
|
23
23
|
requestJSON<J extends JSONValue = JSONValue>(url: requestish.URL.ish, method?: string, body?: OpenIDClient.FetchBody, headers?: requestish.Headers.ish, dPoPOptions?: OpenIDClient.DPoPOptions): Promise<J>;
|
package/extendable/Client.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Colors } from '@qui-cli/colors';
|
|
1
2
|
import { Log } from '@qui-cli/log';
|
|
2
3
|
import * as OAuth2CLI from 'oauth2-cli';
|
|
3
4
|
/**
|
|
@@ -37,27 +38,41 @@ export class Client extends OAuth2CLI.Client {
|
|
|
37
38
|
Log.debug(`Received ${this.name} authorization code response:\n${Log.syntaxColor(response)}`);
|
|
38
39
|
return response;
|
|
39
40
|
}
|
|
40
|
-
async refreshTokenGrant(
|
|
41
|
-
Log.debug(`
|
|
42
|
-
const refreshed = await super.refreshTokenGrant(
|
|
43
|
-
|
|
41
|
+
async refreshTokenGrant({ refresh_token, inject } = {}) {
|
|
42
|
+
Log.debug(`Attempting to refresh ${this.name} access token:\n${Log.syntaxColor({ refresh_token, inject })}`);
|
|
43
|
+
const refreshed = await super.refreshTokenGrant({ refresh_token, inject });
|
|
44
|
+
if (refreshed) {
|
|
45
|
+
Log.debug(`Received refreshed ${this.name} access token:\n${Log.syntaxColor(refreshed)}`);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
Log.debug(`${this.name} token refresh failed`);
|
|
49
|
+
}
|
|
44
50
|
return refreshed;
|
|
45
51
|
}
|
|
46
52
|
async save(response) {
|
|
47
|
-
Log.debug(`Persisting ${this.name} refresh token
|
|
53
|
+
Log.debug(`Persisting ${this.name} refresh token (if present and storage configured):\n${Log.syntaxColor(response)}`);
|
|
48
54
|
return await super.save(response);
|
|
49
55
|
}
|
|
50
56
|
async request(url, method, body, headers, dPoPOptions) {
|
|
51
|
-
Log.debug(`Sending request to ${this.name}
|
|
57
|
+
Log.debug(`Sending request to ${this.name}:\n${Log.syntaxColor({
|
|
52
58
|
request: { method, url, headers, body, dPoPOptions }
|
|
53
|
-
});
|
|
59
|
+
})}`);
|
|
54
60
|
const response = await super.request(url, method, body, headers, dPoPOptions);
|
|
55
|
-
Log.debug(`Received response from ${this.name}:\n${Log.syntaxColor(
|
|
61
|
+
Log.debug(`Received response from ${this.name}:\n${Log.syntaxColor({
|
|
62
|
+
ok: response.ok,
|
|
63
|
+
status: response.status,
|
|
64
|
+
headers: Object.fromEntries(response.headers.entries()),
|
|
65
|
+
body: response.body ? '<not yet parsed>' : null
|
|
66
|
+
})}`);
|
|
56
67
|
return response;
|
|
57
68
|
}
|
|
58
69
|
async requestJSON(url, method, body, headers, dPoPOptions) {
|
|
59
70
|
const json = await super.requestJSON(url, method, body, headers, dPoPOptions);
|
|
60
|
-
Log.debug(`Parsed JSON from ${this.name} response:\n${
|
|
71
|
+
Log.debug(`Parsed JSON from ${this.name} response:\n${typeof json === 'object' && json
|
|
72
|
+
? Log.syntaxColor(json)
|
|
73
|
+
: typeof json === 'string'
|
|
74
|
+
? Colors.quotedValue(`"${json}"`)
|
|
75
|
+
: Colors.value(json)}`);
|
|
61
76
|
return json;
|
|
62
77
|
}
|
|
63
78
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oauth2-cli/qui-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
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
|
-
"
|
|
21
|
-
"
|
|
20
|
+
"oauth2-cli": "1.0.2",
|
|
21
|
+
"requestish": "0.1.3"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@battis/descriptive-types": "^0.2.6",
|