-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule-schema.json
More file actions
337 lines (337 loc) · 14.7 KB
/
Copy pathmodule-schema.json
File metadata and controls
337 lines (337 loc) · 14.7 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
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Flightcontrol Module Schema",
"description": "Defines a Flightcontrol module's inputs (form fields), outputs (exported values), and UI configuration (links, logs, metrics).",
"type": "object",
"required": ["inputs"],
"additionalProperties": false,
"properties": {
"inputs": {
"type": "array",
"description": "Array of input property definitions. Each item is an object with exactly one key (the property name) mapping to an InputProperty.",
"items": { "$ref": "#/$defs/PropertyDefinition" }
},
"output": {
"$ref": "#/$defs/ModuleOutput",
"description": "Optional output configuration mapping variable names to values."
},
"ui": {
"$ref": "#/$defs/ModuleUI",
"description": "Optional UI configuration for links, logs, and metrics."
}
},
"$defs": {
"PropertyDefinition": {
"type": "object",
"description": "A record with exactly one key (the property name) mapping to an InputProperty value. Example: { \"region\": { \"type\": \"string\", \"label\": \"Region\" } }",
"additionalProperties": { "$ref": "#/$defs/InputProperty" }
},
"InputProperty": {
"oneOf": [
{ "$ref": "#/$defs/StringInputProperty" },
{ "$ref": "#/$defs/TextInputProperty" },
{ "$ref": "#/$defs/JsonInputProperty" },
{ "$ref": "#/$defs/ArrayStringInputProperty" },
{ "$ref": "#/$defs/NumberInputProperty" },
{ "$ref": "#/$defs/BooleanInputProperty" },
{ "$ref": "#/$defs/DividerInputProperty" },
{ "$ref": "#/$defs/CompoundInputProperty" },
{ "$ref": "#/$defs/RefInputProperty" }
],
"description": "Discriminated union of all input property types. Discriminated by the 'type' field."
},
"ShowWhenValue": {
"anyOf": [
{ "type": "string" },
{ "type": "integer" },
{ "type": "boolean" }
]
},
"ShowWhen": {
"type": "object",
"description": "Conditional visibility. Keys are property names, values are expected values. Property is shown only when all conditions are met.",
"additionalProperties": { "$ref": "#/$defs/ShowWhenValue" }
},
"ValidationPattern": {
"type": "object",
"required": ["pattern", "message"],
"additionalProperties": false,
"properties": {
"pattern": { "type": "string", "description": "Regex pattern to match against the input value" },
"message": { "type": "string", "description": "Error message when pattern doesn't match" }
}
},
"StringValueItem": {
"type": "object",
"required": ["value"],
"additionalProperties": false,
"properties": {
"label": { "type": "string" },
"description": { "type": "string" },
"group_label": { "type": "string" },
"value": { "type": "string" }
}
},
"NumberValueItem": {
"type": "object",
"required": ["value"],
"additionalProperties": false,
"properties": {
"label": { "type": "string" },
"description": { "type": "string" },
"group_label": { "type": "string" },
"value": { "type": "integer" }
}
},
"DynamicValuesRef": {
"type": "string",
"description": "Dynamic values reference. Must start with \"$values:\" prefix, e.g. \"$values:regions\"."
},
"StringValues": {
"anyOf": [
{ "type": "array", "items": { "$ref": "#/$defs/StringValueItem" } },
{ "$ref": "#/$defs/DynamicValuesRef" }
]
},
"NumberValues": {
"anyOf": [
{ "type": "array", "items": { "$ref": "#/$defs/NumberValueItem" } },
{ "$ref": "#/$defs/DynamicValuesRef" }
]
},
"CompoundFieldValue": {
"anyOf": [
{ "type": "string" },
{ "type": "integer" },
{ "type": "boolean" },
{ "type": "array", "items": { "type": "string" } }
]
},
"CompoundValueItem": {
"type": "object",
"description": "A compound option with arbitrary data fields plus optional display metadata (label, description, group_label).",
"properties": {
"label": { "type": "string" },
"description": { "type": "string" },
"group_label": { "type": "string" }
},
"additionalProperties": { "$ref": "#/$defs/CompoundFieldValue" }
},
"CompoundValues": {
"anyOf": [
{ "type": "array", "items": { "$ref": "#/$defs/CompoundValueItem" } },
{ "$ref": "#/$defs/DynamicValuesRef" }
]
},
"RefTypeDiscriminator": {
"type": "string",
"pattern": "^\\$ref:.+$",
"minLength": 6,
"description": "Module reference type. Format: \"$ref:<module-type>\", e.g. \"$ref:ravion-aws-vpc\"."
},
"StringInputProperty": {
"type": "object",
"required": ["label", "type"],
"additionalProperties": false,
"properties": {
"type": { "type": "string", "const": "string" },
"label": { "type": "string", "minLength": 1 },
"description": { "type": "string" },
"immutable": { "type": "boolean", "default": false },
"moved_from": { "type": "array", "items": { "type": "string" }, "description": "Input IDs from earlier module versions whose values this input now holds. Upgrading an existing instance does not trip the immutable input check for the listed inputs or for this one." },
"show_when": { "$ref": "#/$defs/ShowWhen" },
"default": { "type": "string" },
"placeholder": { "type": "string" },
"required": { "type": "boolean", "default": false },
"values": { "$ref": "#/$defs/StringValues" },
"patterns": { "type": "array", "items": { "$ref": "#/$defs/ValidationPattern" } },
"min_current_value": { "type": "boolean", "default": false }
}
},
"TextInputProperty": {
"type": "object",
"required": ["label", "type"],
"additionalProperties": false,
"properties": {
"type": { "type": "string", "const": "text" },
"label": { "type": "string", "minLength": 1 },
"description": { "type": "string" },
"immutable": { "type": "boolean", "default": false },
"moved_from": { "type": "array", "items": { "type": "string" }, "description": "Input IDs from earlier module versions whose values this input now holds. Upgrading an existing instance does not trip the immutable input check for the listed inputs or for this one." },
"show_when": { "$ref": "#/$defs/ShowWhen" },
"default": { "type": "string" },
"placeholder": { "type": "string" },
"required": { "type": "boolean", "default": false },
"patterns": { "type": "array", "items": { "$ref": "#/$defs/ValidationPattern" } }
}
},
"JsonInputProperty": {
"type": "object",
"required": ["label", "type"],
"additionalProperties": false,
"properties": {
"type": { "type": "string", "const": "json" },
"label": { "type": "string", "minLength": 1 },
"description": { "type": "string" },
"immutable": { "type": "boolean", "default": false },
"moved_from": { "type": "array", "items": { "type": "string" }, "description": "Input IDs from earlier module versions whose values this input now holds. Upgrading an existing instance does not trip the immutable input check for the listed inputs or for this one." },
"show_when": { "$ref": "#/$defs/ShowWhen" },
"default": { "description": "Default JSON value (any valid JSON)" },
"placeholder": { "type": "string" },
"required": { "type": "boolean", "default": false }
}
},
"ArrayStringInputProperty": {
"type": "object",
"required": ["label", "type"],
"additionalProperties": false,
"properties": {
"type": { "type": "string", "const": "string_array" },
"label": { "type": "string", "minLength": 1 },
"description": { "type": "string" },
"immutable": { "type": "boolean", "default": false },
"moved_from": { "type": "array", "items": { "type": "string" }, "description": "Input IDs from earlier module versions whose values this input now holds. Upgrading an existing instance does not trip the immutable input check for the listed inputs or for this one." },
"show_when": { "$ref": "#/$defs/ShowWhen" },
"default": { "type": "array", "items": { "type": "string" } },
"placeholder": { "type": "string" },
"add_button_label": { "type": "string" },
"required": { "type": "boolean", "default": false },
"patterns": { "type": "array", "items": { "$ref": "#/$defs/ValidationPattern" } }
}
},
"NumberInputProperty": {
"type": "object",
"required": ["label", "type"],
"additionalProperties": false,
"properties": {
"type": { "type": "string", "const": "number" },
"label": { "type": "string", "minLength": 1 },
"description": { "type": "string" },
"immutable": { "type": "boolean", "default": false },
"moved_from": { "type": "array", "items": { "type": "string" }, "description": "Input IDs from earlier module versions whose values this input now holds. Upgrading an existing instance does not trip the immutable input check for the listed inputs or for this one." },
"show_when": { "$ref": "#/$defs/ShowWhen" },
"default": { "type": "integer" },
"placeholder": { "type": "string" },
"required": { "type": "boolean", "default": false },
"values": { "$ref": "#/$defs/NumberValues" },
"min": { "type": "integer" },
"max": { "type": "integer" },
"min_current_value": { "type": "boolean", "default": false }
}
},
"BooleanInputProperty": {
"type": "object",
"required": ["label", "type"],
"additionalProperties": false,
"properties": {
"type": { "type": "string", "const": "boolean" },
"label": { "type": "string", "minLength": 1 },
"description": { "type": "string" },
"immutable": { "type": "boolean", "default": false },
"moved_from": { "type": "array", "items": { "type": "string" }, "description": "Input IDs from earlier module versions whose values this input now holds. Upgrading an existing instance does not trip the immutable input check for the listed inputs or for this one." },
"show_when": { "$ref": "#/$defs/ShowWhen" },
"default": { "type": "boolean" }
}
},
"DividerInputProperty": {
"type": "object",
"required": ["label", "type"],
"additionalProperties": false,
"properties": {
"type": { "type": "string", "const": "divider" },
"label": { "type": "string", "minLength": 1 }
}
},
"CompoundInputProperty": {
"type": "object",
"required": ["label", "type", "fields"],
"additionalProperties": false,
"properties": {
"type": { "type": "string", "const": "compound" },
"label": { "type": "string", "minLength": 1 },
"description": { "type": "string" },
"immutable": { "type": "boolean", "default": false },
"moved_from": { "type": "array", "items": { "type": "string" }, "description": "Input IDs from earlier module versions whose values this input now holds. Upgrading an existing instance does not trip the immutable input check for the listed inputs or for this one." },
"show_when": { "$ref": "#/$defs/ShowWhen" },
"fields": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Field names to expose from the selected compound value" },
"default": { "type": "object", "additionalProperties": { "$ref": "#/$defs/CompoundFieldValue" } },
"required": { "type": "boolean", "default": false },
"values": { "$ref": "#/$defs/CompoundValues" },
"min_current_value": { "type": "boolean", "default": false }
}
},
"RefInputProperty": {
"type": "object",
"required": ["label", "type", "mapping"],
"additionalProperties": false,
"properties": {
"type": { "$ref": "#/$defs/RefTypeDiscriminator", "description": "Format: \"$ref:<module-type>\", e.g. \"$ref:ravion-aws-vpc\"" },
"label": { "type": "string", "minLength": 1 },
"description": { "type": "string" },
"immutable": { "type": "boolean", "default": false },
"moved_from": { "type": "array", "items": { "type": "string" }, "description": "Input IDs from earlier module versions whose values this input now holds. Upgrading an existing instance does not trip the immutable input check for the listed inputs or for this one." },
"show_when": { "$ref": "#/$defs/ShowWhen" },
"mapping": {
"type": "object",
"additionalProperties": { "type": "string" },
"description": "Maps field names to values. Values can be static strings or dynamic references using << >> syntax, e.g. \"<< instance.output.vpc_id >>\"."
},
"required": { "type": "boolean", "default": false }
}
},
"ModuleOutput": {
"type": "object",
"description": "Record mapping output variable names to values (string, boolean, or string[]).",
"additionalProperties": {
"anyOf": [
{ "type": "string" },
{ "type": "boolean" },
{ "type": "array", "items": { "type": "string" } }
]
}
},
"ModuleUI": {
"type": "object",
"additionalProperties": false,
"properties": {
"links": {
"type": "array",
"items": {
"type": "object",
"required": ["name", "href"],
"additionalProperties": false,
"properties": {
"name": { "type": "string", "minLength": 1 },
"href": { "type": "string", "description": "URL, supports << output.xxx >> template syntax" }
}
}
},
"logs": {
"type": "array",
"items": {
"type": "object",
"required": ["name", "log_stream_name"],
"additionalProperties": false,
"properties": {
"name": { "type": "string", "minLength": 1 },
"log_stream_name": { "type": "string", "description": "CloudWatch log stream name, supports << output.xxx >> template syntax" }
}
}
},
"metrics": {
"type": "array",
"items": {
"type": "object",
"required": ["name", "type", "cloudwatch_metric"],
"additionalProperties": false,
"properties": {
"name": { "type": "string", "minLength": 1 },
"type": { "type": "string", "const": "line" },
"cloudwatch_metric": { "type": "string", "description": "CloudWatch metric reference, supports << output.xxx >> template syntax" }
}
}
}
}
}
}
}