UNPKG

1.88 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 "./addressChannels";
6import { PreferenceStore } from "./preferenceStore";
7import { SkillContext } from "./skillContext";
8/**
9 * Context for an SDM action, whether a listener invocation or internal action
10 */
11export interface SdmContext {
12 /**
13 * Context of the Atomist EventHandler invocation. Use to run GraphQL
14 * queries, use the messageClient directly and find
15 * the team and correlation id
16 */
17 context: HandlerContext;
18 /**
19 * Provides a way to address the channel(s) related to this action:
20 * usually, an event or command invocation.
21 * In an event handler, these are usually the channel(s) linked to a repo.
22 * In a command handler, the behavior will be the same as that of `MessageClient.respond`.
23 * In some cases, such as repo creation or a push to a repo where there is no linked channel,
24 * addressChannels will go to dev/null without error.
25 */
26 addressChannels: AddressChannels;
27 /**
28 * Credentials for use with source control hosts such as GitHub
29 */
30 credentials: ProjectOperationCredentials;
31 /**
32 * Store and retrieve preferences for this SDM or team
33 */
34 preferences: PreferenceStore;
35 configuration: Configuration;
36 skill: SkillContext;
37}
38/**
39 * Context for an SDM action on a particular repo
40 */
41export interface RepoContext extends SdmContext {
42 /**
43 * The repo this relates to
44 */
45 id: RemoteRepoRef;
46}
47//# sourceMappingURL=SdmContext.d.ts.map
\No newline at end of file