-
-
Notifications
You must be signed in to change notification settings - Fork 192
/
Copy path.schema.yaml
197 lines (173 loc) · 4.18 KB
/
.schema.yaml
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
# Schema Definition for Collection Files
# Purpose:
# - Defines the structure and data types for collection YAML files.
# - Enhances IDE support with features like auto-completion and error checking.
# - Used for automated validation of YAML files to ensure data integrity.
$schema: 'https://json-schema.org/draft/2020-12/schema'
$ref: '#/definitions/Collection'
definitions:
Collection:
type: object
additionalProperties: false
properties:
os:
type: string
enum: [windows, macos, linux]
scripting:
$ref: '#/definitions/ScriptMetadata'
actions:
type: array
items:
$ref: '#/definitions/Category'
functions:
type: array
items:
$ref: '#/definitions/Function'
ScriptMetadata:
type: object
additionalProperties: false
required: [language, startCode, endCode]
properties:
language:
type: string
startCode:
type: string
endCode:
type: string
Category:
type: object
allOf:
- $ref: '#/definitions/ExecutableDefinition'
unevaluatedProperties: false
required: [children, category]
properties:
children:
type: array
items:
$ref: '#/definitions/Executable'
category:
type: string
Executable:
oneOf:
- $ref: '#/definitions/Category'
- $ref: '#/definitions/Script'
ExecutableDefinition:
allOf:
- $ref: '#/definitions/Documentable'
Script:
type: object
unevaluatedProperties: false
anyOf:
- $ref: '#/definitions/CodeScript'
- $ref: '#/definitions/CallScript'
RecommendationLevel:
oneOf:
- type: string
enum: [standard, strict]
- type: 'null'
ScriptDefinition:
type: object
allOf:
- $ref: '#/definitions/ExecutableDefinition'
required: [name]
properties:
name:
type: string
recommend:
$ref: '#/definitions/RecommendationLevel'
CodeScript:
type: object
unevaluatedProperties: false
anyOf:
- $ref: '#/definitions/ScriptDefinition'
- $ref: '#/definitions/CodeInstruction'
CallScript:
type: object
unevaluatedProperties: false
anyOf:
- $ref: '#/definitions/ScriptDefinition'
- $ref: '#/definitions/CallInstruction'
Documentable:
type: object
properties:
docs:
$ref: '#/definitions/Documentation'
Documentation:
unevaluatedProperties: false
oneOf:
- type: string
- type: array
items:
type: string
Function:
unevaluatedProperties: false
oneOf:
- $ref: '#/definitions/CodeFunction'
- $ref: '#/definitions/CallFunction'
FunctionDefinition:
type: object
required: [name]
properties:
name:
type: string
parameters:
type: array
items:
$ref: '#/definitions/ParameterDefinition'
docs:
type: string
ParameterDefinition:
required: [name]
unevaluatedProperties: false
properties:
name:
type: string
optional:
type: boolean
CodeFunction:
type: object
unevaluatedProperties: false
allOf:
- $ref: '#/definitions/FunctionDefinition'
- $ref: '#/definitions/CodeInstruction'
CallFunction:
type: object
unevaluatedProperties: false
allOf:
- $ref: '#/definitions/FunctionDefinition'
- $ref: '#/definitions/CallInstruction'
CodeInstruction:
type: object
required: [code]
properties:
code:
type: string
revertCode:
type: string
CallInstruction:
type: object
required: [call]
properties:
call:
$ref: '#/definitions/FunctionCalls'
FunctionCalls:
unevaluatedProperties: false
oneOf:
- $ref: '#/definitions/FunctionCall'
- type: array
items:
$ref: '#/definitions/FunctionCall'
FunctionCall:
type: object
required: [function]
unevaluatedProperties: false
properties:
function:
type: string
parameters:
$ref: '#/definitions/FunctionCallParameters'
FunctionCallParameters:
type: object
unevaluatedProperties: true
additionalProperties:
type: string