import { Configuration, ConfigurationPostProcessor } from "@atomist/automation-client"; import { Goal, GoalContribution, Goals, GoalWithFulfillment, PushListenerInvocation, PushTest, SdmContext, SoftwareDeliveryMachine } from "@atomist/sdm"; import { ConfigureOptions } from "../internal/machine/configureSdm"; import { LocalSoftwareDeliveryMachineConfiguration } from "../internal/machine/LocalSoftwareDeliveryMachineOptions"; /** * Data structure to configure goal contributions */ export interface GoalStructure { /** * Optional push tests to determine when to schedule provided goals * * If an array of push tests is provided, they will get wrapped with allSatisfied/and. */ test?: PushTest | PushTest[]; /** Optional pre conditions for goals; can be actual goal instances or names of goal contributions */ dependsOn?: string | Goal | Array; /** * Goal instances to schedule * * The following cases are supported: * * goals: [ * autofix, * build * ] * * This means autofix will run after build * * goals: [ * [autofix, build] * ] * * This will schedule autofix and build concurrently * * goals: [ * [autofix, build], * dockerBuild * ] * * This will schedule autofix and build concurrently and dockerBuild once autofix and build are completed */ goals: Goal | Goals | Array>; } /** * Type to collect named GoalStructure instances * * The record key will be used to name the goal contribution. */ export declare type GoalData = Record; /** * Type to collect goal instances for this SDM */ export declare type DeliveryGoals = Record; /** * @deprecated use DeliveryGoals */ export declare type AllGoals = DeliveryGoals; /** * Type to create goal instances for this SDM */ export declare type GoalCreator = (sdm: SoftwareDeliveryMachine) => Promise; /** * Type to configure provided goals with fulfillments, listeners etc */ export declare type GoalConfigurer = (sdm: SoftwareDeliveryMachine, goals: G) => Promise; /** * Type to orchestrate the creation and configuration of goal instances for this SDM */ export declare type CreateGoals = (creator: GoalCreator, configurers?: GoalConfigurer | Array>) => Promise; /** * Configure a SoftwareDeliveryMachine instance by adding command, events etc and optionally returning * GoalData, an array of GoalContributions or void when no goals should be added to this SDM. */ export declare type Configurer = (sdm: SoftwareDeliveryMachine & { createGoals: CreateGoals; }) => Promise>>; /** * Process the configuration before creating the SDM instance */ export declare type ConfigurationPreProcessor = (cfg: LocalSoftwareDeliveryMachineConfiguration) => Promise; export interface ConfigureMachineOptions extends ConfigureOptions { /** * SDM name if you want to override the default which uses the * package name. */ name?: string; /** * These functions are called in the first postProcessor. * Specifically, the first post-processor is [[configureSdm]] * these functions are called in its * [[SoftwareDeliveryMachineMaker]] function prior to it calling * the [[createSoftwareDeliveryMachine]]. */ preProcessors?: ConfigurationPreProcessor | ConfigurationPreProcessor[]; /** * These functions are called after the [[configureSdm]] post-processor. */ postProcessors?: ConfigurationPostProcessor | ConfigurationPostProcessor[]; } /** * Function to create an SDM configuration constant to be exported from an index.ts/js. */ export declare function configure(configurer: Configurer, options?: ConfigureMachineOptions): Configuration; /** * Convert the provided GoalData instance into an array of GoalContributions */ export declare function convertGoalData(goalData: GoalData): Array>; /** * Invoke the given configurer */ export declare function invokeConfigurer(sdm: SoftwareDeliveryMachine, configurer: Configurer): Promise>>; //# sourceMappingURL=configure.d.ts.map