/
metadata.ts
230 lines (217 loc) · 5.82 KB
/
metadata.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
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
import {
CloudVendor,
SubtypeAware,
ToolingLanguage,
ToolingRuntime,
TypeAware,
} from './domain';
/**
* Interface that offers an optional icon field.
* This is normally a valid URL pointing to the icon file publicly available on the web; alternative formats such as Font Awesome can be supported later.
*
* @group For both project creators and package authors
*/
export interface OptionalIconAware {
icon?: string;
}
/**
* Interface that offers an optional description field.
* This is normally in plain text; markdown can be used too.
*/
export interface OptionalDescAware {
description?: string;
}
/**
* Interface that offers support information about the package.
*
* @group For both project creators and package authors
*/
export interface SupportInfo {
/**
* The URL to the support site of the package.
*/
url?: string;
/**
* The support email address of the package.
*/
email?: string;
/**
* The support phone number of the package.
*/
phone?: string;
}
/**
* Interface that offers information about IaC tooling.
*
* @group For both project creators and package authors
*/
export interface ToolingInfo {
/**
* The shell command to run deployment with the package.
*/
command: string;
/**
* The supported IaC runtime.
*/
runtime: ToolingRuntime;
/**
* The supported IaC language.
*/
language: ToolingLanguage;
/**
* The supported cloud vendors.
* Usually a package chooses support one vendor but some choose to have multiple-vendor support.
*/
vendors: CloudVendor[];
}
/**
* Interface that represents a typing classification for components.
*
* @group For both project creators and package authors
*/
export interface ComponentType
extends TypeAware,
SubtypeAware,
OptionalIconAware,
OptionalDescAware {}
/**
* Interface that represents a typing classification for services.
* In particular, it contains a field for deployment instructions for the type of services defined.
*
* @group For both project creators and package authors
*/
export interface ServiceType
extends TypeAware,
SubtypeAware,
OptionalIconAware,
OptionalDescAware {
deployment: string;
}
/**
* Interface that represents information about network construct.
*
* @group For both project creators and package authors
*/
export interface NetworkInfo extends OptionalIconAware, OptionalDescAware {}
/**
* Interface that represents information about available component constructs.
*
* @group For both project creators and package authors
*/
export interface ComponentsInfo extends OptionalIconAware, OptionalDescAware {
/**
* Available types and subtypes for components.
*/
types: { [key: string]: ComponentType };
}
/**
* Interface that represents information about available service constructs.
*
* @group For both project creators and package authors
*/
export interface ServicesInfo extends OptionalIconAware, OptionalDescAware {
/**
* Available types and subtypes for services.
*/
types: { [key: string]: ServiceType };
}
/**
* Interface that represents information about available relation constructs.
* It relies on the typing definitions in both {@link ComponentInfo} and {@link ServicesInfo}.
*
* @group For both project creators and package authors
*/
export interface RelationsInfo extends OptionalIconAware, OptionalDescAware {
/**
* Available relations between a specific component/service and another component/service.
* Both the key and value here refer to the entries defined in `components` and `services` fields.
*/
types: { [key: string]: string };
}
/**
* Interface that represents information about custom (code blocks) construct.
* Most notably it includes a reference to the code template.
*
* @group For both project creators and package authors
*/
export interface CustomInfo extends OptionalIconAware, OptionalDescAware {
template: string;
}
/**
* Interface that represents information about custom (code blocks) construct.
* Most notably it includes a reference to the code template.
*
* @group For both project creators and package authors
*/
export interface ConstructsInfo {
/**
* The reference to the json schema file for creating a valid json config when using the package.
*/
schema: string;
/**
* Information about network.
*/
network: NetworkInfo;
/**
* Information about components.
*/
components: ComponentsInfo;
/**
* Information about services.
*/
services: ServicesInfo;
/**
* Information about relations.
*/
relations: RelationsInfo;
/**
* Information about custom (code blocks).
*/
custom: CustomInfo;
}
/**
* Interface for modelling a package manifest json file that provides informations about the package.
* Crucially it also carries two references respectively to a) a json schema file for validating json config files and b) a template file for custom code blocks.
*
* @group For both project creators and package authors
*/
export interface PackageManifest extends OptionalIconAware {
/**
* The descriptive name of the package.
*/
name?: string;
/**
* The unique identifier of the package.
*/
identifier: string;
/**
* The author of the package.
*/
vendor: string;
/**
* The SPDX license identifier for the license that the package is released under.
*
* @see [SPDX](https://spdx.org/licenses/)
*/
license: string;
/**
* The description of the package.
*/
description?: string;
/**
* Information about the support provided for the package.
*/
support?: SupportInfo;
/**
* The version of OpenFABR CDF that this package is compatible with, following semantic versioning.
*/
cdf: string;
/**
* Information about tooling the package relies on.
*/
tooling: ToolingInfo;
/**
* Information about constructs defined in the package.
*/
constructs: ConstructsInfo;
}