1 | import { Command } from '@oclif/core';
|
2 | import { Logger, Org, SfdxConfigAggregator, SfError, SfProject } from '@salesforce/core';
|
3 | import { AnyJson, JsonMap, Optional } from '@salesforce/ts-types';
|
4 | import { OutputArgs, OutputFlags } from '@oclif/core/lib/interfaces';
|
5 | import { flags as Flags, FlagsConfig } from './sfdxFlags';
|
6 | import { Deprecation, TableColumns, UX } from './ux';
|
7 | export interface SfdxResult {
|
8 | data?: AnyJson;
|
9 | tableColumnData?: TableColumns;
|
10 | display?: (this: Result) => void;
|
11 | }
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | export declare class Result implements SfdxResult {
|
19 | data: AnyJson;
|
20 | tableColumnData?: TableColumns;
|
21 | ux: UX;
|
22 | constructor(config?: SfdxResult);
|
23 | display(): void;
|
24 | }
|
25 | /**
|
26 | * Defines a varargs configuration. If set to true, there will be no
|
27 | * validation and varargs will not be required. The validator function
|
28 | * should throw an error if validation fails.
|
29 | */
|
30 | export declare type VarargsConfig = {
|
31 | required: boolean;
|
32 | validator?: (name: string, value: string) => void;
|
33 | } | boolean;
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | export declare abstract class SfdxCommand extends Command {
|
43 | protected static supportsUsername: boolean;
|
44 | protected static requiresUsername: boolean;
|
45 | protected static supportsDevhubUsername: boolean;
|
46 | protected static requiresDevhubUsername: boolean;
|
47 | protected static requiresProject: boolean;
|
48 | protected static deprecated?: Deprecation;
|
49 | protected static tableColumnData: string[];
|
50 | protected static flagsConfig: FlagsConfig;
|
51 | protected static result: SfdxResult;
|
52 | protected static varargs: VarargsConfig;
|
53 | protected logger: Logger;
|
54 | protected ux: UX;
|
55 | protected configAggregator: SfdxConfigAggregator;
|
56 | protected org?: Org;
|
57 | protected hubOrg?: Org;
|
58 | protected project?: SfProject;
|
59 | protected result: Result;
|
60 | protected flags: OutputFlags<any>;
|
61 | protected args: OutputArgs;
|
62 | protected varargs?: JsonMap;
|
63 |
|
64 | protected readonly lifecycleEventNames: string[];
|
65 | private isJson;
|
66 | static get flags(): Flags.Input<any>;
|
67 | static get usage(): string;
|
68 | protected get statics(): typeof SfdxCommand;
|
69 | static getVarArgsConfig(): Partial<VarargsConfig> | undefined;
|
70 | _run<T>(): Promise<Optional<T>>;
|
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 |
|
91 | protected formatError(error: SfError): string[];
|
92 | |
93 |
|
94 |
|
95 | protected initLoggerAndUx(): Promise<void>;
|
96 | |
97 |
|
98 |
|
99 | private hooksFromLifecycleEvent;
|
100 | |
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 | abstract run(): Promise<any>;
|
109 | }
|