diff --git a/src/deployer.ts b/src/deployer.ts index 8dbae028c..5c5a0bf62 100644 --- a/src/deployer.ts +++ b/src/deployer.ts @@ -6,7 +6,7 @@ */ import { EventEmitter } from 'events'; -import { Dictionary, Nullable } from '@salesforce/ts-types'; +import { JsonMap, Nullable } from '@salesforce/ts-types'; import cli from 'cli-ux'; import { QuestionCollection } from 'inquirer'; import { Prompter } from './prompter'; @@ -15,7 +15,21 @@ export interface Preferences { interactive: boolean; } -export type Options = Dictionary; +export type DeployerOptions = JsonMap; + +/** + * This interface represents the aggregation of all deployer options, e.g. + * { + * 'Salesforce Apps': { + * testLevel: 'RunLocalTests', + * apps: ['force-app'], + * }, + * 'Salesforce Functions': { username: 'user@salesforce.com' }, + * } + */ +export interface ProjectDeployOptions { + [key: string]: T; +} export abstract class Deployable { abstract getAppName(): string; @@ -65,6 +79,11 @@ export abstract class Deployer extends EventEmitter { this.deployables = Object.assign([], deployables); } + /** + * The human readable name of the deployer + */ + public abstract getName(): string; + /** * Perform any initialization or setup. This is the time to prompt the * user for any needed information. It should do so by respecting the user's @@ -74,7 +93,7 @@ export abstract class Deployer extends EventEmitter { * * Uses the returned dictionary as the information to store in the project-deploy-options.json file. */ - public abstract setup(preferences: Preferences, options?: Dictionary): Promise>; + public abstract setup(preferences: Preferences, options: DeployerOptions): Promise; /** * Deploy the app. diff --git a/src/exported.ts b/src/exported.ts index b38a2bab2..409d4738a 100644 --- a/src/exported.ts +++ b/src/exported.ts @@ -6,5 +6,5 @@ */ export { generateTableChoices } from './util'; -export { Deployable, Deployer, Options, Preferences } from './deployer'; +export { Deployable, Deployer, ProjectDeployOptions, DeployerOptions, Preferences } from './deployer'; export { Prompter } from './prompter';