-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
99 lines (97 loc) · 2.41 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// istanbul ignore file - No point in testing types
import { CliArgs } from "./parseArgs";
export type RunConfig = CliArgs & {
fetchInterval: number;
};
export const CircleAPIPipelineState = [
"created",
"errored",
"setup-pending",
"setup",
"pending",
] as const;
export type CircleAPIPipeline = {
id: string; // uuid
errors: string[];
project_slug: string;
updated_at: string; // yyyy-mm-ddThh:mm:ss:SSSz
number: number; // not sure what this is
state: typeof CircleAPIPipelineState[number];
created_at: string; // yyyy-mm-ddThh:mm:ss:SSSz
// trigger: {};
vcs: {
origin_repository_url: string;
target_repositry_url: string;
revision: string;
provider_name: string; // Always Github?
commit?: {
body: string;
subject: string;
};
branch: string;
};
};
export type Pipeline = Pick<CircleAPIPipeline, "id" | "number"> & {
commit: string;
};
export const CircleApiWorkflowStatus = [
"success",
"running",
"not_run",
"failed",
"error",
"failing",
"on_hold",
"canceled",
"unauthorized",
] as const;
export type CircleAPIWorkflow = {
pipeline_id: string;
id: string;
name: string;
project_slug: string;
status: typeof CircleApiWorkflowStatus[number];
started_by: string; // yyyy-mm-ddThh:mm:ss:SSSz
created_at: string; // yyyy-mm-ddThh:mm:ss:SSSz
stopped_at: string | null; // yyyy-mm-ddThh:mm:ss:SSSz
pipeline_number: number;
};
export type Workflow = Pick<CircleAPIWorkflow, "id"> & {
commit: string;
pipelineNumber: number;
};
export type CircleAPIJob = {
dependencies: string[];
job_number: number;
id: string; //uuid
started_at: string; // yyyy-mm-ddThh:mm:ss:SSSz
name: string;
project_slug: string;
type: string;
status:
| "success"
| "running"
| "not_run"
| "failed"
| "retried"
| "queued"
| "not_running"
| "infrastructure_fail"
| "timedout"
| "on_hold"
| "terminated-unknown"
| "blocked"
| "canceled"
| "unauthorized";
stopped_at: string | null; // yyyy-mm-ddThh:mm:ss:SSSz
};
export type Job = Pick<CircleAPIJob, "name" | "status" | "job_number"> & {
statusEmoji: string;
commit: string;
pipeline: {
number: number;
};
workflow: {
id: string;
};
};