@heroku-cli/command

  • Version 12.3.3
  • Published
  • 85.5 kB
  • 9 dependencies
  • ISC license

Install

npm i @heroku-cli/command
yarn add @heroku-cli/command
pnpm add @heroku-cli/command

Overview

base class for Heroku CLI commands

Index

Variables

variable ALLOWED_HEROKU_DOMAINS

const ALLOWED_HEROKU_DOMAINS: readonly string[];

    variable AppAddonCompletion

    const AppAddonCompletion: {
    cacheDuration: number;
    cacheKey(ctx: { flags: { app: any } }): Promise<string>;
    options(ctx: { config: Config; flags?: any }): Promise<string[]>;
    };

      variable AppCompletion

      const AppCompletion: {
      cacheDuration: number;
      options(ctx: { config: Config }): Promise<string[]>;
      };

        variable AppDynoCompletion

        const AppDynoCompletion: {
        cacheDuration: number;
        cacheKey(ctx: { flags: { app: any } }): Promise<string>;
        options(ctx: { config: Config; flags?: any }): Promise<string[]>;
        };

          variable BuildpackCompletion

          const BuildpackCompletion: { options(): Promise<string[]>; skipCache: boolean };

            variable DynoSizeCompletion

            const DynoSizeCompletion: {
            cacheDuration: number;
            options(ctx: { config: Config }): Promise<string[]>;
            };

              variable FileCompletion

              const FileCompletion: { options(): Promise<string[]>; skipCache: boolean };

                variable LOCALHOST_DOMAINS

                const LOCALHOST_DOMAINS: readonly string[];

                  variable oneDay

                  const oneDay: number;

                    variable PipelineCompletion

                    const PipelineCompletion: {
                    cacheDuration: number;
                    options(ctx: { config: Config }): Promise<string[]>;
                    };

                      variable ProcessTypeCompletion

                      const ProcessTypeCompletion: { options(): Promise<string[]>; skipCache: boolean };

                        variable prompter

                        const prompter: Prompter;

                          variable RegionCompletion

                          const RegionCompletion: {
                          cacheDuration: number;
                          options(ctx: { config: Config }): Promise<string[]>;
                          };

                            variable RemoteCompletion

                            const RemoteCompletion: { options(): Promise<string[]>; skipCache: boolean };

                              variable RoleCompletion

                              const RoleCompletion: { options(): Promise<string[]>; skipCache: boolean };

                                variable ScopeCompletion

                                const ScopeCompletion: { options(): Promise<string[]>; skipCache: boolean };

                                  variable SpaceCompletion

                                  const SpaceCompletion: {
                                  cacheDuration: number;
                                  options(ctx: { config: Config }): Promise<string[]>;
                                  };

                                    variable StackCompletion

                                    const StackCompletion: {
                                    cacheDuration: number;
                                    options(ctx: { config: Config }): Promise<string[]>;
                                    };

                                      variable StageCompletion

                                      const StageCompletion: { options(): Promise<string[]>; skipCache: boolean };

                                        variable TeamCompletion

                                        const TeamCompletion: {
                                        cacheDuration: number;
                                        options(ctx: { config: Config }): Promise<string[]>;
                                        };

                                          variable vars

                                          const vars: Vars;

                                            variable yubikey

                                            const yubikey: {
                                            disable: () => void;
                                            enable: () => void;
                                            platform: NodeJS.Platform;
                                            };

                                              Functions

                                              function configRemote

                                              configRemote: () => string | undefined;

                                                function getGitRemotes

                                                getGitRemotes: (onlyRemote: string | undefined) => IGitRemotes[];

                                                  function herokuGet

                                                  herokuGet: (resource: string, ctx: { config: Config }) => Promise<string[]>;

                                                    Classes

                                                    class APIClient

                                                    class APIClient {}

                                                      constructor

                                                      constructor(config: Config, options?: IOptions);

                                                        property auth

                                                        auth: string;

                                                          property authPromise

                                                          authPromise?: Promise<HTTP<any>>;

                                                            property config

                                                            protected config: Config;

                                                              property defaults

                                                              readonly defaults: any;

                                                                property http

                                                                http: any;

                                                                  property options

                                                                  options: IOptions;

                                                                    property particleboard

                                                                    readonly particleboard: ParticleboardClient;

                                                                      property preauthPromises

                                                                      preauthPromises: { [k: string]: Promise<HTTP<any>> };

                                                                        property twoFactorMutex

                                                                        readonly twoFactorMutex: Mutex<string>;

                                                                          method delete

                                                                          delete: <T>(url: string, options?: APIClient.Options) => Promise<HTTP<T>>;

                                                                            method get

                                                                            get: <T>(url: string, options?: APIClient.Options) => Promise<HTTP<T>>;

                                                                              method login

                                                                              login: (opts?: Login.Options) => Promise<void>;

                                                                                method logout

                                                                                logout: () => Promise<void>;

                                                                                  method patch

                                                                                  patch: <T>(url: string, options?: APIClient.Options) => Promise<HTTP<T>>;

                                                                                    method post

                                                                                    post: <T>(url: string, options?: APIClient.Options) => Promise<HTTP<T>>;

                                                                                      method preauth

                                                                                      preauth: (app: string, factor: string) => Promise<HTTP<unknown>>;

                                                                                        method put

                                                                                        put: <T>(url: string, options?: APIClient.Options) => Promise<HTTP<T>>;

                                                                                          method request

                                                                                          request: <T>(url: string, options?: APIClient.Options) => Promise<HTTP<T>>;

                                                                                            method stream

                                                                                            stream: (url: string, options?: APIClient.Options) => Promise<HTTP<unknown>>;

                                                                                              method twoFactorPrompt

                                                                                              twoFactorPrompt: () => Promise<string>;

                                                                                                class Command

                                                                                                abstract class Command extends Base {}

                                                                                                  property allowArbitraryFlags

                                                                                                  allowArbitraryFlags: boolean;

                                                                                                    property baseFlags

                                                                                                    static baseFlags: Record<string, any>;
                                                                                                    • Base flags that includes the prompt flag by default Subclasses can override this to customize base flags

                                                                                                    property heroku

                                                                                                    readonly heroku: APIClient;

                                                                                                      property promptFlagActive

                                                                                                      static promptFlagActive: boolean;
                                                                                                      • Set this to false in a command class to disable the --prompt flag for that command

                                                                                                      method baseFlagsWithoutPrompt

                                                                                                      static baseFlagsWithoutPrompt: () => Record<string, any>;
                                                                                                      • Helper function to get baseFlags without the prompt flag Use this when you want to remove the prompt flag in a specific command:

                                                                                                        Example 1

                                                                                                        export default class MyCommand extends Command { static baseFlags = Command.baseFlagsWithoutPrompt() static flags = { ... } }

                                                                                                      method init

                                                                                                      init: () => Promise<void>;

                                                                                                        method isPromptModeActive

                                                                                                        protected isPromptModeActive: () => boolean;
                                                                                                        • Returns whether prompt mode is active for this command. False if the command has opted out (static promptFlagActive = false) or if the prompt flag is not in baseFlags.

                                                                                                        method parse

                                                                                                        protected parse: (options?: any, argv?: string[]) => Promise<any>;

                                                                                                          class Git

                                                                                                          class Git {}

                                                                                                            property remotes

                                                                                                            readonly remotes: IGitRemote[];

                                                                                                              method exec

                                                                                                              exec: (cmd: string) => string;

                                                                                                                class HerokuAPIError

                                                                                                                class HerokuAPIError extends CLIError {}

                                                                                                                  constructor

                                                                                                                  constructor(httpError: HTTPError);

                                                                                                                    property body

                                                                                                                    body: IHerokuAPIErrorOptions;

                                                                                                                      property http

                                                                                                                      http: HTTPError;

                                                                                                                        class Mutex

                                                                                                                        class Mutex<T> {}

                                                                                                                          method dequeue

                                                                                                                          dequeue: () => Promise<void> | undefined;

                                                                                                                            method execute

                                                                                                                            execute: (record: Record<T>) => Promise<void>;

                                                                                                                              method synchronize

                                                                                                                              synchronize: (task: Task<T>) => Promise<T>;

                                                                                                                                class ParticleboardClient

                                                                                                                                class ParticleboardClient {}

                                                                                                                                  constructor

                                                                                                                                  constructor(config: Config);

                                                                                                                                    property auth

                                                                                                                                    auth: string;

                                                                                                                                      property config

                                                                                                                                      protected config: Config;

                                                                                                                                        property defaults

                                                                                                                                        readonly defaults: any;

                                                                                                                                          property http

                                                                                                                                          http: any;

                                                                                                                                            method get

                                                                                                                                            get: <T>(url: string, options?: HTTPRequestOptions) => Promise<HTTP<T>>;

                                                                                                                                              class Vars

                                                                                                                                              class Vars {}

                                                                                                                                                property apiHost

                                                                                                                                                readonly apiHost: string;

                                                                                                                                                  property apiUrl

                                                                                                                                                  readonly apiUrl: string;

                                                                                                                                                    property envGitHost

                                                                                                                                                    readonly envGitHost: string;

                                                                                                                                                      property envHost

                                                                                                                                                      readonly envHost: string;

                                                                                                                                                        property envParticleboardUrl

                                                                                                                                                        readonly envParticleboardUrl: string;

                                                                                                                                                          property gitHost

                                                                                                                                                          readonly gitHost: string;

                                                                                                                                                            property gitPrefixes

                                                                                                                                                            readonly gitPrefixes: string[];

                                                                                                                                                              property host

                                                                                                                                                              readonly host: string;

                                                                                                                                                                property httpGitHost

                                                                                                                                                                readonly httpGitHost: string;

                                                                                                                                                                  property particleboardUrl

                                                                                                                                                                  readonly particleboardUrl: string;

                                                                                                                                                                    Interfaces

                                                                                                                                                                    interface IDelinquencyConfig

                                                                                                                                                                    interface IDelinquencyConfig {}

                                                                                                                                                                      property fetch_delinquency

                                                                                                                                                                      fetch_delinquency: boolean;

                                                                                                                                                                        property fetch_url

                                                                                                                                                                        fetch_url?: string;

                                                                                                                                                                          property resource_type

                                                                                                                                                                          resource_type?: 'account' | 'team';

                                                                                                                                                                            property warning_shown

                                                                                                                                                                            warning_shown: boolean;

                                                                                                                                                                              interface IDelinquencyInfo

                                                                                                                                                                              interface IDelinquencyInfo {}

                                                                                                                                                                                property scheduled_deletion_time

                                                                                                                                                                                scheduled_deletion_time?: null | string;

                                                                                                                                                                                  property scheduled_suspension_time

                                                                                                                                                                                  scheduled_suspension_time?: null | string;

                                                                                                                                                                                    interface IGitRemote

                                                                                                                                                                                    interface IGitRemote {}

                                                                                                                                                                                      property name

                                                                                                                                                                                      name: string;

                                                                                                                                                                                        property url

                                                                                                                                                                                        url: string;

                                                                                                                                                                                          interface IGitRemotes

                                                                                                                                                                                          interface IGitRemotes {}

                                                                                                                                                                                            property app

                                                                                                                                                                                            app: string;

                                                                                                                                                                                              property remote

                                                                                                                                                                                              remote: string;

                                                                                                                                                                                                interface IHerokuAPIErrorOptions

                                                                                                                                                                                                interface IHerokuAPIErrorOptions {}

                                                                                                                                                                                                  property app

                                                                                                                                                                                                  app?: {
                                                                                                                                                                                                  id: string;
                                                                                                                                                                                                  name: string;
                                                                                                                                                                                                  };

                                                                                                                                                                                                    property id

                                                                                                                                                                                                    id?: string;

                                                                                                                                                                                                      property message

                                                                                                                                                                                                      message?: string;

                                                                                                                                                                                                        property resource

                                                                                                                                                                                                        resource?: string;

                                                                                                                                                                                                          property url

                                                                                                                                                                                                          url?: string;

                                                                                                                                                                                                            interface IOptions

                                                                                                                                                                                                            interface IOptions {}

                                                                                                                                                                                                              property debug

                                                                                                                                                                                                              debug?: boolean;

                                                                                                                                                                                                                property debugHeaders

                                                                                                                                                                                                                debugHeaders?: boolean;

                                                                                                                                                                                                                  property preauth

                                                                                                                                                                                                                  preauth?: boolean;

                                                                                                                                                                                                                    property required

                                                                                                                                                                                                                    required?: boolean;

                                                                                                                                                                                                                      Type Aliases

                                                                                                                                                                                                                      type PromiseReject

                                                                                                                                                                                                                      type PromiseReject = (reason?: any) => void;

                                                                                                                                                                                                                        type PromiseResolve

                                                                                                                                                                                                                        type PromiseResolve<T> = (value: PromiseLike<T> | T) => void;

                                                                                                                                                                                                                          type Record

                                                                                                                                                                                                                          type Record<T> = [Task<T>, PromiseResolve<T>, PromiseReject];

                                                                                                                                                                                                                            type Task

                                                                                                                                                                                                                            type Task<T> = () => Promise<T>;

                                                                                                                                                                                                                              Namespaces

                                                                                                                                                                                                                              namespace APIClient

                                                                                                                                                                                                                              namespace APIClient {}

                                                                                                                                                                                                                                interface Options

                                                                                                                                                                                                                                interface Options extends HTTPRequestOptions {}

                                                                                                                                                                                                                                  property retryAuth

                                                                                                                                                                                                                                  retryAuth?: boolean;

                                                                                                                                                                                                                                    namespace flags

                                                                                                                                                                                                                                    module 'lib/flags/index.d.ts' {}

                                                                                                                                                                                                                                      variable app

                                                                                                                                                                                                                                      const app: any;

                                                                                                                                                                                                                                        variable boolean

                                                                                                                                                                                                                                        const boolean: any;

                                                                                                                                                                                                                                          variable custom

                                                                                                                                                                                                                                          const custom: any;

                                                                                                                                                                                                                                            variable directory

                                                                                                                                                                                                                                            const directory: any;

                                                                                                                                                                                                                                              variable file

                                                                                                                                                                                                                                              const file: any;

                                                                                                                                                                                                                                                variable integer

                                                                                                                                                                                                                                                const integer: any;

                                                                                                                                                                                                                                                  variable option

                                                                                                                                                                                                                                                  const option: any;

                                                                                                                                                                                                                                                    variable org

                                                                                                                                                                                                                                                    const org: any;

                                                                                                                                                                                                                                                      variable pipeline

                                                                                                                                                                                                                                                      const pipeline: any;

                                                                                                                                                                                                                                                        variable remote

                                                                                                                                                                                                                                                        const remote: any;

                                                                                                                                                                                                                                                          variable string

                                                                                                                                                                                                                                                          const string: any;

                                                                                                                                                                                                                                                            variable team

                                                                                                                                                                                                                                                            const team: any;

                                                                                                                                                                                                                                                              variable url

                                                                                                                                                                                                                                                              const url: any;

                                                                                                                                                                                                                                                                function noWrap

                                                                                                                                                                                                                                                                noWrap: (options?: {}) => any;

                                                                                                                                                                                                                                                                  Package Files (16)

                                                                                                                                                                                                                                                                  Dependencies (9)

                                                                                                                                                                                                                                                                  Dev Dependencies (24)

                                                                                                                                                                                                                                                                  Peer Dependencies (0)

                                                                                                                                                                                                                                                                  No peer dependencies.

                                                                                                                                                                                                                                                                  Badge

                                                                                                                                                                                                                                                                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@heroku-cli/command.

                                                                                                                                                                                                                                                                  • Markdown
                                                                                                                                                                                                                                                                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@heroku-cli/command)
                                                                                                                                                                                                                                                                  • HTML
                                                                                                                                                                                                                                                                    <a href="https://www.jsdocs.io/package/@heroku-cli/command"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>