heroku 10.3.0 → 10.4.0-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.
@@ -8,5 +8,6 @@ export default class Plans extends Command {
8
8
  static args: {
9
9
  service: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
10
10
  };
11
+ private printMeteredPricingURL;
11
12
  run(): Promise<void>;
12
13
  }
@@ -4,10 +4,19 @@ const command_1 = require("@heroku-cli/command");
4
4
  const core_1 = require("@oclif/core");
5
5
  const util_1 = require("../../lib/addons/util");
6
6
  const _ = require("lodash");
7
+ const printf = require("printf");
7
8
  class Plans extends command_1.Command {
9
+ printMeteredPricingURL(service) {
10
+ return printf(`https://elements.heroku.com/addons/${service}#pricing`);
11
+ }
8
12
  async run() {
9
13
  const { flags, args } = await this.parse(Plans);
10
- let { body: plans } = await this.heroku.get(`/addon-services/${args.service}/plans`);
14
+ const { service } = args;
15
+ let { body: plans } = await this.heroku.get(`/addon-services/${service}/plans`, {
16
+ headers: {
17
+ Accept: 'application/vnd.heroku+json; version=3.sdk',
18
+ },
19
+ });
11
20
  plans = _.sortBy(plans, ['price.contract', 'price.cents']);
12
21
  if (flags.json) {
13
22
  core_1.ux.styledJSON(plans);
@@ -30,7 +39,7 @@ class Plans extends command_1.Command {
30
39
  },
31
40
  max_price: {
32
41
  header: 'Max price',
33
- get: (plan) => (0, util_1.formatPrice)({ price: plan.price, hourly: false }),
42
+ get: (plan) => plan.price.metered ? this.printMeteredPricingURL(service) : (0, util_1.formatPrice)({ price: plan.price, hourly: false }),
34
43
  },
35
44
  });
36
45
  }
@@ -0,0 +1,11 @@
1
+ import { Command } from '@heroku-cli/command';
2
+ export default class Retry extends Command {
3
+ static topic: string;
4
+ static description: string;
5
+ static examples: string[];
6
+ static help: string;
7
+ static flags: {
8
+ app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const command_1 = require("@heroku-cli/command");
4
+ const core_1 = require("@oclif/core");
5
+ const color_1 = require("@heroku-cli/color");
6
+ const output_1 = require("../../lib/releases/output");
7
+ const releases_1 = require("../../lib/releases/releases");
8
+ class Retry extends command_1.Command {
9
+ async run() {
10
+ var _a;
11
+ const { flags } = await this.parse(Retry);
12
+ const { app } = flags;
13
+ const release = await (0, releases_1.findByLatestOrId)(this.heroku, app);
14
+ const { body: formations } = await this.heroku.get(`/apps/${app}/formation`);
15
+ const releasePhase = formations.filter(formation => formation.type === 'release');
16
+ if (!release) {
17
+ return core_1.ux.error('No release found for this app.');
18
+ }
19
+ if (releasePhase.length === 0) {
20
+ return core_1.ux.error('App must have a release-phase command to use this command.');
21
+ }
22
+ core_1.ux.action.start(`Retrying ${color_1.default.green('v' + release.version)} on ${color_1.default.app(app)}`);
23
+ const { body: retry } = await this.heroku.post(`/apps/${app}/releases`, {
24
+ body: {
25
+ slug: (_a = release === null || release === void 0 ? void 0 : release.slug) === null || _a === void 0 ? void 0 : _a.id,
26
+ description: `Retry of v${release.version}: ${release.description}`,
27
+ },
28
+ });
29
+ core_1.ux.action.stop(`done, ${color_1.default.green('v' + retry.version)}`);
30
+ if (retry.output_stream_url) {
31
+ core_1.ux.log('Running release command...');
32
+ await (0, output_1.stream)(retry.output_stream_url)
33
+ .catch(error => {
34
+ var _a;
35
+ if (error.statusCode === 404 || ((_a = error.response) === null || _a === void 0 ? void 0 : _a.statusCode) === 404) {
36
+ core_1.ux.warn(`Release command starting. Use ${color_1.default.cmd('heroku releases:output --app ' + app)} to view the log.`);
37
+ return;
38
+ }
39
+ throw error;
40
+ });
41
+ }
42
+ }
43
+ }
44
+ exports.default = Retry;
45
+ Retry.topic = 'releases';
46
+ Retry.description = 'retry the latest release-phase command';
47
+ Retry.examples = ['heroku releases:retry --app happy-samurai-42'];
48
+ Retry.help = 'Copies the latest release into a new release and retries the latest release-phase command. App must have a release-phase command.';
49
+ Retry.flags = {
50
+ app: command_1.flags.app({ required: true }),
51
+ };
@@ -29,6 +29,8 @@ const formatPrice = function ({ price, hourly }) {
29
29
  return;
30
30
  if (price.contract)
31
31
  return 'contract';
32
+ if (price.metered)
33
+ return 'metered';
32
34
  if (price.cents === 0)
33
35
  return 'free';
34
36
  // we are using a standardized 720 hours/month
@@ -337,6 +337,202 @@
337
337
  "status.js"
338
338
  ]
339
339
  },
340
+ "access:add": {
341
+ "aliases": [],
342
+ "args": {
343
+ "email": {
344
+ "description": "email address of the team member",
345
+ "name": "email",
346
+ "required": true
347
+ }
348
+ },
349
+ "description": "add new users to your app",
350
+ "examples": [
351
+ "$ heroku access:add user@email.com --app APP # add a collaborator to your app",
352
+ "$ heroku access:add user@email.com --app APP --permissions deploy,manage,operate # permissions must be comma separated"
353
+ ],
354
+ "flags": {
355
+ "app": {
356
+ "char": "a",
357
+ "description": "app to run command against",
358
+ "name": "app",
359
+ "required": true,
360
+ "hasDynamicHelp": false,
361
+ "multiple": false,
362
+ "type": "option"
363
+ },
364
+ "remote": {
365
+ "char": "r",
366
+ "description": "git remote of app to use",
367
+ "name": "remote",
368
+ "hasDynamicHelp": false,
369
+ "multiple": false,
370
+ "type": "option"
371
+ },
372
+ "permissions": {
373
+ "char": "p",
374
+ "description": "list of permissions comma separated",
375
+ "name": "permissions",
376
+ "hasDynamicHelp": false,
377
+ "multiple": false,
378
+ "type": "option"
379
+ }
380
+ },
381
+ "hasDynamicHelp": false,
382
+ "hiddenAliases": [],
383
+ "id": "access:add",
384
+ "pluginAlias": "heroku",
385
+ "pluginName": "heroku",
386
+ "pluginType": "core",
387
+ "strict": true,
388
+ "isESM": false,
389
+ "relativePath": [
390
+ "lib",
391
+ "commands",
392
+ "access",
393
+ "add.js"
394
+ ]
395
+ },
396
+ "access": {
397
+ "aliases": [],
398
+ "args": {},
399
+ "description": "list who has access to an app",
400
+ "flags": {
401
+ "app": {
402
+ "char": "a",
403
+ "description": "app to run command against",
404
+ "name": "app",
405
+ "required": true,
406
+ "hasDynamicHelp": false,
407
+ "multiple": false,
408
+ "type": "option"
409
+ },
410
+ "remote": {
411
+ "char": "r",
412
+ "description": "git remote of app to use",
413
+ "name": "remote",
414
+ "hasDynamicHelp": false,
415
+ "multiple": false,
416
+ "type": "option"
417
+ },
418
+ "json": {
419
+ "description": "output in json format",
420
+ "name": "json",
421
+ "allowNo": false,
422
+ "type": "boolean"
423
+ }
424
+ },
425
+ "hasDynamicHelp": false,
426
+ "hiddenAliases": [],
427
+ "id": "access",
428
+ "pluginAlias": "heroku",
429
+ "pluginName": "heroku",
430
+ "pluginType": "core",
431
+ "strict": true,
432
+ "topic": "access",
433
+ "isESM": false,
434
+ "relativePath": [
435
+ "lib",
436
+ "commands",
437
+ "access",
438
+ "index.js"
439
+ ]
440
+ },
441
+ "access:remove": {
442
+ "aliases": [],
443
+ "args": {},
444
+ "description": "remove users from a team app",
445
+ "examples": "$ heroku access:remove user@email.com --app APP",
446
+ "flags": {
447
+ "app": {
448
+ "char": "a",
449
+ "description": "app to run command against",
450
+ "name": "app",
451
+ "required": true,
452
+ "hasDynamicHelp": false,
453
+ "multiple": false,
454
+ "type": "option"
455
+ },
456
+ "remote": {
457
+ "char": "r",
458
+ "description": "git remote of app to use",
459
+ "name": "remote",
460
+ "hasDynamicHelp": false,
461
+ "multiple": false,
462
+ "type": "option"
463
+ }
464
+ },
465
+ "hasDynamicHelp": false,
466
+ "hiddenAliases": [],
467
+ "id": "access:remove",
468
+ "pluginAlias": "heroku",
469
+ "pluginName": "heroku",
470
+ "pluginType": "core",
471
+ "strict": false,
472
+ "example": "$ heroku access:remove user@email.com --app APP",
473
+ "topic": "access",
474
+ "isESM": false,
475
+ "relativePath": [
476
+ "lib",
477
+ "commands",
478
+ "access",
479
+ "remove.js"
480
+ ]
481
+ },
482
+ "access:update": {
483
+ "aliases": [],
484
+ "args": {
485
+ "email": {
486
+ "description": "email address of the team member",
487
+ "name": "email",
488
+ "required": true
489
+ }
490
+ },
491
+ "description": "update existing collaborators on an team app",
492
+ "flags": {
493
+ "permissions": {
494
+ "char": "p",
495
+ "description": "comma-delimited list of permissions to update (deploy,manage,operate)",
496
+ "name": "permissions",
497
+ "required": true,
498
+ "hasDynamicHelp": false,
499
+ "multiple": false,
500
+ "type": "option"
501
+ },
502
+ "app": {
503
+ "char": "a",
504
+ "description": "app to run command against",
505
+ "name": "app",
506
+ "required": true,
507
+ "hasDynamicHelp": false,
508
+ "multiple": false,
509
+ "type": "option"
510
+ },
511
+ "remote": {
512
+ "char": "r",
513
+ "description": "git remote of app to use",
514
+ "name": "remote",
515
+ "hasDynamicHelp": false,
516
+ "multiple": false,
517
+ "type": "option"
518
+ }
519
+ },
520
+ "hasDynamicHelp": false,
521
+ "hiddenAliases": [],
522
+ "id": "access:update",
523
+ "pluginAlias": "heroku",
524
+ "pluginName": "heroku",
525
+ "pluginType": "core",
526
+ "strict": true,
527
+ "topic": "access",
528
+ "isESM": false,
529
+ "relativePath": [
530
+ "lib",
531
+ "commands",
532
+ "access",
533
+ "update.js"
534
+ ]
535
+ },
340
536
  "addons:attach": {
341
537
  "aliases": [],
342
538
  "args": {
@@ -1731,202 +1927,6 @@
1731
1927
  "unlock.js"
1732
1928
  ]
1733
1929
  },
1734
- "access:add": {
1735
- "aliases": [],
1736
- "args": {
1737
- "email": {
1738
- "description": "email address of the team member",
1739
- "name": "email",
1740
- "required": true
1741
- }
1742
- },
1743
- "description": "add new users to your app",
1744
- "examples": [
1745
- "$ heroku access:add user@email.com --app APP # add a collaborator to your app",
1746
- "$ heroku access:add user@email.com --app APP --permissions deploy,manage,operate # permissions must be comma separated"
1747
- ],
1748
- "flags": {
1749
- "app": {
1750
- "char": "a",
1751
- "description": "app to run command against",
1752
- "name": "app",
1753
- "required": true,
1754
- "hasDynamicHelp": false,
1755
- "multiple": false,
1756
- "type": "option"
1757
- },
1758
- "remote": {
1759
- "char": "r",
1760
- "description": "git remote of app to use",
1761
- "name": "remote",
1762
- "hasDynamicHelp": false,
1763
- "multiple": false,
1764
- "type": "option"
1765
- },
1766
- "permissions": {
1767
- "char": "p",
1768
- "description": "list of permissions comma separated",
1769
- "name": "permissions",
1770
- "hasDynamicHelp": false,
1771
- "multiple": false,
1772
- "type": "option"
1773
- }
1774
- },
1775
- "hasDynamicHelp": false,
1776
- "hiddenAliases": [],
1777
- "id": "access:add",
1778
- "pluginAlias": "heroku",
1779
- "pluginName": "heroku",
1780
- "pluginType": "core",
1781
- "strict": true,
1782
- "isESM": false,
1783
- "relativePath": [
1784
- "lib",
1785
- "commands",
1786
- "access",
1787
- "add.js"
1788
- ]
1789
- },
1790
- "access": {
1791
- "aliases": [],
1792
- "args": {},
1793
- "description": "list who has access to an app",
1794
- "flags": {
1795
- "app": {
1796
- "char": "a",
1797
- "description": "app to run command against",
1798
- "name": "app",
1799
- "required": true,
1800
- "hasDynamicHelp": false,
1801
- "multiple": false,
1802
- "type": "option"
1803
- },
1804
- "remote": {
1805
- "char": "r",
1806
- "description": "git remote of app to use",
1807
- "name": "remote",
1808
- "hasDynamicHelp": false,
1809
- "multiple": false,
1810
- "type": "option"
1811
- },
1812
- "json": {
1813
- "description": "output in json format",
1814
- "name": "json",
1815
- "allowNo": false,
1816
- "type": "boolean"
1817
- }
1818
- },
1819
- "hasDynamicHelp": false,
1820
- "hiddenAliases": [],
1821
- "id": "access",
1822
- "pluginAlias": "heroku",
1823
- "pluginName": "heroku",
1824
- "pluginType": "core",
1825
- "strict": true,
1826
- "topic": "access",
1827
- "isESM": false,
1828
- "relativePath": [
1829
- "lib",
1830
- "commands",
1831
- "access",
1832
- "index.js"
1833
- ]
1834
- },
1835
- "access:remove": {
1836
- "aliases": [],
1837
- "args": {},
1838
- "description": "remove users from a team app",
1839
- "examples": "$ heroku access:remove user@email.com --app APP",
1840
- "flags": {
1841
- "app": {
1842
- "char": "a",
1843
- "description": "app to run command against",
1844
- "name": "app",
1845
- "required": true,
1846
- "hasDynamicHelp": false,
1847
- "multiple": false,
1848
- "type": "option"
1849
- },
1850
- "remote": {
1851
- "char": "r",
1852
- "description": "git remote of app to use",
1853
- "name": "remote",
1854
- "hasDynamicHelp": false,
1855
- "multiple": false,
1856
- "type": "option"
1857
- }
1858
- },
1859
- "hasDynamicHelp": false,
1860
- "hiddenAliases": [],
1861
- "id": "access:remove",
1862
- "pluginAlias": "heroku",
1863
- "pluginName": "heroku",
1864
- "pluginType": "core",
1865
- "strict": false,
1866
- "example": "$ heroku access:remove user@email.com --app APP",
1867
- "topic": "access",
1868
- "isESM": false,
1869
- "relativePath": [
1870
- "lib",
1871
- "commands",
1872
- "access",
1873
- "remove.js"
1874
- ]
1875
- },
1876
- "access:update": {
1877
- "aliases": [],
1878
- "args": {
1879
- "email": {
1880
- "description": "email address of the team member",
1881
- "name": "email",
1882
- "required": true
1883
- }
1884
- },
1885
- "description": "update existing collaborators on an team app",
1886
- "flags": {
1887
- "permissions": {
1888
- "char": "p",
1889
- "description": "comma-delimited list of permissions to update (deploy,manage,operate)",
1890
- "name": "permissions",
1891
- "required": true,
1892
- "hasDynamicHelp": false,
1893
- "multiple": false,
1894
- "type": "option"
1895
- },
1896
- "app": {
1897
- "char": "a",
1898
- "description": "app to run command against",
1899
- "name": "app",
1900
- "required": true,
1901
- "hasDynamicHelp": false,
1902
- "multiple": false,
1903
- "type": "option"
1904
- },
1905
- "remote": {
1906
- "char": "r",
1907
- "description": "git remote of app to use",
1908
- "name": "remote",
1909
- "hasDynamicHelp": false,
1910
- "multiple": false,
1911
- "type": "option"
1912
- }
1913
- },
1914
- "hasDynamicHelp": false,
1915
- "hiddenAliases": [],
1916
- "id": "access:update",
1917
- "pluginAlias": "heroku",
1918
- "pluginName": "heroku",
1919
- "pluginType": "core",
1920
- "strict": true,
1921
- "topic": "access",
1922
- "isESM": false,
1923
- "relativePath": [
1924
- "lib",
1925
- "commands",
1926
- "access",
1927
- "update.js"
1928
- ]
1929
- },
1930
1930
  "auth:login": {
1931
1931
  "aliases": [
1932
1932
  "login"
@@ -8964,6 +8964,41 @@
8964
8964
  "output.js"
8965
8965
  ]
8966
8966
  },
8967
+ "releases:retry": {
8968
+ "aliases": [],
8969
+ "args": {},
8970
+ "description": "retry the latest release-phase command",
8971
+ "examples": [
8972
+ "heroku releases:retry --app happy-samurai-42"
8973
+ ],
8974
+ "flags": {
8975
+ "app": {
8976
+ "char": "a",
8977
+ "description": "app to run command against",
8978
+ "name": "app",
8979
+ "required": true,
8980
+ "hasDynamicHelp": false,
8981
+ "multiple": false,
8982
+ "type": "option"
8983
+ }
8984
+ },
8985
+ "hasDynamicHelp": false,
8986
+ "hiddenAliases": [],
8987
+ "id": "releases:retry",
8988
+ "pluginAlias": "heroku",
8989
+ "pluginName": "heroku",
8990
+ "pluginType": "core",
8991
+ "strict": true,
8992
+ "topic": "releases",
8993
+ "help": "Copies the latest release into a new release and retries the latest release-phase command. App must have a release-phase command.",
8994
+ "isESM": false,
8995
+ "relativePath": [
8996
+ "lib",
8997
+ "commands",
8998
+ "releases",
8999
+ "retry.js"
9000
+ ]
9001
+ },
8967
9002
  "releases:rollback": {
8968
9003
  "aliases": [],
8969
9004
  "args": {
@@ -14451,5 +14486,5 @@
14451
14486
  ]
14452
14487
  }
14453
14488
  },
14454
- "version": "10.3.0"
14489
+ "version": "10.4.0-beta.0"
14455
14490
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "heroku",
3
3
  "description": "CLI to interact with Heroku",
4
- "version": "10.3.0",
4
+ "version": "10.4.0-beta.0",
5
5
  "author": "Heroku",
6
6
  "bin": "./bin/run",
7
7
  "bugs": "https://github.com/heroku/cli/issues",
@@ -397,5 +397,5 @@
397
397
  "version": "oclif readme --multi && git add README.md ../../docs"
398
398
  },
399
399
  "types": "lib/index.d.ts",
400
- "gitHead": "7556b06e19da422a58d178168a1791f0fb279b9d"
400
+ "gitHead": "bfa6b7ec487f0eba872a5cc219570ac3227d7d68"
401
401
  }