From e4be5c27b20c9f52753b2e0c08d01cc914e1a30b Mon Sep 17 00:00:00 2001 From: Laura Date: Wed, 24 Jan 2024 18:51:48 +0100 Subject: [PATCH 1/2] using ScriptProcessor instead of Script in ProcessorContainer --- .../elasticsearch-serverless-openapi.json | 32 +++++++- output/schema/schema.json | 76 ++++++++++++++++++- output/typescript/types.ts | 9 ++- specification/ingest/_types/Processors.ts | 3 +- 4 files changed, 114 insertions(+), 6 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 28128eff05..50717e6ed8 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -49276,7 +49276,7 @@ "$ref": "#/components/schemas/ingest._types:RerouteProcessor" }, "script": { - "$ref": "#/components/schemas/_types:Script" + "$ref": "#/components/schemas/ingest._types:ScriptProcessor" }, "set": { "$ref": "#/components/schemas/ingest._types:SetProcessor" @@ -50120,6 +50120,36 @@ } ] }, + "ingest._types:ScriptProcessor": { + "allOf": [ + { + "$ref": "#/components/schemas/ingest._types:ProcessorBase" + }, + { + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/_types:Id" + }, + "lang": { + "description": "Script language.", + "type": "string" + }, + "params": { + "description": "Object containing parameters for the script.", + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "source": { + "description": "Inline script.\nIf no `id` is specified, this parameter is required.", + "type": "string" + } + } + } + ] + }, "ingest._types:SetProcessor": { "allOf": [ { diff --git a/output/schema/schema.json b/output/schema/schema.json index 7a4da04ca2..f2034664eb 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -130741,8 +130741,8 @@ "type": { "kind": "instance_of", "type": { - "name": "Script", - "namespace": "_types" + "name": "ScriptProcessor", + "namespace": "ingest._types" } } }, @@ -131111,6 +131111,78 @@ ], "specLocation": "ingest/_types/Processors.ts#L967-L995" }, + { + "inherits": { + "type": { + "name": "ProcessorBase", + "namespace": "ingest._types" + } + }, + "kind": "interface", + "name": { + "name": "ScriptProcessor", + "namespace": "ingest._types" + }, + "properties": [ + { + "description": "ID of a stored script.\nIf no `source` is specified, this parameter is required.", + "name": "id", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + }, + { + "description": "Script language.", + "name": "lang", + "required": false, + "serverDefault": "painless", + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "Object containing parameters for the script.", + "name": "params", + "required": false, + "type": { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "user_defined_value" + } + } + }, + { + "description": "Inline script.\nIf no `id` is specified, this parameter is required.", + "name": "source", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "ingest/_types/Processors.ts#L997-L1017" + }, { "inherits": { "type": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 0cf814db6c..2ef2182aa2 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11770,7 +11770,7 @@ export interface IngestProcessorContainer { remove?: IngestRemoveProcessor rename?: IngestRenameProcessor reroute?: IngestRerouteProcessor - script?: Script + script?: IngestScriptProcessor set?: IngestSetProcessor sort?: IngestSortProcessor split?: IngestSplitProcessor @@ -11803,6 +11803,13 @@ export interface IngestRerouteProcessor extends IngestProcessorBase { namespace?: string | string[] } +export interface IngestScriptProcessor extends IngestProcessorBase { + id?: Id + lang?: string + params?: Record + source?: string +} + export interface IngestSetProcessor extends IngestProcessorBase { copy_from?: Field field: Field diff --git a/specification/ingest/_types/Processors.ts b/specification/ingest/_types/Processors.ts index 83ec6ba656..ae014053b5 100644 --- a/specification/ingest/_types/Processors.ts +++ b/specification/ingest/_types/Processors.ts @@ -23,7 +23,6 @@ import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { Field, Fields, Id, Name } from '@_types/common' import { GeoShapeRelation } from '@_types/Geo' import { double, integer, long } from '@_types/Numeric' -import { Script } from '@_types/Scripting' /** * @variants container @@ -159,7 +158,7 @@ export class ProcessorContainer { * The script runs in the `ingest` context. * @doc_id script-processor */ - script?: Script + script?: ScriptProcessor /** * Adds a field with the specified value. * If the field already exists, its value will be replaced with the provided one. From fa6d7b1ea8187970bcf82fdb6293ef1e2127455d Mon Sep 17 00:00:00 2001 From: Laura Date: Mon, 29 Jan 2024 14:08:16 +0100 Subject: [PATCH 2/2] correctly contrib --- output/schema/schema.json | 88 +++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index f2034664eb..d42a894c6b 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -128418,7 +128418,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L280-L295" + "specLocation": "ingest/_types/Processors.ts#L279-L294" }, { "inherits": { @@ -128525,7 +128525,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L297-L333" + "specLocation": "ingest/_types/Processors.ts#L296-L332" }, { "inherits": { @@ -128579,7 +128579,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L388-L404" + "specLocation": "ingest/_types/Processors.ts#L387-L403" }, { "inherits": { @@ -128656,7 +128656,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L406-L429" + "specLocation": "ingest/_types/Processors.ts#L405-L428" }, { "inherits": { @@ -128722,7 +128722,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L441-L461" + "specLocation": "ingest/_types/Processors.ts#L440-L460" }, { "kind": "enum", @@ -128753,7 +128753,7 @@ "name": "ConvertType", "namespace": "ingest._types" }, - "specLocation": "ingest/_types/Processors.ts#L431-L439" + "specLocation": "ingest/_types/Processors.ts#L430-L438" }, { "inherits": { @@ -128851,7 +128851,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L463-L496" + "specLocation": "ingest/_types/Processors.ts#L462-L495" }, { "inherits": { @@ -128957,7 +128957,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L498-L536" + "specLocation": "ingest/_types/Processors.ts#L497-L535" }, { "inherits": { @@ -129039,7 +129039,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L538-L565" + "specLocation": "ingest/_types/Processors.ts#L537-L564" }, { "inherits": { @@ -129105,7 +129105,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L567-L586" + "specLocation": "ingest/_types/Processors.ts#L566-L585" }, { "inherits": { @@ -129145,7 +129145,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L588-L599" + "specLocation": "ingest/_types/Processors.ts#L587-L598" }, { "inherits": { @@ -129160,7 +129160,7 @@ "namespace": "ingest._types" }, "properties": [], - "specLocation": "ingest/_types/Processors.ts#L601-L601" + "specLocation": "ingest/_types/Processors.ts#L600-L600" }, { "inherits": { @@ -129264,7 +129264,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L603-L642" + "specLocation": "ingest/_types/Processors.ts#L602-L641" }, { "inherits": { @@ -129292,7 +129292,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L644-L650" + "specLocation": "ingest/_types/Processors.ts#L643-L649" }, { "inherits": { @@ -129345,7 +129345,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L652-L666" + "specLocation": "ingest/_types/Processors.ts#L651-L665" }, { "inherits": { @@ -129440,7 +129440,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L335-L364" + "specLocation": "ingest/_types/Processors.ts#L334-L363" }, { "inherits": { @@ -129532,7 +129532,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L668-L693" + "specLocation": "ingest/_types/Processors.ts#L667-L692" }, { "inherits": { @@ -129610,7 +129610,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L695-L719" + "specLocation": "ingest/_types/Processors.ts#L694-L718" }, { "kind": "interface", @@ -129644,7 +129644,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L742-L754", + "specLocation": "ingest/_types/Processors.ts#L741-L753", "variants": { "kind": "container" } @@ -129721,7 +129721,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L769-L795" + "specLocation": "ingest/_types/Processors.ts#L768-L794" }, { "kind": "interface", @@ -129757,7 +129757,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L756-L767" + "specLocation": "ingest/_types/Processors.ts#L755-L766" }, { "inherits": { @@ -129829,7 +129829,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L721-L740" + "specLocation": "ingest/_types/Processors.ts#L720-L739" }, { "inherits": { @@ -129882,7 +129882,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L797-L812" + "specLocation": "ingest/_types/Processors.ts#L796-L811" }, { "inherits": { @@ -129961,7 +129961,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L814-L843" + "specLocation": "ingest/_types/Processors.ts#L813-L842" }, { "kind": "enum", @@ -129979,7 +129979,7 @@ "name": "JsonProcessorConflictStrategy", "namespace": "ingest._types" }, - "specLocation": "ingest/_types/Processors.ts#L845-L850" + "specLocation": "ingest/_types/Processors.ts#L844-L849" }, { "inherits": { @@ -130136,7 +130136,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L852-L904" + "specLocation": "ingest/_types/Processors.ts#L851-L903" }, { "inherits": { @@ -130190,7 +130190,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L906-L922" + "specLocation": "ingest/_types/Processors.ts#L905-L921" }, { "kind": "interface", @@ -130356,7 +130356,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L924-L935" + "specLocation": "ingest/_types/Processors.ts#L923-L934" }, { "kind": "interface", @@ -130429,7 +130429,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L242-L265" + "specLocation": "ingest/_types/Processors.ts#L241-L264" }, { "kind": "interface", @@ -130929,7 +130929,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L28-L240", + "specLocation": "ingest/_types/Processors.ts#L27-L239", "variants": { "kind": "container", "nonExhaustive": true @@ -130974,7 +130974,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L937-L947" + "specLocation": "ingest/_types/Processors.ts#L936-L946" }, { "inherits": { @@ -131027,7 +131027,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L949-L965" + "specLocation": "ingest/_types/Processors.ts#L948-L964" }, { "inherits": { @@ -131109,7 +131109,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L967-L995" + "specLocation": "ingest/_types/Processors.ts#L966-L994" }, { "inherits": { @@ -131181,7 +131181,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L997-L1017" + "specLocation": "ingest/_types/Processors.ts#L996-L1016" }, { "inherits": { @@ -131267,7 +131267,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1019-L1053" + "specLocation": "ingest/_types/Processors.ts#L1018-L1052" }, { "inherits": { @@ -131310,7 +131310,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1055-L1064" + "specLocation": "ingest/_types/Processors.ts#L1054-L1063" }, { "kind": "enum", @@ -131326,7 +131326,7 @@ "name": "ShapeType", "namespace": "ingest._types" }, - "specLocation": "ingest/_types/Processors.ts#L1066-L1069" + "specLocation": "ingest/_types/Processors.ts#L1065-L1068" }, { "inherits": { @@ -131379,7 +131379,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1071-L1087" + "specLocation": "ingest/_types/Processors.ts#L1070-L1086" }, { "inherits": { @@ -131458,7 +131458,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1089-L1114" + "specLocation": "ingest/_types/Processors.ts#L1088-L1113" }, { "inherits": { @@ -131512,7 +131512,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1116-L1132" + "specLocation": "ingest/_types/Processors.ts#L1115-L1131" }, { "inherits": { @@ -131566,7 +131566,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1134-L1150" + "specLocation": "ingest/_types/Processors.ts#L1133-L1149" }, { "inherits": { @@ -131620,7 +131620,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1152-L1168" + "specLocation": "ingest/_types/Processors.ts#L1151-L1167" }, { "inherits": { @@ -131700,7 +131700,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L366-L386" + "specLocation": "ingest/_types/Processors.ts#L365-L385" }, { "kind": "enum", @@ -131740,7 +131740,7 @@ "name": "UserAgentProperty", "namespace": "ingest._types" }, - "specLocation": "ingest/_types/Processors.ts#L267-L278" + "specLocation": "ingest/_types/Processors.ts#L266-L277" }, { "attachedBehaviors": [