heroku 10.0.1-beta.1 → 10.0.2-beta.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.
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const color_1 = require("@heroku-cli/color");
4
4
  const command_1 = require("@heroku-cli/command");
5
5
  const core_1 = require("@oclif/core");
6
- const http_call_1 = require("http-call");
6
+ const http_call_1 = require("@heroku/http-call");
7
7
  const api_1 = require("../../lib/api");
8
8
  const kolkrabbi_api_1 = require("../../lib/pipelines/kolkrabbi-api");
9
9
  const PROMOTION_ORDER = ['development', 'staging', 'production'];
@@ -23,13 +23,15 @@ async function diff(targetApp, downstreamApp, githubToken, herokuUserAgent) {
23
23
  // Do the actual GitHub diff
24
24
  try {
25
25
  const path = `${targetApp.repo}/compare/${downstreamApp.hash}...${targetApp.hash}`;
26
- const headers = { authorization: 'token ' + githubToken };
26
+ const headers = {
27
+ authorization: 'token ' + githubToken,
28
+ 'Content-Type': 'application/vnd.github+json',
29
+ 'X-GitHub-Api-Version': '2022-11-28',
30
+ };
27
31
  if (herokuUserAgent) {
28
- headers['user-agent'] = herokuUserAgent;
32
+ Reflect.set(headers, 'user-agent', herokuUserAgent);
29
33
  }
30
- const githubDiff = await http_call_1.default.get(`https://api.github.com/repos/${path}`, {
31
- headers,
32
- }).then(res => res.body);
34
+ const { body: githubDiff } = await http_call_1.default.get(`https://api.github.com/repos/${path}`, { headers });
33
35
  core_1.ux.log('');
34
36
  core_1.ux.styledHeader(`${color_1.default.app(targetApp.name)} is ahead of ${color_1.default.app(downstreamApp.name)} by ${githubDiff.ahead_by} commit${githubDiff.ahead_by === 1 ? '' : 's'}`);
35
37
  const mapped = githubDiff.commits.map((commit) => {
@@ -49,7 +51,6 @@ async function diff(targetApp, downstreamApp, githubToken, herokuUserAgent) {
49
51
  message: {},
50
52
  });
51
53
  core_1.ux.log(`\nhttps://github.com/${path}`);
52
- // tslint:disable-next-line: no-unused
53
54
  }
54
55
  catch (_a) {
55
56
  core_1.ux.log(`\n${color_1.default.app(targetApp.name)} was not compared to ${color_1.default.app(downstreamApp.name)} because we were unable to perform a diff`);
@@ -99,15 +100,17 @@ class PipelinesDiff extends command_1.Command {
99
100
  async run() {
100
101
  const { flags } = await this.parse(PipelinesDiff);
101
102
  const targetAppName = flags.app;
102
- const coupling = await (0, api_1.getCoupling)(this.heroku, targetAppName)
103
- .then(res => res.body)
104
- .catch(() => { });
105
- if (!coupling) {
103
+ let coupling;
104
+ try {
105
+ ({ body: coupling } = await (0, api_1.getCoupling)(this.heroku, targetAppName));
106
+ }
107
+ catch (_a) {
106
108
  core_1.ux.error(`This app (${targetAppName}) does not seem to be a part of any pipeline`);
107
109
  return;
108
110
  }
111
+ const { body: pipeline } = await (0, api_1.getPipeline)(this.heroku, coupling.pipeline.id);
109
112
  const targetAppId = coupling.app.id;
110
- const generation = coupling.generation;
113
+ const generation = pipeline.generation.name;
111
114
  core_1.ux.action.start('Fetching apps from pipeline');
112
115
  const allApps = await (0, api_1.listPipelineApps)(this.heroku, coupling.pipeline.id);
113
116
  core_1.ux.action.stop();
@@ -4,7 +4,7 @@ const color_1 = require("@heroku-cli/color");
4
4
  const core_1 = require("@oclif/core");
5
5
  const util_1 = require("@oclif/core/lib/util");
6
6
  const date_fns_1 = require("date-fns");
7
- const http_call_1 = require("http-call");
7
+ const http_call_1 = require("@heroku/http-call");
8
8
  const util_2 = require("../lib/status/util");
9
9
  const printStatus = (status) => {
10
10
  const colorize = color_1.default[status];
package/lib/deps.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { HTTP } from 'http-call';
1
+ import { HTTP } from '@heroku/http-call';
2
2
  import UserConfig from './user-config';
3
3
  import FS = require('fs-extra');
4
4
  import file = require('./file');
package/lib/deps.js CHANGED
@@ -12,7 +12,7 @@ exports.default = {
12
12
  return fetch('fs-extra');
13
13
  },
14
14
  get HTTP() {
15
- return fetch('http-call').HTTP;
15
+ return fetch('@heroku/http-call').HTTP;
16
16
  },
17
17
  get file() {
18
18
  return fetch('./file');
package/lib/lib/api.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { APIClient } from '@heroku-cli/command';
2
2
  import * as Heroku from '@heroku-cli/schema';
3
- import { App, PipelineCoupling, Release } from './types/fir';
3
+ import { App, Pipeline, PipelineCoupling } from './types/fir';
4
4
  export declare const V3_HEADER = "application/vnd.heroku+json; version=3";
5
5
  export declare const SDK_HEADER = "application/vnd.heroku+json; version=3.sdk";
6
6
  export declare const FILTERS_HEADER: string;
@@ -14,24 +14,21 @@ export declare function createPipeline(heroku: APIClient, name: any, owner: any)
14
14
  export declare function createPipelineTransfer(heroku: APIClient, pipeline: Heroku.Pipeline): Promise<import("@heroku/http-call").HTTP<unknown>>;
15
15
  export declare function destroyPipeline(heroku: APIClient, name: any, pipelineId: any): Promise<import("@heroku/http-call").HTTP<unknown>>;
16
16
  export declare function findPipelineByName(heroku: APIClient, idOrName: string): Promise<import("@heroku/http-call").HTTP<Heroku.Pipeline[]>>;
17
- export interface PipelineCouplingSdk extends Required<PipelineCoupling> {
18
- generation: 'fir' | 'cedar';
19
- }
20
- export declare function getCoupling(heroku: APIClient, app: string): Promise<import("@heroku/http-call").HTTP<PipelineCouplingSdk>>;
21
- export declare function getPipeline(heroku: APIClient, id: string): Promise<import("@heroku/http-call").HTTP<Heroku.Pipeline>>;
17
+ export declare function getCoupling(heroku: APIClient, app: string): Promise<import("@heroku/http-call").HTTP<PipelineCoupling>>;
18
+ export declare function getPipeline(heroku: APIClient, id: string): Promise<import("@heroku/http-call").HTTP<Pipeline>>;
22
19
  export declare function updatePipeline(heroku: APIClient, id: string, body: Heroku.Pipeline): Promise<import("@heroku/http-call").HTTP<Heroku.Pipeline>>;
23
20
  export declare function getTeam(heroku: APIClient, teamId: any): Promise<import("@heroku/http-call").HTTP<Heroku.Team>>;
24
21
  export declare function getAccountInfo(heroku: APIClient, id?: string): Promise<import("@heroku/http-call").HTTP<Heroku.Account>>;
25
22
  export declare function getAppSetup(heroku: APIClient, buildId: any): Promise<import("@heroku/http-call").HTTP<Heroku.AppSetup>>;
26
23
  export interface AppWithPipelineCoupling extends App {
27
- pipelineCoupling: PipelineCouplingSdk;
24
+ pipelineCoupling: PipelineCoupling;
28
25
  [k: string]: unknown;
29
26
  }
30
27
  export declare function listPipelineApps(heroku: APIClient, pipelineId: string): Promise<Array<AppWithPipelineCoupling>>;
31
28
  export declare function patchCoupling(heroku: APIClient, id: string, stage: string): Promise<import("@heroku/http-call").HTTP<Heroku.PipelineCoupling>>;
32
29
  export declare function removeCoupling(heroku: APIClient, app: string): Promise<import("@heroku/http-call").HTTP<unknown>>;
33
30
  export declare function updateCoupling(heroku: APIClient, app: string, stage: string): Promise<import("@heroku/http-call").HTTP<Heroku.PipelineCoupling>>;
34
- export declare function getReleases(heroku: APIClient, appId: string): Promise<import("@heroku/http-call").HTTP<Release[]>>;
31
+ export declare function getReleases(heroku: APIClient, appId: string): Promise<import("@heroku/http-call").HTTP<Heroku.Release[]>>;
35
32
  export declare function getPipelineConfigVars(heroku: APIClient, pipelineID: string): Promise<import("@heroku/http-call").HTTP<Heroku.ConfigVars>>;
36
33
  export declare function setPipelineConfigVars(heroku: APIClient, pipelineID: string, body: Heroku.ConfigVars | Record<string, null>): Promise<import("@heroku/http-call").HTTP<Heroku.ConfigVars>>;
37
34
  export declare function createTestRun(heroku: APIClient, body: Heroku.TestRun): Promise<import("@heroku/http-call").HTTP<Heroku.TestRun>>;
@@ -14,11 +14,11 @@ async function getApp(appOrName, herokuApi) {
14
14
  }
15
15
  async function isFirApp(appOrName, herokuApi) {
16
16
  const app = await getApp(appOrName, herokuApi);
17
- return app.generation === 'fir';
17
+ return app.generation.name === 'fir';
18
18
  }
19
19
  exports.isFirApp = isFirApp;
20
20
  async function isCedarApp(appOrName, herokuApi) {
21
21
  const app = await getApp(appOrName, herokuApi);
22
- return app.generation === 'cedar';
22
+ return app.generation.name === 'cedar';
23
23
  }
24
24
  exports.isCedarApp = isCedarApp;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.streamer = void 0;
4
4
  async function call(url, out, retries) {
5
- const http = require('http-call').HTTP;
5
+ const http = require('@heroku/http-call').HTTP;
6
6
  const maxRetries = 30;
7
7
  try {
8
8
  const { response } = await http.stream(url);
@@ -1,4 +1,4 @@
1
- import HTTP from 'http-call';
1
+ import HTTP from '@heroku/http-call';
2
2
  export default class GitHubAPI {
3
3
  version: any;
4
4
  token: any;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const http_call_1 = require("http-call");
3
+ const http_call_1 = require("@heroku/http-call");
4
4
  const GITHUB_API = 'https://api.github.com';
5
5
  class GitHubAPI {
6
6
  constructor(version, token) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const http_call_1 = require("http-call");
3
+ const http_call_1 = require("@heroku/http-call");
4
4
  const KOLKRABBI_BASE_URL = 'https://kolkrabbi.heroku.com';
5
5
  class default_1 {
6
6
  constructor(version, getToken) {
@@ -5,7 +5,7 @@
5
5
  import { APIClient } from '@heroku-cli/command';
6
6
  import { IOptions } from '@heroku-cli/command/lib/api-client';
7
7
  import { Dyno as APIDyno } from '@heroku-cli/schema';
8
- import { HTTP } from 'http-call';
8
+ import { HTTP } from '@heroku/http-call';
9
9
  import * as net from 'net';
10
10
  import { Duplex } from 'stream';
11
11
  import * as tls from 'tls';
@@ -14451,5 +14451,5 @@
14451
14451
  ]
14452
14452
  }
14453
14453
  },
14454
- "version": "10.0.1-beta.1"
14454
+ "version": "10.0.2-beta.0"
14455
14455
  }
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "heroku",
3
3
  "description": "CLI to interact with Heroku",
4
- "version": "10.0.1-beta.1",
4
+ "version": "10.0.2-beta.0",
5
5
  "author": "Heroku",
6
6
  "bin": "./bin/run",
7
7
  "bugs": "https://github.com/heroku/cli/issues",
8
8
  "dependencies": {
9
9
  "@heroku-cli/color": "2.0.1",
10
- "@heroku-cli/command": "11.4.0-beta.1",
10
+ "@heroku-cli/command": "^11.4.0",
11
11
  "@heroku-cli/notifications": "^1.2.4",
12
- "@heroku-cli/plugin-ps-exec": "2.6.0",
12
+ "@heroku-cli/plugin-ps-exec": "2.6.1",
13
13
  "@heroku-cli/schema": "^1.0.25",
14
14
  "@heroku/buildpack-registry": "^1.0.1",
15
15
  "@heroku/eventsource": "^1.0.7",
16
16
  "@heroku/heroku-cli-util": "^8.0.13",
17
- "@heroku/http-call": "5.4.0-beta.1",
17
+ "@heroku/http-call": "^5.4.0",
18
18
  "@inquirer/prompts": "^5.0.5",
19
19
  "@oclif/core": "^2.16.0",
20
20
  "@oclif/plugin-commands": "2.2.28",
@@ -390,5 +390,5 @@
390
390
  "version": "oclif readme --multi && git add README.md ../../docs"
391
391
  },
392
392
  "types": "lib/index.d.ts",
393
- "gitHead": "c2a05b98dbb7dcd520197c1aa839b677f31aea02"
393
+ "gitHead": "507ecf9015f04a1ca0472abf6acf82d9fca76d24"
394
394
  }