diff --git a/schema/definitions.json b/schema/definitions.json index c4b72d32..2f2c68da 100644 --- a/schema/definitions.json +++ b/schema/definitions.json @@ -143,7 +143,7 @@ "additionalProperties": false, "properties": { "custom": { - "$ref": "plugin/custom.json" + "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/custom.json" } }, "required": ["custom"] @@ -153,7 +153,7 @@ "additionalProperties": false, "properties": { "akeneo": { - "$ref": "plugin/akeneo.json" + "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/akeneo.json" } }, "required": ["akeneo"] @@ -163,7 +163,7 @@ "additionalProperties": false, "properties": { "sylius": { - "$ref": "plugin/sylius.json" + "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/sylius.json" } }, "required": ["sylius"] @@ -173,7 +173,7 @@ "additionalProperties": false, "properties": { "csv": { - "$ref": "plugin/csv.json" + "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/csv.json" } }, "required": ["csv"] @@ -183,7 +183,7 @@ "additionalProperties": false, "properties": { "spreadsheet": { - "$ref": "plugin/spreadsheet.json" + "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/spreadsheet.json" } }, "required": ["spreadsheet"] @@ -193,7 +193,7 @@ "additionalProperties": false, "properties": { "fastmap": { - "$ref": "plugin/fastmap.json" + "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json" } }, "required": ["fastmap"] @@ -203,7 +203,7 @@ "additionalProperties": false, "properties": { "stream": { - "$ref": "plugin/stream.json" + "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/stream.json" } }, "required": ["stream"] @@ -213,7 +213,7 @@ "additionalProperties": false, "properties": { "batch": { - "$ref": "plugin/batch.json" + "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/batch.json" } }, "required": ["batch"] @@ -223,7 +223,7 @@ "additionalProperties": false, "properties": { "ftp": { - "$ref": "plugin/ftp.json" + "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/ftp.json" } }, "required": ["ftp"] @@ -233,7 +233,7 @@ "additionalProperties": false, "properties": { "http": { - "$ref": "plugin/http.json" + "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/http.json" } }, "required": ["http"] @@ -243,7 +243,7 @@ "additionalProperties": false, "properties": { "sftp": { - "$ref": "plugin/sftp.json" + "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/sftp.json" } }, "required": ["sftp"] @@ -253,7 +253,7 @@ "additionalProperties": false, "properties": { "sql": { - "$ref": "plugin/sql.json" + "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/sql.json" } }, "required": ["sql"] @@ -263,7 +263,7 @@ "additionalProperties": false, "properties": { "json": { - "$ref": "plugin/json.json" + "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/json.json" } }, "required": ["json"] diff --git a/schema/expressions.json b/schema/expressions.json index 81172e07..8abec5a1 100644 --- a/schema/expressions.json +++ b/schema/expressions.json @@ -54,6 +54,21 @@ { "type": "number" } ] }, + "expression-or-boolean": { + "oneOf": [ + { "$ref": "#/$defs/bundled-expression" }, + { "type": "boolean" } + ] + }, + "expression-or-any": { + "oneOf": [ + { "$ref": "#/$defs/bundled-expression" }, + { "$ref": "#/$defs/datetime" }, + { "type": "string" }, + { "type": "number" }, + { "type": "boolean" } + ] + }, "expression-or-datetime": { "oneOf": [ { "$ref": "#/$defs/bundled-expression" }, diff --git a/schema/plugin/akeneo.json b/schema/plugin/akeneo.json index 6330490d..85566178 100644 --- a/schema/plugin/akeneo.json +++ b/schema/plugin/akeneo.json @@ -121,14 +121,14 @@ "type": "object", "additionalProperties": false, "properties": { - "map": { "$ref": "fastmap.json#/$defs/fastmap-items" } + "map": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" } } }, { "type": "object", "additionalProperties": false, "properties": { - "object": { "$ref": "fastmap.json#/$defs/fastmap-items" }, + "object": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" }, "class": { "type": "string" } } } diff --git a/schema/plugin/sql.json b/schema/plugin/sql.json index 33ca5028..e8d136ea 100644 --- a/schema/plugin/sql.json +++ b/schema/plugin/sql.json @@ -3,9 +3,211 @@ "$id": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/sql.json", "title": "SQL plugin for Middleware Satellite", "description": "A Satellite is a micro-service aimed at managing data pipelines and data processing", - "type": "object", - "additionalProperties": false, - "properties": { - "expression_language": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/definitions.json#/$defs/expression_language" } - } + "$defs": { + "connection": { + "type": "object", + "properties": { + "dsn": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "username": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "password": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "persistent": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-boolean" }, + "shared": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-boolean" } + } + }, + "query-parameters": { + "oneOf": [ + { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "properties": { + "oneOf": [ + { + "type": "object", + "properties": { + "value": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-any" } + } + }, + { + "type": "object", + "properties": { + "from": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/bundled-expression" } + } + } + ] + } + } + } + }, + { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": "object", + "properties": { + "value": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-any" } + } + } + } + } + ] + }, + "query-list": { + "type": "array", + "items": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" } + } + }, + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression_language": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/definitions.json#/$defs/expression_language" }, + "connection": { "$ref": "#/$defs/connection"}, + "before": { "$ref": "#/$defs/query-list"}, + "after": { "$ref": "#/$defs/query-list"}, + "extractor": { + "oneOf": [ + { + "type": "object", + "properties": { + "query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "parameters": { "$ref": "#/$defs/query-parameters"} + } + }, + { + "type": "object", + "properties": { + "conditional": { + "type": "array", + "items": { + "type": "object", + "properties": { + "condition":{ "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/bundled-expression" }, + "query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "parameters": { "$ref": "#/$defs/query-parameters"} + } + } + } + } + } + ] + } + } + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression_language": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/definitions.json#/$defs/expression_language" }, + "connection": { "$ref": "#/$defs/connection"}, + "before": { "$ref": "#/$defs/query-list"}, + "after": { "$ref": "#/$defs/query-list"}, + "lookup": { + "oneOf": [ + { + "type": "object", + "properties": { + "query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "parameters": { "$ref": "#/$defs/query-parameters"}, + "merge": { + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "map": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" } + } + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" }, + "class": { "type": "string" } + } + } + ] + } + } + }, + { + "type": "object", + "properties": { + "conditional": { + "type": "array", + "items": { + "type": "object", + "properties": { + "condition":{ "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/bundled-expression" }, + "query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "parameters": { "$ref": "#/$defs/query-parameters"}, + "merge": { + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "map": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" } + } + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" }, + "class": { "type": "string" } + } + } + ] + } + } + } + } + } + } + ] + } + } + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression_language": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/definitions.json#/$defs/expression_language" }, + "connection": { "$ref": "#/$defs/connection"}, + "before": { "$ref": "#/$defs/query-list"}, + "after": { "$ref": "#/$defs/query-list"}, + "loader": { + "oneOf": [ + { + "type": "object", + "properties": { + "query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "parameters": { "$ref": "#/$defs/query-parameters"} + } + }, + { + "type": "object", + "properties": { + "conditional": { + "type": "array", + "items": { + "type": "object", + "properties": { + "condition":{ "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/bundled-expression" }, + "query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "parameters": { "$ref": "#/$defs/query-parameters"} + } + } + } + } + } + ] + } + } + } + ] }