UNPKG

1.56 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.Command = void 0;
4const tslib_1 = require("tslib");
5const core_1 = require("@oclif/core");
6const util_1 = require("util");
7const pjson = require('../package.json');
8const deps_1 = tslib_1.__importDefault(require("./deps"));
9const deprecatedCLI = (0, util_1.deprecate)(() => {
10 return require('cli-ux').cli;
11}, 'this.out and this.cli is deprecated. Please import "CliUx" from the @oclif/core module directly instead.');
12class Command extends core_1.Command {
13 constructor() {
14 super(...arguments);
15 this.base = `${pjson.name}@${pjson.version}`;
16 }
17 get heroku() {
18 if (this._heroku)
19 return this._heroku;
20 this._heroku = new deps_1.default.APIClient(this.config);
21 return this._heroku;
22 }
23 get legacyHerokuClient() {
24 if (this._legacyHerokuClient)
25 return this._legacyHerokuClient;
26 const HerokuClient = require('heroku-client');
27 const options = {
28 debug: this.config.debug,
29 host: `${this.heroku.defaults.protocol || 'https:'}//${this.heroku.defaults.host ||
30 'api.heroku.com'}`,
31 token: this.heroku.auth,
32 userAgent: this.heroku.defaults.headers['user-agent'],
33 };
34 this._legacyHerokuClient = new HerokuClient(options);
35 return this._legacyHerokuClient;
36 }
37 get cli() {
38 return deprecatedCLI();
39 }
40 get out() {
41 return deprecatedCLI();
42 }
43}
44exports.Command = Command;