-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtypes.ts
More file actions
106 lines (100 loc) · 2.23 KB
/
types.ts
File metadata and controls
106 lines (100 loc) · 2.23 KB
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
100
101
102
103
104
105
106
export interface IStep {
projectName: string;
component: string;
props: Record<string, any>;
vars?: Record<string, any>;
actions?: Record<string, any>;
order: number;
access: string | undefined;
flowId?: number;
allow_failure?: boolean | IAllowFailure;
credential: Record<string, any>;
}
export enum IHookType {
PRE = 'pre',
SUCCESS = 'success',
FAIL = 'fail',
COMPLETE = 'complete',
POST = 'post',
}
export enum IActionType {
RUN = 'run',
PLUGIN = 'plugin',
COMPONENT = 'component',
}
export interface IRunAction {
hookType: `${IHookType}`;
actionType: IActionType.RUN;
value: string;
path: string;
level: `${IActionLevel}`;
projectName: string;
allow_failure?: boolean | IAllowFailure;
}
export interface IPluginAction {
hookType: `${IHookType}`;
actionType: IActionType.PLUGIN;
value: string;
args?: Record<string, any>;
level: `${IActionLevel}`;
projectName: string;
allow_failure?: boolean | IAllowFailure;
replace_output?: boolean;
}
export interface IComponentAction {
hookType: `${IHookType}`;
actionType: IActionType.COMPONENT;
value: string;
level: `${IActionLevel}`;
projectName: string;
allow_failure?: boolean | IAllowFailure;
}
export type IAction = IRunAction | IPluginAction | IComponentAction;
export interface IAllowFailure {
exit_code?: number[];
command?: string[];
}
export enum IActionLevel {
PROJECT = 'Project',
GLOBAL = 'Global',
}
export interface IYaml {
path: string;
appName: string;
content: Record<string, any>;
use3x: boolean;
projectNames: string[];
extend?: string;
useExtend?: boolean;
vars?: Record<string, any>;
actions?: IAction[];
access?: string;
flow?: Record<string, any>;
template?: Record<string, any>;
useFlow?: boolean;
projects?: Record<string, any>;
environment?: Record<string, any>;
}
export type ISpec = IRecord & {
steps: IStep[];
yaml: IYaml;
allSteps?: IStep[];
};
export interface IRecord {
projectName?: string;
command?: string;
access?: string;
version?: string;
output?: `${IOutput}`;
skipActions?: boolean;
help?: boolean;
debug?: boolean;
env?: string;
baselineTemplate?: string;
}
export enum IOutput {
DEFAULT = 'default',
JSON = 'json',
YAML = 'yaml',
RAW = 'raw',
}