import { WebmateAPISession } from "../webmate-api-session"; import { JobConfigName, JobId, JobRunId, ProjectId } from "../types"; import { WellKnownJobInput } from "./well-known-job-input"; import { Observable } from "rxjs"; import { List } from "immutable"; import { JobRunSummary } from "./job-run-summary"; /** * Facade to webmate's JobEngine subsystem. */ export declare class JobEngine { private session; private apiClient; constructor(session: WebmateAPISession); /** * Create a new webmate Job and directly start a new JobRun for this Job. * * @param jobConfigName Name of new JobConfig. * @param nameForJobInstance Name describing JobRun. * @param inputValues Input values for Job. * @param projectId ProjectId of Project where Job should be started in. * @return Id of new JobRun */ startJob(jobConfigName: JobConfigName, nameForJobInstance: string, inputValues: Object, projectId: ProjectId): Observable; /** * Create a new webmate Job and directly start a new JobRun for this Job. * * @param nameForJobInstance Name describing JobRun. * @param input Configuration of one of webmate well-known Jobs, e.g. CrossbrowserLayoutAnalysis. * @param projectId ProjectId of Project where Job should be started in. * @return Id of new JobRun */ startKnownJob(nameForJobInstance: string, input: WellKnownJobInput, projectId: ProjectId): Observable; /** * Start a Job which already exists. (i.e. to run a Job again). * * @param id Id of the Job to run. * @return The id of the JobRun that was created */ startExistingJob(jobId: JobId): Observable; /** * Return list of JobRunIds for the given JobId. * * @param jobId Id of Job, for which JobRuns should be retrieved. * @return List of JobRun ids */ getJobRunsForJob(jobId: JobId): Observable>; /** * Get the current state summary of the JobRun with the given JobRunId. * * @param jobRunId Id of the JobRun for which the current state should be retrieved. * @return Summary of the current state of the JobRun */ getSummaryOfJobRun(jobRunId: JobRunId): Observable; /** * Get all existing jobs in the specified project. * * @param projectId id of the project that jobs should be retrieved for. * @return List of Job ids */ getJobsInProject(projectId: ProjectId): Observable>; }