Skip to content

Commit fa25429

Browse files
committed
Updated the SQL plugin's schema
1 parent a445dd6 commit fa25429

File tree

4 files changed

+237
-20
lines changed

4 files changed

+237
-20
lines changed

schema/definitions.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
"additionalProperties": false,
144144
"properties": {
145145
"custom": {
146-
"$ref": "plugin/custom.json"
146+
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/custom.json"
147147
}
148148
},
149149
"required": ["custom"]
@@ -153,7 +153,7 @@
153153
"additionalProperties": false,
154154
"properties": {
155155
"akeneo": {
156-
"$ref": "plugin/akeneo.json"
156+
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/akeneo.json"
157157
}
158158
},
159159
"required": ["akeneo"]
@@ -163,7 +163,7 @@
163163
"additionalProperties": false,
164164
"properties": {
165165
"sylius": {
166-
"$ref": "plugin/sylius.json"
166+
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/sylius.json"
167167
}
168168
},
169169
"required": ["sylius"]
@@ -173,7 +173,7 @@
173173
"additionalProperties": false,
174174
"properties": {
175175
"csv": {
176-
"$ref": "plugin/csv.json"
176+
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/csv.json"
177177
}
178178
},
179179
"required": ["csv"]
@@ -183,7 +183,7 @@
183183
"additionalProperties": false,
184184
"properties": {
185185
"spreadsheet": {
186-
"$ref": "plugin/spreadsheet.json"
186+
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/spreadsheet.json"
187187
}
188188
},
189189
"required": ["spreadsheet"]
@@ -193,7 +193,7 @@
193193
"additionalProperties": false,
194194
"properties": {
195195
"fastmap": {
196-
"$ref": "plugin/fastmap.json"
196+
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json"
197197
}
198198
},
199199
"required": ["fastmap"]
@@ -203,7 +203,7 @@
203203
"additionalProperties": false,
204204
"properties": {
205205
"stream": {
206-
"$ref": "plugin/stream.json"
206+
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/stream.json"
207207
}
208208
},
209209
"required": ["stream"]
@@ -213,7 +213,7 @@
213213
"additionalProperties": false,
214214
"properties": {
215215
"batch": {
216-
"$ref": "plugin/batch.json"
216+
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/batch.json"
217217
}
218218
},
219219
"required": ["batch"]
@@ -223,7 +223,7 @@
223223
"additionalProperties": false,
224224
"properties": {
225225
"ftp": {
226-
"$ref": "plugin/ftp.json"
226+
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/ftp.json"
227227
}
228228
},
229229
"required": ["ftp"]
@@ -233,7 +233,7 @@
233233
"additionalProperties": false,
234234
"properties": {
235235
"http": {
236-
"$ref": "plugin/http.json"
236+
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/http.json"
237237
}
238238
},
239239
"required": ["http"]
@@ -243,7 +243,7 @@
243243
"additionalProperties": false,
244244
"properties": {
245245
"sftp": {
246-
"$ref": "plugin/sftp.json"
246+
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/sftp.json"
247247
}
248248
},
249249
"required": ["sftp"]
@@ -253,7 +253,7 @@
253253
"additionalProperties": false,
254254
"properties": {
255255
"sql": {
256-
"$ref": "plugin/sql.json"
256+
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/sql.json"
257257
}
258258
},
259259
"required": ["sql"]
@@ -263,7 +263,7 @@
263263
"additionalProperties": false,
264264
"properties": {
265265
"json": {
266-
"$ref": "plugin/json.json"
266+
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/json.json"
267267
}
268268
},
269269
"required": ["json"]

schema/expressions.json

+15
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,21 @@
5454
{ "type": "number" }
5555
]
5656
},
57+
"expression-or-boolean": {
58+
"oneOf": [
59+
{ "$ref": "#/$defs/bundled-expression" },
60+
{ "type": "boolean" }
61+
]
62+
},
63+
"expression-or-any": {
64+
"oneOf": [
65+
{ "$ref": "#/$defs/bundled-expression" },
66+
{ "$ref": "#/$defs/datetime" },
67+
{ "type": "string" },
68+
{ "type": "number" },
69+
{ "type": "boolean" }
70+
]
71+
},
5772
"expression-or-datetime": {
5873
"oneOf": [
5974
{ "$ref": "#/$defs/bundled-expression" },

schema/plugin/akeneo.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,14 @@
121121
"type": "object",
122122
"additionalProperties": false,
123123
"properties": {
124-
"map": { "$ref": "fastmap.json#/$defs/fastmap-items" }
124+
"map": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" }
125125
}
126126
},
127127
{
128128
"type": "object",
129129
"additionalProperties": false,
130130
"properties": {
131-
"object": { "$ref": "fastmap.json#/$defs/fastmap-items" },
131+
"object": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" },
132132
"class": { "type": "string" }
133133
}
134134
}

schema/plugin/sql.json

+207-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,211 @@
33
"$id": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/sql.json",
44
"title": "SQL plugin for Middleware Satellite",
55
"description": "A Satellite is a micro-service aimed at managing data pipelines and data processing",
6-
"type": "object",
7-
"additionalProperties": false,
8-
"properties": {
9-
"expression_language": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/definitions.json#/$defs/expression_language" }
10-
}
6+
"$defs": {
7+
"connection": {
8+
"type": "object",
9+
"properties": {
10+
"dsn": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
11+
"username": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
12+
"password": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
13+
"persistent": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-boolean" },
14+
"shared": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-boolean" }
15+
}
16+
},
17+
"query-parameters": {
18+
"oneOf": [
19+
{
20+
"type": "object",
21+
"patternProperties": {
22+
".*": {
23+
"type": "object",
24+
"properties": {
25+
"oneOf": [
26+
{
27+
"type": "object",
28+
"properties": {
29+
"value": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-any" }
30+
}
31+
},
32+
{
33+
"type": "object",
34+
"properties": {
35+
"from": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/bundled-expression" }
36+
}
37+
}
38+
]
39+
}
40+
}
41+
}
42+
},
43+
{
44+
"type": "array",
45+
"items": {
46+
"type": "object",
47+
"properties": {
48+
"type": "object",
49+
"properties": {
50+
"value": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-any" }
51+
}
52+
}
53+
}
54+
}
55+
]
56+
},
57+
"query-list": {
58+
"type": "array",
59+
"items": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }
60+
}
61+
},
62+
"oneOf": [
63+
{
64+
"type": "object",
65+
"additionalProperties": false,
66+
"properties": {
67+
"expression_language": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/definitions.json#/$defs/expression_language" },
68+
"connection": { "$ref": "#/$defs/connection"},
69+
"before": { "$ref": "#/$defs/query-list"},
70+
"after": { "$ref": "#/$defs/query-list"},
71+
"extractor": {
72+
"oneOf": [
73+
{
74+
"type": "object",
75+
"properties": {
76+
"query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
77+
"parameters": { "$ref": "#/$defs/query-parameters"}
78+
}
79+
},
80+
{
81+
"type": "object",
82+
"properties": {
83+
"conditional": {
84+
"type": "array",
85+
"items": {
86+
"type": "object",
87+
"properties": {
88+
"condition":{ "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/bundled-expression" },
89+
"query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
90+
"parameters": { "$ref": "#/$defs/query-parameters"}
91+
}
92+
}
93+
}
94+
}
95+
}
96+
]
97+
}
98+
}
99+
},
100+
{
101+
"type": "object",
102+
"additionalProperties": false,
103+
"properties": {
104+
"expression_language": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/definitions.json#/$defs/expression_language" },
105+
"connection": { "$ref": "#/$defs/connection"},
106+
"before": { "$ref": "#/$defs/query-list"},
107+
"after": { "$ref": "#/$defs/query-list"},
108+
"lookup": {
109+
"oneOf": [
110+
{
111+
"type": "object",
112+
"properties": {
113+
"query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
114+
"parameters": { "$ref": "#/$defs/query-parameters"},
115+
"merge": {
116+
"oneOf": [
117+
{
118+
"type": "object",
119+
"additionalProperties": false,
120+
"properties": {
121+
"map": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" }
122+
}
123+
},
124+
{
125+
"type": "object",
126+
"additionalProperties": false,
127+
"properties": {
128+
"object": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" },
129+
"class": { "type": "string" }
130+
}
131+
}
132+
]
133+
}
134+
}
135+
},
136+
{
137+
"type": "object",
138+
"properties": {
139+
"conditional": {
140+
"type": "array",
141+
"items": {
142+
"type": "object",
143+
"properties": {
144+
"condition":{ "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/bundled-expression" },
145+
"query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
146+
"parameters": { "$ref": "#/$defs/query-parameters"},
147+
"merge": {
148+
"oneOf": [
149+
{
150+
"type": "object",
151+
"additionalProperties": false,
152+
"properties": {
153+
"map": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" }
154+
}
155+
},
156+
{
157+
"type": "object",
158+
"additionalProperties": false,
159+
"properties": {
160+
"object": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" },
161+
"class": { "type": "string" }
162+
}
163+
}
164+
]
165+
}
166+
}
167+
}
168+
}
169+
}
170+
}
171+
]
172+
}
173+
}
174+
},
175+
{
176+
"type": "object",
177+
"additionalProperties": false,
178+
"properties": {
179+
"expression_language": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/definitions.json#/$defs/expression_language" },
180+
"connection": { "$ref": "#/$defs/connection"},
181+
"before": { "$ref": "#/$defs/query-list"},
182+
"after": { "$ref": "#/$defs/query-list"},
183+
"loader": {
184+
"oneOf": [
185+
{
186+
"type": "object",
187+
"properties": {
188+
"query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
189+
"parameters": { "$ref": "#/$defs/query-parameters"}
190+
}
191+
},
192+
{
193+
"type": "object",
194+
"properties": {
195+
"conditional": {
196+
"type": "array",
197+
"items": {
198+
"type": "object",
199+
"properties": {
200+
"condition":{ "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/bundled-expression" },
201+
"query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
202+
"parameters": { "$ref": "#/$defs/query-parameters"}
203+
}
204+
}
205+
}
206+
}
207+
}
208+
]
209+
}
210+
}
211+
}
212+
]
11213
}

0 commit comments

Comments
 (0)