sfdx-hardis
Version:
Swiss-army-knife Toolbox for Salesforce. Allows you to define a complete CD/CD Pipeline. Orchestrate base commands and assist users with interactive wizards
42 lines (41 loc) • 1.57 kB
TypeScript
import { CommonPullRequestInfo } from '../gitProvider/index.js';
export interface PrePostCommand {
id: string;
label: string;
type: 'command' | 'data' | 'apex' | 'publish-community' | 'manual';
parameters?: {
apexScript?: string;
sfdmuProject?: string;
communityName?: string;
instructions?: string;
[key: string]: any;
};
command: string;
context: 'all' | 'check-deployment-only' | 'process-deployment-only';
skipIfError?: boolean;
allowFailure?: boolean;
runOnlyOnceByOrg?: boolean;
customUsername?: string;
pullRequest?: CommonPullRequestInfo;
result?: ActionResult;
}
export type ActionResult = {
statusCode: 'success' | 'failed' | 'skipped' | "manual";
output?: string;
skippedReason?: string;
};
export declare abstract class ActionsProvider {
customUsernameToUse: string | null;
static buildActionInstance(cmd: PrePostCommand): Promise<ActionsProvider>;
getLabel(): string;
/**
* Perform pre-run validations for the given command.
* Return null when the command is valid and may proceed.
* Return an ActionResult when the command must be short-circuited
* (for example: missing parameters -> failed, or manual -> skipped).
*/
checkValidityIssues(cmd: PrePostCommand): Promise<ActionResult | null>;
checkParameters(_cmd: PrePostCommand): Promise<ActionResult | null>;
run(cmd: PrePostCommand): Promise<ActionResult>;
checkAuthCustomUsernameIssues(cmd: PrePostCommand): Promise<ActionResult | null>;
}