@firestartr/cli 1.45.0-snapshot-1 → 1.45.0-snapshot-2

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
@@ -278910,12 +278910,13 @@ var request_dist_bundle_request = _octokit_request_dist_bundle_withDefaults(endp
278910
278910
 
278911
278911
 
278912
278912
 
278913
- async function getInstallationID(org = 'default') {
278913
+ async function getInstallationID() {
278914
278914
  const auth = (0,dist_node.createAppAuth)({
278915
278915
  appId: catalog_common.environment.getFromEnvironment(catalog_common.types.envVars.githubAppId),
278916
278916
  privateKey: catalog_common.environment.getFromEnvironment(catalog_common.types.envVars.githubAppPemFile),
278917
278917
  request: request_dist_bundle_request,
278918
278918
  });
278919
+ const org = await getOrgOfInstallation();
278919
278920
  const response = await request_dist_bundle_request(`GET /orgs/${org}/installation`, {
278920
278921
  org,
278921
278922
  request: {
@@ -278924,6 +278925,22 @@ async function getInstallationID(org = 'default') {
278924
278925
  });
278925
278926
  return response.data.id;
278926
278927
  }
278928
+ async function getOrgOfInstallation() {
278929
+ const auth = (0,dist_node.createAppAuth)({
278930
+ appId: catalog_common.environment.getFromEnvironment(catalog_common.types.envVars.githubAppId),
278931
+ privateKey: catalog_common.environment.getFromEnvironment(catalog_common.types.envVars.githubAppPemFile),
278932
+ request: request_dist_bundle_request,
278933
+ });
278934
+ const { data: installations } = await request_dist_bundle_request('GET /app/installations', {
278935
+ request: {
278936
+ hook: auth.hook,
278937
+ },
278938
+ });
278939
+ if (installations.length !== 1) {
278940
+ throw 'Panic: the githubapp must be installed in just ONE organization';
278941
+ }
278942
+ return installations[0].account.login;
278943
+ }
278927
278944
 
278928
278945
  ;// CONCATENATED MODULE: ../github/src/auth.ts
278929
278946
 
@@ -278953,7 +278970,7 @@ async function getGithubAppToken(org = 'default', genGithubAppToken = generateGi
278953
278970
  const token = await genGithubAppToken({
278954
278971
  appId: catalog_common.environment.getFromEnvironment(catalog_common.types.envVars.githubAppId),
278955
278972
  privateKey: catalog_common.environment.getFromEnvironment(catalog_common.types.envVars.githubAppPemFile),
278956
- installationOrgId: await getInstallationID(org),
278973
+ installationOrgId: await getInstallationID(),
278957
278974
  });
278958
278975
  return token;
278959
278976
  }
@@ -278963,7 +278980,7 @@ async function getOctokitForOrg(org = 'default', paginated = false, genGithubApp
278963
278980
  const auth = await genGithubAppToken({
278964
278981
  appId: catalog_common.environment.getFromEnvironment(catalog_common.types.envVars.githubAppId),
278965
278982
  privateKey: catalog_common.environment.getFromEnvironment(catalog_common.types.envVars.githubAppPemFile),
278966
- installationOrgId: await getInstallationID(org),
278983
+ installationOrgId: await getInstallationID(),
278967
278984
  });
278968
278985
  const options = { auth: auth };
278969
278986
  if (paginated) {
@@ -1 +1,2 @@
1
- export declare function getInstallationID(org?: string): Promise<any>;
1
+ export declare function getInstallationID(): Promise<any>;
2
+ export declare function getOrgOfInstallation(): Promise<string>;
@@ -428,7 +428,7 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
428
428
  verified_at: string;
429
429
  };
430
430
  };
431
- author: Record<string, never> | {
431
+ author: {
432
432
  name?: string;
433
433
  email?: string;
434
434
  login: string;
@@ -451,8 +451,8 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
451
451
  site_admin: boolean;
452
452
  starred_at?: string;
453
453
  user_view_type?: string;
454
- };
455
- committer: Record<string, never> | {
454
+ } | Record<string, never>;
455
+ committer: {
456
456
  name?: string;
457
457
  email?: string;
458
458
  login: string;
@@ -475,7 +475,7 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
475
475
  site_admin: boolean;
476
476
  starred_at?: string;
477
477
  user_view_type?: string;
478
- };
478
+ } | Record<string, never>;
479
479
  parents: {
480
480
  sha: string;
481
481
  url: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.45.0-snapshot-1",
3
+ "version": "1.45.0-snapshot-2",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",