UNPKG

3.02 kBTypeScriptView Raw
1import { Configuration } from "@atomist/automation-client/lib/configuration";
2import { HandlerContext } from "@atomist/automation-client/lib/HandlerContext";
3import { ProjectOperationCredentials } from "@atomist/automation-client/lib/operations/common/ProjectOperationCredentials";
4import { RemoteRepoRef } from "@atomist/automation-client/lib/operations/common/RepoId";
5import { AddressChannels } from "../../api/context/addressChannels";
6import { ParameterPromptFactory } from "../../api/context/parameterPrompt";
7import { PreferenceStore, PreferenceStoreFactory } from "../../api/context/preferenceStore";
8import { EnrichGoal } from "../../api/goal/enrichGoal";
9import { Goals } from "../../api/goal/Goals";
10import { SdmGoalMessage } from "../../api/goal/SdmGoalMessage";
11import { GoalImplementationMapper } from "../../api/goal/support/GoalImplementationMapper";
12import { GoalSetTag, TagGoalSet } from "../../api/goal/tagGoalSet";
13import { GoalsSetListener } from "../../api/listener/GoalsSetListener";
14import { PushListenerInvocation } from "../../api/listener/PushListener";
15import { GoalSetter } from "../../api/mapping/GoalSetter";
16import { ProjectLoader } from "../../spi/project/ProjectLoader";
17import { RepoRefResolver } from "../../spi/repo-ref/RepoRefResolver";
18import { PushFields } from "../../typings/types";
19/**
20 * Configuration for handling incoming pushes
21 */
22export interface ChooseAndSetGoalsRules {
23 projectLoader: ProjectLoader;
24 repoRefResolver: RepoRefResolver;
25 goalsListeners: GoalsSetListener[];
26 goalSetter: GoalSetter;
27 implementationMapping: GoalImplementationMapper;
28 enrichGoal?: EnrichGoal;
29 tagGoalSet?: TagGoalSet;
30 preferencesFactory?: PreferenceStoreFactory;
31 parameterPromptFactory?: ParameterPromptFactory<any>;
32}
33/**
34 * Choose and set goals for this push
35 * @param {ChooseAndSetGoalsRules} rules: configuration for handling incoming pushes
36 * @param parameters details of incoming request
37 * @return {Promise<Goals | undefined>}
38 */
39export declare function chooseAndSetGoals(rules: ChooseAndSetGoalsRules, parameters: {
40 context: HandlerContext;
41 credentials: ProjectOperationCredentials;
42 push: PushFields.Fragment;
43}): Promise<Goals | undefined>;
44export declare function determineGoals(rules: {
45 projectLoader: ProjectLoader;
46 repoRefResolver: RepoRefResolver;
47 goalSetter: GoalSetter;
48 implementationMapping: GoalImplementationMapper;
49 enrichGoal: EnrichGoal;
50 tagGoalSet?: TagGoalSet;
51}, circumstances: {
52 credentials: ProjectOperationCredentials;
53 id: RemoteRepoRef;
54 context: HandlerContext;
55 configuration: Configuration;
56 push: PushFields.Fragment;
57 addressChannels: AddressChannels;
58 preferences?: PreferenceStore;
59 goalSetId: string;
60}): Promise<{
61 determinedGoals: Goals | undefined;
62 goalsToSave: SdmGoalMessage[];
63 tags: GoalSetTag[];
64}>;
65export declare function planGoals(goals: Goals, pli: PushListenerInvocation): Promise<Goals>;
66//# sourceMappingURL=chooseAndSetGoals.d.ts.map
\No newline at end of file