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 type VarargsConfig = {
|
31 | required: boolean;
|
32 | validator?: (name: string, value: string) => void;
|
33 | } | boolean;
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | export declare abstract class SfdxCommand extends Command {
|
46 | protected static supportsUsername: boolean;
|
47 | protected static requiresUsername: boolean;
|
48 | protected static supportsDevhubUsername: boolean;
|
49 | protected static requiresDevhubUsername: boolean;
|
50 | protected static requiresProject: boolean;
|
51 | protected static deprecated?: Deprecation;
|
52 | protected static tableColumnData: string[];
|
53 | protected static flagsConfig: FlagsConfig;
|
54 | protected static result: SfdxResult;
|
55 | protected static varargs: VarargsConfig;
|
56 | protected logger: Logger;
|
57 | protected ux: UX;
|
58 | protected configAggregator: SfdxConfigAggregator;
|
59 | protected org?: Org;
|
60 | protected hubOrg?: Org;
|
61 | protected project?: SfProject;
|
62 | protected result: Result;
|
63 | protected flags: OutputFlags<any>;
|
64 | protected args: OutputArgs;
|
65 | protected varargs?: JsonMap;
|
66 |
|
67 | protected readonly lifecycleEventNames: string[];
|
68 | private isJson;
|
69 | static get flags(): Flags.Input<any>;
|
70 | static get usage(): string;
|
71 | protected get statics(): typeof SfdxCommand;
|
72 | static getVarArgsConfig(): Partial<VarargsConfig> | undefined;
|
73 | _run<T>(): Promise<Optional<T>>;
|
74 | protected assignProject(): Promise<void>;
|
75 | protected assignOrg(): Promise<void>;
|
76 | protected assignHubOrg(): Promise<void>;
|
77 | protected shouldEmitHelp(): boolean;
|
78 | protected init(): Promise<void>;
|
79 | protected catch(err: any): Promise<void>;
|
80 | protected finally(err: Optional<Error>): Promise<void>;
|
81 | protected warnIfDeprecated(): void;
|
82 | protected getJsonResultObject(result?: AnyJson, status?: number): {
|
83 | status: number;
|
84 | result: AnyJson;
|
85 | };
|
86 | protected parseVarargs(args?: string[]): JsonMap;
|
87 | |
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 | protected formatError(error: SfError): string[];
|
95 | |
96 |
|
97 |
|
98 | protected initLoggerAndUx(): Promise<void>;
|
99 | |
100 |
|
101 |
|
102 | private hooksFromLifecycleEvent;
|
103 | |
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 | abstract run(): Promise<any>;
|
112 | }
|