@oauth2-cli/qui-cli 0.5.5 → 0.5.7
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 +14 -0
- package/dist/Module.d.ts +1 -1
- package/dist/OAuth2.d.ts +5 -4
- package/dist/OAuth2.js +6 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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.7](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.6...qui-cli-plugin/0.5.7) (2026-01-17)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* include scope param ([abf53c1](https://github.com/battis/oauth2-cli/commit/abf53c156a226e51c771a405058640a380407813))
|
|
11
|
+
|
|
12
|
+
## [0.5.6](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.5...qui-cli-plugin/0.5.6) (2026-01-15)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* correctly implement template Client type ([ed6ac1c](https://github.com/battis/oauth2-cli/commit/ed6ac1cc63b1c41eceb93311105a1f61890a07c8))
|
|
18
|
+
|
|
5
19
|
## [0.5.5](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.4...qui-cli-plugin/0.5.5) (2026-01-15)
|
|
6
20
|
|
|
7
21
|
|
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: () =>
|
|
7
|
+
export declare const getClient: () => import("oauth2-cli/dist/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
|
@@ -4,7 +4,7 @@ import * as Plugin from '@qui-cli/plugin';
|
|
|
4
4
|
import * as OAuth2CLI from 'oauth2-cli';
|
|
5
5
|
export * from 'oauth2-cli';
|
|
6
6
|
export * from './EnvironmentStorage.js';
|
|
7
|
-
type ParamNames = 'clientId' | 'clientSecret' | 'redirectUri' | 'authorizationEndpoint' | 'tokenEndpoint' | 'tokenPath' | 'accessToken';
|
|
7
|
+
type ParamNames = 'clientId' | 'clientSecret' | 'scope' | 'redirectUri' | 'authorizationEndpoint' | 'tokenEndpoint' | 'tokenPath' | 'accessToken';
|
|
8
8
|
type EnvironmentVars = Record<ParamNames, string>;
|
|
9
9
|
type SupportUrls = Record<ParamNames, URLString>;
|
|
10
10
|
type Hints = Record<ParamNames, string>;
|
|
@@ -17,6 +17,7 @@ type Usage = {
|
|
|
17
17
|
export type Configuration = Plugin.Configuration & {
|
|
18
18
|
clientId?: string;
|
|
19
19
|
clientSecret?: string;
|
|
20
|
+
scope?: string;
|
|
20
21
|
redirectUri?: URLString;
|
|
21
22
|
headers?: Record<string, string>;
|
|
22
23
|
authorizationEndpoint?: URLString;
|
|
@@ -35,7 +36,7 @@ export type ConfigurationProposal = Partial<Omit<Configuration, 'opt' | 'env' |
|
|
|
35
36
|
env?: Partial<EnvironmentVars>;
|
|
36
37
|
man?: Partial<Usage>;
|
|
37
38
|
};
|
|
38
|
-
export declare class OAuth2Plugin {
|
|
39
|
+
export declare class OAuth2Plugin<C extends OAuth2CLI.Client = OAuth2CLI.Client> {
|
|
39
40
|
readonly name: string;
|
|
40
41
|
[key: string]: unknown;
|
|
41
42
|
private static names;
|
|
@@ -46,8 +47,8 @@ export declare class OAuth2Plugin {
|
|
|
46
47
|
configure(proposal?: ConfigurationProposal): void;
|
|
47
48
|
options(): Plugin.Options;
|
|
48
49
|
init({ values }: Plugin.ExpectedArguments<typeof this.options>): Promise<void>;
|
|
49
|
-
protected instantiateClient(...args: ConstructorParameters<typeof OAuth2CLI.Client>):
|
|
50
|
-
getClient():
|
|
50
|
+
protected instantiateClient(...args: ConstructorParameters<typeof OAuth2CLI.Client>): C;
|
|
51
|
+
getClient(): C;
|
|
51
52
|
getToken(): Promise<OAuth2CLI.Token | undefined>;
|
|
52
53
|
request(...args: Parameters<OAuth2CLI.Client['request']>): Promise<Response>;
|
|
53
54
|
requestJSON<T extends JSONValue>(...args: Parameters<OAuth2CLI.Client['requestJSON']>): Promise<T>;
|
package/dist/OAuth2.js
CHANGED
|
@@ -21,6 +21,7 @@ export class OAuth2Plugin {
|
|
|
21
21
|
opt: {
|
|
22
22
|
clientId: 'clientId',
|
|
23
23
|
clientSecret: 'clientSecret',
|
|
24
|
+
scope: 'scope',
|
|
24
25
|
redirectUri: 'redirectUri',
|
|
25
26
|
authorizationEndpoint: 'authorizationEndpoint',
|
|
26
27
|
tokenEndpoint: 'tokenEndpoint',
|
|
@@ -33,6 +34,7 @@ export class OAuth2Plugin {
|
|
|
33
34
|
env: {
|
|
34
35
|
clientId: 'CLIENT_ID',
|
|
35
36
|
clientSecret: 'CLIENT_SECRET',
|
|
37
|
+
scope: 'SCOPE',
|
|
36
38
|
redirectUri: 'REDIRECT_URI',
|
|
37
39
|
authorizationEndpoint: 'AUTHORIZATION_ENDPOINT',
|
|
38
40
|
tokenEndpoint: 'TOKEN_ENDPOINT',
|
|
@@ -86,6 +88,8 @@ export class OAuth2Plugin {
|
|
|
86
88
|
`${Colors.value(this.cliConfig.env.clientId)}, if present.`,
|
|
87
89
|
clientSecret: `OAuth 2.0 client secret. Defaults to environment variable ` +
|
|
88
90
|
`${Colors.value(this.cliConfig.env.clientSecret)}, if present.`,
|
|
91
|
+
scope: `OAuth 2.0 scope. Defaults to environment variable ` +
|
|
92
|
+
`${Colors.varName(this.cliConfig.env.scope)}, if present.`,
|
|
89
93
|
redirectUri: `OAuth 2.0 redirect URI, must be to host ${Colors.url('localhost')}. ` +
|
|
90
94
|
`Defaults to environment variable ` +
|
|
91
95
|
`${Colors.value(this.cliConfig.env.redirectUri)}, if present.`,
|
|
@@ -147,7 +151,7 @@ export class OAuth2Plugin {
|
|
|
147
151
|
}
|
|
148
152
|
getClient() {
|
|
149
153
|
if (!this.client) {
|
|
150
|
-
const { clientId: client_id, clientSecret: client_secret, redirectUri: redirect_uri, authorizationEndpoint: authorization_endpoint, tokenEndpoint: token_endpoint, headers, store } = this.cliConfig;
|
|
154
|
+
const { clientId: client_id, clientSecret: client_secret, scope, redirectUri: redirect_uri, authorizationEndpoint: authorization_endpoint, tokenEndpoint: token_endpoint, headers, store } = this.cliConfig;
|
|
151
155
|
if (!client_id) {
|
|
152
156
|
throw new Error('OAuth 2.0 client ID not defined');
|
|
153
157
|
}
|
|
@@ -163,6 +167,7 @@ export class OAuth2Plugin {
|
|
|
163
167
|
this.client = this.instantiateClient({
|
|
164
168
|
client_id,
|
|
165
169
|
client_secret,
|
|
170
|
+
scope,
|
|
166
171
|
redirect_uri,
|
|
167
172
|
authorization_endpoint,
|
|
168
173
|
token_endpoint,
|
package/package.json
CHANGED