salesforce-alm
Version:
This package contains tools, and APIs, for an improved salesforce.com developer experience.
80 lines (79 loc) • 2.65 kB
TypeScript
import * as Config from '@oclif/config';
import { Optional, Dictionary } from '@salesforce/ts-types';
import { WorkspaceElementObj } from './workspaceElement';
declare type HookOpts<T> = {
Command: Config.Command.Class;
argv: string[];
commandId: string;
result: Optional<T>;
};
interface SourceInfo {
workspaceElements: WorkspaceElementObj[];
}
interface MetadataInfo {
mdapiFilePath: string[];
}
export declare type MetadataSourceResult = Dictionary<SourceInfo & MetadataInfo>;
declare type PreDeployOpts = HookOpts<MetadataSourceResult>;
export declare type SourceResult = Dictionary<SourceInfo>;
declare type PostSourceUpdateOpts = HookOpts<SourceResult>;
export declare type MetadataResult = Dictionary<MetadataInfo>;
declare type PostRetriveOpts = HookOpts<MetadataResult>;
declare type DeployResult = {
id: string;
checkOnly: boolean;
completedDate: string;
createdDate: string;
details?: DeployDetails;
done: boolean;
errorMessage?: string;
errorStatusCode?: string;
ignoreWarnings?: boolean;
lastModifiedDate: string;
numberComponentErrors: number;
numberComponentsDeployed: number;
numberComponentsTotal: number;
numberTestErrors: number;
numberTestsCompleted: number;
numberTestsTotal: number;
rollbackOnError?: boolean;
startDate: string;
status: string;
success: boolean;
};
declare type DeployDetails = {
componentSuccesses: DeployMessage[];
componentFailures: DeployMessage[];
};
declare type DeployMessage = {
componentType: string;
fullName: string;
Id: string;
created: string;
deleted: string;
changed: string;
success: string;
};
declare type PostDeployOpts = HookOpts<DeployResult>;
declare type PreRetrieveOpts = HookOpts<{
packageXmlPath: string;
}>;
/**
* Extends OCLIF's Hooks interface to add types for hooks that run on sfdx source commands
*/
export interface SourceHooks extends Config.Hooks {
predeploy: PreDeployOpts;
postsourceupdate: PostSourceUpdateOpts;
postdeploy: PostDeployOpts;
postretrieve: PostRetriveOpts;
preretrieve: PreRetrieveOpts;
}
export declare type SourceHook<T> = (this: Config.Hook.Context, options: T extends keyof Config.Hooks ? SourceHooks[T] : T) => any;
export declare namespace SourceHook {
type PreDeploy = Config.Hook<SourceHooks['predeploy']>;
type PostSrConvert = Config.Hook<SourceHooks['postsourceupdate']>;
type PostDeploy = Config.Hook<SourceHooks['postdeploy']>;
type PostRetrieve = Config.Hook<SourceHooks['postretrieve']>;
type PreRetrieve = Config.Hook<SourceHooks['preretrieve']>;
}
export {};