UNPKG

1.48 kBTypeScriptView Raw
1import { HandlerContext } from "@atomist/automation-client/lib/HandlerContext";
2import { ParameterType } from "@atomist/automation-client/lib/SmartParameters";
3import { CommandRegistration } from "../../../api/registration/CommandRegistration";
4export declare enum JobTaskType {
5 Command = "command"
6}
7export interface JobTask<T extends ParameterType> {
8 type: JobTaskType;
9 parameters: T;
10}
11/**
12 * Details of the job to create
13 */
14export interface JobDetails<T extends ParameterType> {
15 command: string | CommandRegistration<T>;
16 registration?: string;
17 parameters: T | T[];
18 name?: string;
19 description?: string;
20 /** Optional maximum number of concurrent tasks; defaults to running all tasks in parallel */
21 concurrentTasks?: number;
22}
23/**
24 * Create a Job in the backend with the provided name and tasks
25 *
26 * A job can execute any registered command in the same or other connected SDM:
27 *
28 * command: name of the CommandRegistration or the registration instance itself
29 * registration: optional name of the SDM this job should be send to; defaults to the current SDM
30 * parameters: Record type with all required parameters for this command
31 * name: optional name of the job
32 * description: optional description of the job used to display to the user in chat or web
33 */
34export declare function createJob<T extends ParameterType>(details: JobDetails<T>, ctx: HandlerContext): Promise<{
35 id: string;
36}>;
37//# sourceMappingURL=createJob.d.ts.map
\No newline at end of file