UNPKG

2.73 kBTypeScriptView Raw
1import { BaseRequestOptions, BaseService, PaginatedRequestOptions, Sudo } from '../infrastructure';
2import { CommitSchema } from './Commits';
3import { PipelineSchema } from './Pipelines';
4import { RunnerSchema } from './Runners';
5import { UserSchema } from './Users';
6export declare type JobScope = 'created' | 'pending' | 'running' | 'failed' | 'success' | 'canceled' | 'skipped' | 'manual';
7export interface ArtifactSchema {
8 file_type: string;
9 size: number;
10 filename: string;
11 file_format?: string;
12}
13export interface JobSchema {
14 id: number;
15 status: string;
16 stage: string;
17 name: string;
18 ref: string;
19 tag: boolean;
20 coverage?: string;
21 allow_failure: boolean;
22 created_at: Date;
23 started_at?: Date;
24 finished_at?: Date;
25 duration?: number;
26 user: UserSchema;
27 commit: CommitSchema;
28 pipeline: PipelineSchema;
29 web_url: string;
30 artifacts: ArtifactSchema[];
31 runner: RunnerSchema;
32 artifacts_expire_at?: Date;
33}
34export declare class Jobs extends BaseService {
35 all(projectId: string | number, options?: PaginatedRequestOptions): Promise<import("../infrastructure").GetResponse>;
36 cancel(projectId: string | number, jobId: number, options?: Sudo): Promise<object>;
37 downloadSingleArtifactFile(projectId: string | number, jobId: number, artifactPath: string, { stream, ...options }: {
38 stream?: boolean;
39 } & BaseRequestOptions): any;
40 downloadSingleArtifactFileFromRef(projectId: string | number, ref: string, artifactPath: string, name: string, { stream, ...options }: {
41 stream?: boolean;
42 } & BaseRequestOptions): any;
43 downloadLatestArtifactFile(projectId: string | number, ref: string, name: string, { stream, ...options }: {
44 stream?: boolean;
45 } & BaseRequestOptions): any;
46 downloadTraceFile(projectId: string | number, jobId: number, options?: Sudo): Promise<import("../infrastructure").GetResponse>;
47 erase(projectId: string | number, jobId: number, options?: Sudo): Promise<object>;
48 eraseArtifacts(projectId: string | number, jobId: number, options?: Sudo): Promise<object>;
49 keepArtifacts(projectId: string | number, jobId: number, options?: Sudo): Promise<object>;
50 play(projectId: string | number, jobId: number, options?: Sudo): Promise<object>;
51 retry(projectId: string | number, jobId: number, options?: Sudo): Promise<object>;
52 show(projectId: string | number, jobId: number, options?: Sudo): Promise<import("../infrastructure").GetResponse>;
53 showPipelineJobs(projectId: string | number, pipelineId: number, options?: {
54 scope?: JobScope;
55 } & Sudo): Promise<import("../infrastructure").GetResponse>;
56}