oauth2-cli 1.0.1 → 1.0.3
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/README.md +2 -2
- package/dist/Client.d.ts +3 -3
- package/dist/Client.js +1 -2
- 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
|
+
## [1.0.3](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.0.2...oauth2-cli/1.0.3) (2026-03-04)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* allow requestish.Body.ish request bodies as intended ([f12a2ce](https://github.com/battis/oauth2-cli/commit/f12a2ceb1c517f6fd90b33c8c71da7f987af640d))
|
|
11
|
+
|
|
12
|
+
## [1.0.2](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.0.1...oauth2-cli/1.0.2) (2026-03-03)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* remove extraneous debugging output ([30e7fba](https://github.com/battis/oauth2-cli/commit/30e7fba402cba03b876b31f6cee9c612504fd98c))
|
|
18
|
+
|
|
5
19
|
## [1.0.1](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.0.0...oauth2-cli/1.0.1) (2026-03-03)
|
|
6
20
|
|
|
7
21
|
|
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ class Client {
|
|
|
80
80
|
public async request(
|
|
81
81
|
url: requestish.URL.ish,
|
|
82
82
|
method = 'GET',
|
|
83
|
-
body?:
|
|
83
|
+
body?: requestish.Body.ish,
|
|
84
84
|
headers: requestish.Headers.ish = {},
|
|
85
85
|
dPoPOptions?: OpenIDClient.DPoPOptions
|
|
86
86
|
) {
|
|
@@ -108,7 +108,7 @@ class Client {
|
|
|
108
108
|
>(
|
|
109
109
|
url: requestish.URL.ish,
|
|
110
110
|
method = 'GET',
|
|
111
|
-
body?:
|
|
111
|
+
body?: requestish.Body.ish,
|
|
112
112
|
headers: requestish.Headers.ish = {},
|
|
113
113
|
dPoPOptions?: OpenIDClient.DPoPOptions
|
|
114
114
|
) {
|
package/dist/Client.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { JSONValue } from '@battis/typescript-tricks';
|
|
|
2
2
|
import { Request } from 'express';
|
|
3
3
|
import { EventEmitter } from 'node:events';
|
|
4
4
|
import * as OpenIDClient from 'openid-client';
|
|
5
|
-
import { Headers, URL } from 'requestish';
|
|
5
|
+
import { Body, Headers, URL } from 'requestish';
|
|
6
6
|
import { Credentials } from './Credentials.js';
|
|
7
7
|
import { Injection } from './Injection.js';
|
|
8
8
|
import * as Localhost from './Localhost/index.js';
|
|
@@ -117,14 +117,14 @@ export declare class Client<C extends Credentials = Credentials> extends EventEm
|
|
|
117
117
|
* @param headers Optional
|
|
118
118
|
* @param dPoPOptions Optional, see {@link OpenIDClient.DPoPOptions}
|
|
119
119
|
*/
|
|
120
|
-
request(url: URL.ish, method?: string, body?:
|
|
120
|
+
request(url: URL.ish, method?: string, body?: Body.ish, headers?: Headers.ish, dPoPOptions?: OpenIDClient.DPoPOptions): Promise<Response>;
|
|
121
121
|
/** Parse a fetch response as JSON, typing it as J */
|
|
122
122
|
private toJSON;
|
|
123
123
|
/**
|
|
124
124
|
* Returns the result of {@link request} as a parsed JSON object, optionally
|
|
125
125
|
* typed as `J`
|
|
126
126
|
*/
|
|
127
|
-
requestJSON<J extends JSONValue = JSONValue>(url: URL.ish, method?: string, body?:
|
|
127
|
+
requestJSON<J extends JSONValue = JSONValue>(url: URL.ish, method?: string, body?: Body.ish, headers?: Headers.ish, dPoPOptions?: OpenIDClient.DPoPOptions): Promise<J>;
|
|
128
128
|
/**
|
|
129
129
|
* Request a protected resource using the client's access token.
|
|
130
130
|
*
|
package/dist/Client.js
CHANGED
|
@@ -125,7 +125,6 @@ export class Client extends EventEmitter {
|
|
|
125
125
|
/** Start interactive authorization for API access with the user */
|
|
126
126
|
async authorize() {
|
|
127
127
|
return await this.tokenLock.runExclusive(async () => {
|
|
128
|
-
console.log('running authorize from external call');
|
|
129
128
|
return await this._authorize();
|
|
130
129
|
});
|
|
131
130
|
}
|
|
@@ -275,7 +274,7 @@ export class Client extends EventEmitter {
|
|
|
275
274
|
});
|
|
276
275
|
}
|
|
277
276
|
}
|
|
278
|
-
const request = async () => await OpenIDClient.fetchProtectedResource(await this.getConfiguration(), (await this.getToken()).access_token, URL.from(URLSearchParams.appendTo(url, this.inject?.search || {})), method, body, Headers.merge(this.inject?.headers, headers), dPoPOptions);
|
|
277
|
+
const request = async () => await OpenIDClient.fetchProtectedResource(await this.getConfiguration(), (await this.getToken()).access_token, URL.from(URLSearchParams.appendTo(url, this.inject?.search || {})), method, await Body.from(body), Headers.merge(this.inject?.headers, headers), dPoPOptions);
|
|
279
278
|
try {
|
|
280
279
|
return await request();
|
|
281
280
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oauth2-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
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": {
|