forked from redhat-developer/vscode-openshift-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomponentTypeDescription.ts
More file actions
152 lines (128 loc) · 2.89 KB
/
componentTypeDescription.ts
File metadata and controls
152 lines (128 loc) · 2.89 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/*-----------------------------------------------------------------------------------------------
* Copyright (c) Red Hat, Inc. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*-----------------------------------------------------------------------------------------------*/
export interface Ctx {
Fs: any;
}
export interface ForwardedPort {
containerName: string,
localAddress: string,
localPort: number,
containerPort: number,
}
export interface ComponentDescription {
devfilePath: string;
devfileData: {
devfile: Data;
supportedOdoFeatures: {
debug: boolean;
deploy: boolean;
dev: boolean;
}
}
devForwardedPorts: ForwardedPort[],
runningIn: string[];
managedBy: string;
}
export interface ComponentItem {
name: string;
container?: Container;
kubernetes?: Kubernetes;
};
export interface Data {
schemaVersion: string;
metadata: Metadata;
parent: Parent;
starterProjects: StarterProject[];
components: ComponentItem[];
commands: Command[];
events: Events;
}
export interface Metadata {
name: string;
version: string;
icon?: string;
projectType?: string;
displayName?: string;
language?: string;
description?: string;
tags?: string[];
}
export interface Parent {
kubernetes: Kubernetes;
}
export interface Kubernetes {
name: string;
}
export function isStarterProject(prj: any): prj is StarterProject {
return prj.name && (prj.git || prj.zip);
}
export interface StarterProject {
name: string;
git?: Git;
zip?: {
location: string;
}
description?: string;
typeName?: string;
}
export interface Git {
checkoutFrom?: {
remote: string;
}
remotes: Remotes;
}
export type Remotes = {[key: string]: string};
export interface ContainerItem {
name: string;
container: Container;
}
export interface KubernetesItem {
name: string;
kubernetes: Kubernetes;
}
export interface Container {
endpoints: Endpoint[];
image: string;
memoryLimit: string;
mountSources: boolean;
volumeMounts: VolumeMount[];
}
export interface Endpoint {
name: string;
targetPort: number;
}
export interface VolumeMount {
name: string;
path: string;
}
export interface Volume {
size: string;
}
export interface Command {
exec?: Exec;
composite?: Composite;
id: string;
}
export interface CommandProvider {
getCommand() : Command | undefined
}
export interface Exec {
commandLine: string;
component: string;
workingDir: string;
group?: Group;
hotReloadCapable?: boolean;
}
export type Composite = {
commands: string[];
group: Group;
}
export interface Group {
isDefault: boolean;
kind: string;
}
export interface Events {
postStart: string[];
}