1 | import Command from '@oclif/command';
|
2 | import { OutputArgs, OutputFlags } from '@oclif/parser';
|
3 | import { ConfigAggregator, Logger, Org, SfdxError, SfdxProject } from '@salesforce/core';
|
4 | import { AnyJson, JsonMap, Optional } from '@salesforce/ts-types';
|
5 | import { flags as Flags, FlagsConfig } from './sfdxFlags';
|
6 | import { TableOptions, UX } from './ux';
|
7 | import { Deprecation } from './ux';
|
8 | export interface SfdxResult {
|
9 | data?: AnyJson;
|
10 | tableColumnData?: TableOptions;
|
11 | display?: (this: Result) => void;
|
12 | }
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | export declare class Result implements SfdxResult {
|
20 | data: AnyJson;
|
21 | tableColumnData?: TableOptions;
|
22 | ux: UX;
|
23 | constructor(config?: SfdxResult);
|
24 | display(): void;
|
25 | }
|
26 | /**
|
27 | * Defines a varargs configuration. If set to true, there will be no
|
28 | * validation and varargs will not be required. The validator function
|
29 | * should throw an error if validation fails.
|
30 | */
|
31 | export declare type VarargsConfig = {
|
32 | required: boolean;
|
33 | validator?: (name: string, value: string) => void;
|
34 | } | boolean;
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | export declare abstract class SfdxCommand extends Command {
|
44 | static readonly flags: Flags.Input<any>;
|
45 | static readonly usage: string;
|
46 | static getVarArgsConfig(): Partial<VarargsConfig> | undefined;
|
47 | protected readonly statics: typeof SfdxCommand;
|
48 | protected static supportsUsername: boolean;
|
49 | protected static requiresUsername: boolean;
|
50 | protected static supportsDevhubUsername: boolean;
|
51 | protected static requiresDevhubUsername: boolean;
|
52 | protected static requiresProject: boolean;
|
53 | protected static deprecated?: Deprecation;
|
54 | protected static tableColumnData: string[];
|
55 | protected static flagsConfig: FlagsConfig;
|
56 | protected static result: SfdxResult;
|
57 | protected static varargs: VarargsConfig;
|
58 | protected logger: Logger;
|
59 | protected ux: UX;
|
60 | protected configAggregator: ConfigAggregator;
|
61 | protected org?: Org;
|
62 | protected hubOrg?: Org;
|
63 | protected project?: SfdxProject;
|
64 | protected result: Result;
|
65 | protected flags: OutputFlags<any>;
|
66 | protected args: OutputArgs<any>;
|
67 | protected varargs?: JsonMap;
|
68 | private isJson;
|
69 | _run<T>(): Promise<Optional<T>>;
|
70 | abstract run(): Promise<any>;
|
71 | protected assignProject(): Promise<void>;
|
72 | protected assignOrg(): Promise<void>;
|
73 | protected assignHubOrg(): Promise<void>;
|
74 | protected shouldEmitHelp(): boolean;
|
75 | protected init(): Promise<void>;
|
76 | protected catch(err: any): Promise<void>;
|
77 | protected finally(err: Optional<Error>): Promise<void>;
|
78 | protected warnIfDeprecated(): void;
|
79 | protected getJsonResultObject(result?: AnyJson, status?: number): {
|
80 | status: number;
|
81 | result: AnyJson;
|
82 | };
|
83 | protected parseVarargs(args?: string[]): JsonMap;
|
84 | |
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 | protected formatError(error: SfdxError): string[];
|
91 | |
92 |
|
93 |
|
94 | protected initLoggerAndUx(): Promise<void>;
|
95 | }
|