@oauth2-cli/qui-cli 1.2.15 → 2.0.0

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,17 @@
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
+ ## [2.0.0](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/1.2.15...qui-cli-plugin/2.0.0) (2026-03-22)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * detect and automate traversing paginated collections
11
+
12
+ ### Features
13
+
14
+ * detect and automate traversing paginated collections ([28d6c6a](https://github.com/battis/oauth2-cli/commit/28d6c6ad90deb01059804d11ee692ec413a03345))
15
+
5
16
  ## [1.2.13](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/1.2.12...qui-cli-plugin/1.2.13) (2026-03-10)
6
17
 
7
18
  ### Bug Fixes
package/dist/Client.d.ts CHANGED
@@ -16,5 +16,5 @@ export declare class Client<C extends OAuth2CLI.Credentials = OAuth2CLI.Credenti
16
16
  getConfiguration(): Promise<OpenIDClient.Configuration>;
17
17
  protected prepareRequest(config: OpenIDClient.Configuration, accessToken: string, url: URL, method: string, body?: OpenIDClient.FetchBody, headers?: Headers | undefined, options?: OpenIDClient.DPoPOptions | undefined): Promise<OAuth2CLI.PreparedRequest>;
18
18
  protected prepareResponse(response: Response): Promise<Response>;
19
- requestJSON<J extends JSONValue = JSONValue>(url: URL.ish, method?: string, body?: Body.ish, headers?: Headers.ish, dPoPOptions?: OpenIDClient.DPoPOptions): Promise<J>;
19
+ request<T extends JSONValue = JSONValue>(url: URL.ish, method?: string, body?: Body.ish, headers?: Headers.ish, dPoPOptions?: OpenIDClient.DPoPOptions): Promise<T | OAuth2CLI.PaginatedCollection<T>>;
20
20
  }
package/dist/Client.js CHANGED
@@ -39,13 +39,18 @@ export class Client extends OAuth2CLI.Client {
39
39
  })}`);
40
40
  return response;
41
41
  }
42
- async requestJSON(url, method = 'GET', body, headers = {}, dPoPOptions) {
43
- const json = await super.requestJSON(url, method, body, headers, dPoPOptions);
44
- Log.debug(`JSON body from ${this.name}: ${typeof json === 'object' && json
45
- ? Log.syntaxColor(json)
46
- : typeof json === 'string'
47
- ? Colors.quotedValue(`"${json}"`)
48
- : Colors.value(json)}`);
49
- return json;
42
+ async request(url, method = 'GET', body, headers = {}, dPoPOptions) {
43
+ const data = await super.request(url, method, body, headers, dPoPOptions);
44
+ if (data instanceof OAuth2CLI.PaginatedCollection) {
45
+ Log.debug(`First page of data from ${this.name}: ${Log.syntaxColor(data)}`);
46
+ }
47
+ else {
48
+ Log.debug(`JSON data from ${this.name}: ${typeof data === 'object' && data
49
+ ? Log.syntaxColor(data)
50
+ : typeof data === 'string'
51
+ ? Colors.quotedValue(`"${data}"`)
52
+ : Colors.value(data)}`);
53
+ }
54
+ return data;
50
55
  }
51
56
  }
package/dist/OAuth2.d.ts CHANGED
@@ -27,22 +27,22 @@ export declare const client: () => import("./Client.js").Client<import("oauth2-c
27
27
  *
28
28
  * @see {@link OAuth2Plugin.request}
29
29
  */
30
- export declare const request: (url: import("requestish/dist/URL.js").ish, method?: string | undefined, body?: import("requestish/dist/Body.js").ish, headers?: import("requestish/dist/Headers.js").ish, dPoPOptions?: import("openid-client").DPoPOptions | undefined) => Promise<Response>;
30
+ export declare const requestRaw: (url: import("requestish/dist/URL.js").ish, method?: string | undefined, body?: import("requestish/dist/Body.js").ish, headers?: import("requestish/dist/Headers.js").ish, dPoPOptions?: import("openid-client").DPoPOptions | undefined) => Promise<Response>;
31
31
  /**
32
32
  * Convenience method
33
33
  *
34
34
  * @see {@link OAuth2Plugin.requestJSON}
35
35
  */
36
- export declare const requestJSON: <T extends import("@battis/typescript-tricks").JSONValue>(url: import("requestish/dist/URL.js").ish, method?: string | undefined, body?: import("requestish/dist/Body.js").ish, headers?: import("requestish/dist/Headers.js").ish, dPoPOptions?: import("openid-client").DPoPOptions | undefined) => Promise<T>;
36
+ export declare const request: <T extends import("@battis/typescript-tricks").JSONValue>(url: import("requestish/dist/URL.js").ish, method?: string | undefined, body?: import("requestish/dist/Body.js").ish, headers?: import("requestish/dist/Headers.js").ish, dPoPOptions?: import("openid-client").DPoPOptions | undefined) => Promise<T | import("oauth2-cli").PaginatedCollection<T>>;
37
37
  /**
38
38
  * Convenience method
39
39
  *
40
40
  * @see {@link OAuth2Plugin.fetch}
41
41
  */
42
- export declare const fetch: (input: import("requestish/dist/URL.js").ish, init?: RequestInit | undefined, dPoPOptions?: import("openid-client").DPoPOptions | undefined) => Promise<Response>;
42
+ export declare const fetchRaw: (input: import("requestish/dist/URL.js").ish, init?: RequestInit | undefined, dPoPOptions?: import("openid-client").DPoPOptions | undefined) => Promise<Response>;
43
43
  /**
44
44
  * Conveneince method
45
45
  *
46
46
  * @see {@link OAuth2Plugin.fetchJSON}
47
47
  */
48
- export declare const fetchJSON: <T extends import("@battis/typescript-tricks").JSONValue>(input: import("requestish/dist/URL.js").ish, init?: RequestInit | undefined, dPoPOptions?: import("openid-client").DPoPOptions | undefined) => Promise<T>;
48
+ export declare const fetch: <T extends import("@battis/typescript-tricks").JSONValue>(input: import("requestish/dist/URL.js").ish, init?: RequestInit | undefined, dPoPOptions?: import("openid-client").DPoPOptions | undefined) => Promise<T | import("oauth2-cli").PaginatedCollection<T>>;
package/dist/OAuth2.js CHANGED
@@ -33,23 +33,23 @@ export const client = () => plugin.client;
33
33
  *
34
34
  * @see {@link OAuth2Plugin.request}
35
35
  */
36
- export const request = plugin.request.bind(plugin);
36
+ export const requestRaw = plugin.requestRaw.bind(plugin);
37
37
  /**
38
38
  * Convenience method
39
39
  *
40
40
  * @see {@link OAuth2Plugin.requestJSON}
41
41
  */
42
- export const requestJSON = plugin.requestJSON.bind(plugin);
42
+ export const request = plugin.request.bind(plugin);
43
43
  /**
44
44
  * Convenience method
45
45
  *
46
46
  * @see {@link OAuth2Plugin.fetch}
47
47
  */
48
- export const fetch = plugin.fetch.bind(plugin);
48
+ export const fetchRaw = plugin.fetchRaw.bind(plugin);
49
49
  /**
50
50
  * Conveneince method
51
51
  *
52
52
  * @see {@link OAuth2Plugin.fetchJSON}
53
53
  */
54
- export const fetchJSON = plugin.fetchJSON.bind(plugin);
54
+ export const fetch = plugin.fetch.bind(plugin);
55
55
  await register(plugin);
@@ -131,24 +131,24 @@ export declare class OAuth2Plugin<C extends OAuth2CLI.Credentials = OAuth2CLI.Cr
131
131
  *
132
132
  * @see {@link OAuth2CLI.Client.request}
133
133
  */
134
- request(...args: Parameters<OAuth2CLI.Client<C>['request']>): Promise<Response>;
134
+ requestRaw(...args: Parameters<OAuth2CLI.Client<C>['requestRaw']>): Promise<Response>;
135
135
  /**
136
136
  * Convenience method
137
137
  *
138
138
  * @see {@link OAuth2CLI.Client.requestJSON}
139
139
  */
140
- requestJSON<T extends JSONValue>(...args: Parameters<OAuth2CLI.Client<C>['requestJSON']>): Promise<T>;
140
+ request<T extends JSONValue>(...args: Parameters<OAuth2CLI.Client<C>['request']>): Promise<T | OAuth2CLI.PaginatedCollection<T>>;
141
141
  /**
142
142
  * Convenience method
143
143
  *
144
144
  * @see {@link OAuth2CLI.Client.fetch}
145
145
  */
146
- fetch(...args: Parameters<OAuth2CLI.Client<C>['fetch']>): Promise<Response>;
146
+ fetchRaw(...args: Parameters<OAuth2CLI.Client<C>['fetchRaw']>): Promise<Response>;
147
147
  /**
148
148
  * Convenience method
149
149
  *
150
150
  * @see {@link OAuth2CLI.Client.fetchJSON}
151
151
  */
152
- fetchJSON<T extends JSONValue>(...args: Parameters<OAuth2CLI.Client<C>['fetchJSON']>): Promise<T>;
152
+ fetch<T extends JSONValue>(...args: Parameters<OAuth2CLI.Client<C>['fetch']>): Promise<T | OAuth2CLI.PaginatedCollection<T>>;
153
153
  }
154
154
  export {};
@@ -257,31 +257,31 @@ export class OAuth2Plugin {
257
257
  *
258
258
  * @see {@link OAuth2CLI.Client.request}
259
259
  */
260
- request(...args) {
261
- return this.client.request(...args);
260
+ requestRaw(...args) {
261
+ return this.client.requestRaw(...args);
262
262
  }
263
263
  /**
264
264
  * Convenience method
265
265
  *
266
266
  * @see {@link OAuth2CLI.Client.requestJSON}
267
267
  */
268
- requestJSON(...args) {
269
- return this.client.requestJSON(...args);
268
+ request(...args) {
269
+ return this.client.request(...args);
270
270
  }
271
271
  /**
272
272
  * Convenience method
273
273
  *
274
274
  * @see {@link OAuth2CLI.Client.fetch}
275
275
  */
276
- fetch(...args) {
277
- return this.client.fetch(...args);
276
+ fetchRaw(...args) {
277
+ return this.client.fetchRaw(...args);
278
278
  }
279
279
  /**
280
280
  * Convenience method
281
281
  *
282
282
  * @see {@link OAuth2CLI.Client.fetchJSON}
283
283
  */
284
- fetchJSON(...args) {
285
- return this.client.fetchJSON(...args);
284
+ fetch(...args) {
285
+ return this.client.fetch(...args);
286
286
  }
287
287
  }
@@ -16,5 +16,5 @@ export declare class Client<C extends OAuth2CLI.Credentials = OAuth2CLI.Credenti
16
16
  getConfiguration(): Promise<OpenIDClient.Configuration>;
17
17
  protected prepareRequest(config: OpenIDClient.Configuration, accessToken: string, url: URL, method: string, body?: OpenIDClient.FetchBody, headers?: Headers | undefined, options?: OpenIDClient.DPoPOptions | undefined): Promise<OAuth2CLI.PreparedRequest>;
18
18
  protected prepareResponse(response: Response): Promise<Response>;
19
- requestJSON<J extends JSONValue = JSONValue>(url: URL.ish, method?: string, body?: Body.ish, headers?: Headers.ish, dPoPOptions?: OpenIDClient.DPoPOptions): Promise<J>;
19
+ request<T extends JSONValue = JSONValue>(url: URL.ish, method?: string, body?: Body.ish, headers?: Headers.ish, dPoPOptions?: OpenIDClient.DPoPOptions): Promise<T | OAuth2CLI.PaginatedCollection<T>>;
20
20
  }
@@ -39,13 +39,18 @@ export class Client extends OAuth2CLI.Client {
39
39
  })}`);
40
40
  return response;
41
41
  }
42
- async requestJSON(url, method = 'GET', body, headers = {}, dPoPOptions) {
43
- const json = await super.requestJSON(url, method, body, headers, dPoPOptions);
44
- Log.debug(`JSON body from ${this.name}: ${typeof json === 'object' && json
45
- ? Log.syntaxColor(json)
46
- : typeof json === 'string'
47
- ? Colors.quotedValue(`"${json}"`)
48
- : Colors.value(json)}`);
49
- return json;
42
+ async request(url, method = 'GET', body, headers = {}, dPoPOptions) {
43
+ const data = await super.request(url, method, body, headers, dPoPOptions);
44
+ if (data instanceof OAuth2CLI.PaginatedCollection) {
45
+ Log.debug(`First page of data from ${this.name}: ${Log.syntaxColor(data)}`);
46
+ }
47
+ else {
48
+ Log.debug(`JSON data from ${this.name}: ${typeof data === 'object' && data
49
+ ? Log.syntaxColor(data)
50
+ : typeof data === 'string'
51
+ ? Colors.quotedValue(`"${data}"`)
52
+ : Colors.value(data)}`);
53
+ }
54
+ return data;
50
55
  }
51
56
  }
@@ -131,24 +131,24 @@ export declare class OAuth2Plugin<C extends OAuth2CLI.Credentials = OAuth2CLI.Cr
131
131
  *
132
132
  * @see {@link OAuth2CLI.Client.request}
133
133
  */
134
- request(...args: Parameters<OAuth2CLI.Client<C>['request']>): Promise<Response>;
134
+ requestRaw(...args: Parameters<OAuth2CLI.Client<C>['requestRaw']>): Promise<Response>;
135
135
  /**
136
136
  * Convenience method
137
137
  *
138
138
  * @see {@link OAuth2CLI.Client.requestJSON}
139
139
  */
140
- requestJSON<T extends JSONValue>(...args: Parameters<OAuth2CLI.Client<C>['requestJSON']>): Promise<T>;
140
+ request<T extends JSONValue>(...args: Parameters<OAuth2CLI.Client<C>['request']>): Promise<T | OAuth2CLI.PaginatedCollection<T>>;
141
141
  /**
142
142
  * Convenience method
143
143
  *
144
144
  * @see {@link OAuth2CLI.Client.fetch}
145
145
  */
146
- fetch(...args: Parameters<OAuth2CLI.Client<C>['fetch']>): Promise<Response>;
146
+ fetchRaw(...args: Parameters<OAuth2CLI.Client<C>['fetchRaw']>): Promise<Response>;
147
147
  /**
148
148
  * Convenience method
149
149
  *
150
150
  * @see {@link OAuth2CLI.Client.fetchJSON}
151
151
  */
152
- fetchJSON<T extends JSONValue>(...args: Parameters<OAuth2CLI.Client<C>['fetchJSON']>): Promise<T>;
152
+ fetch<T extends JSONValue>(...args: Parameters<OAuth2CLI.Client<C>['fetch']>): Promise<T | OAuth2CLI.PaginatedCollection<T>>;
153
153
  }
154
154
  export {};
@@ -257,31 +257,31 @@ export class OAuth2Plugin {
257
257
  *
258
258
  * @see {@link OAuth2CLI.Client.request}
259
259
  */
260
- request(...args) {
261
- return this.client.request(...args);
260
+ requestRaw(...args) {
261
+ return this.client.requestRaw(...args);
262
262
  }
263
263
  /**
264
264
  * Convenience method
265
265
  *
266
266
  * @see {@link OAuth2CLI.Client.requestJSON}
267
267
  */
268
- requestJSON(...args) {
269
- return this.client.requestJSON(...args);
268
+ request(...args) {
269
+ return this.client.request(...args);
270
270
  }
271
271
  /**
272
272
  * Convenience method
273
273
  *
274
274
  * @see {@link OAuth2CLI.Client.fetch}
275
275
  */
276
- fetch(...args) {
277
- return this.client.fetch(...args);
276
+ fetchRaw(...args) {
277
+ return this.client.fetchRaw(...args);
278
278
  }
279
279
  /**
280
280
  * Convenience method
281
281
  *
282
282
  * @see {@link OAuth2CLI.Client.fetchJSON}
283
283
  */
284
- fetchJSON(...args) {
285
- return this.client.fetchJSON(...args);
284
+ fetch(...args) {
285
+ return this.client.fetch(...args);
286
286
  }
287
287
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oauth2-cli/qui-cli",
3
- "version": "1.2.15",
3
+ "version": "2.0.0",
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": {
@@ -19,7 +19,7 @@
19
19
  "@battis/descriptive-types": "^0.2.6",
20
20
  "@battis/typescript-tricks": "^0.8.1",
21
21
  "requestish": "0.1.12",
22
- "oauth2-cli": "1.2.8"
22
+ "oauth2-cli": "2.0.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@tsconfig/node24": "^24.0.4",