@firestartr/cli 1.50.1-snapshot-33 → 1.50.1-snapshot-36

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/build/index.js CHANGED
@@ -298283,12 +298283,14 @@ async function getOctokitForOrg(org, paginated = false, genGithubAppToken = gene
298283
298283
  });
298284
298284
  const options = { auth: auth };
298285
298285
  if (paginated) {
298286
- options.plugins = [dist_bundle_paginateRest, paginateGraphQL];
298286
+ options.plugins = [dist_bundle_paginateRest];
298287
298287
  }
298288
- return new dist_src_Octokit(options);
298288
+ const OctokitWithGraphQL = dist_src_Octokit.plugin(paginateGraphQL);
298289
+ return new OctokitWithGraphQL(options);
298289
298290
  }
298290
298291
  async function getOctokitFromPat(envVar) {
298291
- return new dist_src_Octokit({
298292
+ const OctokitWithGraphQL = dist_src_Octokit.plugin(paginateGraphQL);
298293
+ return new OctokitWithGraphQL({
298292
298294
  auth: process.env[envVar],
298293
298295
  });
298294
298296
  }
@@ -298353,12 +298355,13 @@ async function getOrgInfo(org) {
298353
298355
  async function getOrgTeamsDirectAccess(org) {
298354
298356
  github_src_logger.info(`Getting teams for org ${org}`);
298355
298357
  const octokit = await getOctokitForOrg(org);
298356
- const response = await octokit.graphql(`{
298357
- organization(login: "${org}") {
298358
- teams(first: 30) {
298359
- nodes {
298360
- id
298361
- name
298358
+ const response = await octokit.graphql.paginate(`
298359
+ query paginate($cursor: String, $org: String!) {
298360
+ organization(login: \$org) {
298361
+ teams(first: 20, after: $cursor) {
298362
+ nodes {
298363
+ id
298364
+ name
298362
298365
  repositories {
298363
298366
  edges {
298364
298367
  permission
@@ -298370,7 +298373,7 @@ async function getOrgTeamsDirectAccess(org) {
298370
298373
  }
298371
298374
  }
298372
298375
  }
298373
- }`);
298376
+ }`, { org });
298374
298377
  return transformGraphQLResponse(response);
298375
298378
  }
298376
298379
  function transformGraphQLResponse(response) {
@@ -1,8 +1,14 @@
1
1
  import { Octokit } from '@octokit/rest';
2
+ import type { Api } from '@octokit/plugin-rest-endpoint-methods/dist-types/types';
3
+ import type { PaginateInterface } from '@octokit/plugin-paginate-rest/dist-types/types';
4
+ import type { paginateGraphQLInterface } from "@octokit/plugin-paginate-graphql/dist-types/index.js";
2
5
  export declare const generateGithubAppToken: (config: any) => Promise<string>;
3
6
  export declare function getGithubAppToken(org: string, genGithubAppToken?: any): Promise<string>;
4
- export declare function getOctokitForOrg(org: string, paginated?: boolean, genGithubAppToken?: any): Promise<Octokit>;
5
- export declare function getOctokitFromPat(envVar: string): Promise<Octokit>;
7
+ type OctoType = Octokit & Api & {
8
+ paginate: PaginateInterface;
9
+ } & paginateGraphQLInterface;
10
+ export declare function getOctokitForOrg(org: string, paginated?: boolean, genGithubAppToken?: any): Promise<OctoType>;
11
+ export declare function getOctokitFromPat(envVar: string): Promise<OctoType>;
6
12
  declare const _default: {
7
13
  getOctokitForOrg: typeof getOctokitForOrg;
8
14
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.50.1-snapshot-33",
3
+ "version": "1.50.1-snapshot-36",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",