diff --git a/schema/plugin/spreadsheet.json b/schema/plugin/spreadsheet.json index b4b69db1..2fd04a95 100644 --- a/schema/plugin/spreadsheet.json +++ b/schema/plugin/spreadsheet.json @@ -3,9 +3,108 @@ "$id": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/spreadsheet.json", "title": "Spreadsheet 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" } - } + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression_language": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/definitions.json#/$defs/expression_language" }, + "extractor": { + "oneOf": [ + { + "type": "object", + "properties": { + "file_path": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "excel": { + "type": "object", + "properties": { + "sheet": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "skip_lines": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-number" } + } + } + } + }, + { + "type": "object", + "properties": { + "file_path": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "open_document": { + "type": "object", + "properties": { + "sheet": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "skip_lines": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-number" } + } + } + } + }, + { + "type": "object", + "properties": { + "file_path": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "csv": { + "type": "object", + "properties": { + "delimiter": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "enclosure": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "skip_lines": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-number" } + } + } + } + } + ] + } + } + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression_language": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/definitions.json#/$defs/expression_language" }, + "loader": { + "oneOf": [ + { + "type": "object", + "properties": { + "file_path": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "excel": { + "type": "object", + "properties": { + "sheet": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "max_lines": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-number" } + } + } + } + }, + { + "type": "object", + "properties": { + "file_path": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "open_document": { + "type": "object", + "properties": { + "sheet": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "max_lines": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-number" } + } + } + } + }, + { + "type": "object", + "properties": { + "file_path": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "csv": { + "type": "object", + "properties": { + "delimiter": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "enclosure": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }, + "max_lines": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-number" } + } + } + } + } + ] + } + } + } + ] }