@apex-actions/cli 0.83.0 → 0.85.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.
@@ -248,8 +248,24 @@ export class HttpControlPlane {
248
248
  return await this.#json('POST', `/api/v1/admin/accounts/backfill${apply ? '?apply=true' : ''}`, input);
249
249
  }
250
250
  // ── complimentary access (control-plane ADR-0056, ADR-0079): the admin API's shapes, unchanged ──
251
+ /**
252
+ * Every grant. The list is paged since context TASK-0241 (control-plane ADR-0081), so this follows `page.nextCursor`
253
+ * to the end; a control plane from before the grammar answers everything and no `page`, which ends the loop at once.
254
+ */
251
255
  async listGrants() {
252
- return (await this.#json('GET', '/api/v1/admin/grants')).grants;
256
+ const all = [];
257
+ let cursor;
258
+ for (let pages = 0; pages < 100; pages++) {
259
+ const query = new URLSearchParams({ limit: '200' });
260
+ if (cursor !== undefined)
261
+ query.set('cursor', cursor);
262
+ const body = await this.#json('GET', `/api/v1/admin/grants?${query.toString()}`);
263
+ all.push(...body.grants);
264
+ cursor = body.page?.nextCursor;
265
+ if (cursor === undefined)
266
+ break;
267
+ }
268
+ return all;
253
269
  }
254
270
  async createGrant(body) {
255
271
  return await this.#json('POST', '/api/v1/admin/grants', body);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apex-actions/cli",
3
- "version": "0.83.0",
3
+ "version": "0.85.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "//files": "Without this npm ships src, test and the CI config alongside the binary a user installs.",
6
6
  "files": [