From 9a344d67ab4a7277fe5d42fded9f0271b67f4811 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 30 Sep 2024 09:17:52 +0400 Subject: [PATCH 1/2] Add trace_redact to RedactProcessor --- output/openapi/elasticsearch-openapi.json | 21 ++++ .../elasticsearch-serverless-openapi.json | 21 ++++ output/schema/schema-serverless.json | 96 +++++++++++++++---- output/schema/schema.json | 96 +++++++++++++++---- output/typescript/types.ts | 6 ++ specification/ingest/_types/Processors.ts | 7 ++ specification/ingest/simulate/types.ts | 10 ++ 7 files changed, 219 insertions(+), 38 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 3f8184d024..34dfacef20 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -70585,6 +70585,11 @@ "skip_if_unlicensed": { "description": "If `true` and the current license does not support running redact processors, then the processor quietly exits without modifying the document", "type": "boolean" + }, + "trace_redact": { + "description": "If `true` then ingest metadata `_ingest._redact._is_redacted` is set to `true` if the document has been redacted", + "x-available-since": "8.16.0", + "type": "boolean" } }, "required": [ @@ -71074,6 +71079,9 @@ "ingest.simulate:Ingest": { "type": "object", "properties": { + "_redact": { + "$ref": "#/components/schemas/ingest.simulate:Redact" + }, "timestamp": { "$ref": "#/components/schemas/_types:DateTime" }, @@ -71085,6 +71093,19 @@ "timestamp" ] }, + "ingest.simulate:Redact": { + "type": "object", + "properties": { + "_is_redacted": { + "description": "indicates if document has been redacted", + "x-available-since": "8.16.0", + "type": "boolean" + } + }, + "required": [ + "_is_redacted" + ] + }, "_spec_utils:StringifiedVersionNumber": { "description": "Some APIs will return values such as numbers also as a string (notably epoch timestamps). This behavior\nis used to capture this behavior while keeping the semantics of the field type.\n\nDepending on the target language, code generators can keep the union or remove it and leniently parse\nstrings to the target type.", "oneOf": [ diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 89b49e7af8..94d3f1217e 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -47050,6 +47050,11 @@ "skip_if_unlicensed": { "description": "If `true` and the current license does not support running redact processors, then the processor quietly exits without modifying the document", "type": "boolean" + }, + "trace_redact": { + "description": "If `true` then ingest metadata `_ingest._redact._is_redacted` is set to `true` if the document has been redacted", + "x-available-since": "8.16.0", + "type": "boolean" } }, "required": [ @@ -47539,6 +47544,9 @@ "ingest.simulate:Ingest": { "type": "object", "properties": { + "_redact": { + "$ref": "#/components/schemas/ingest.simulate:Redact" + }, "timestamp": { "$ref": "#/components/schemas/_types:DateTime" }, @@ -47550,6 +47558,19 @@ "timestamp" ] }, + "ingest.simulate:Redact": { + "type": "object", + "properties": { + "_is_redacted": { + "description": "indicates if document has been redacted", + "x-available-since": "8.16.0", + "type": "boolean" + } + }, + "required": [ + "_is_redacted" + ] + }, "_spec_utils:StringifiedVersionNumber": { "description": "Some APIs will return values such as numbers also as a string (notably epoch timestamps). This behavior\nis used to capture this behavior while keeping the semantics of the field type.\n\nDepending on the target language, code generators can keep the union or remove it and leniently parse\nstrings to the target type.", "oneOf": [ diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 61b940d60f..0128149daa 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -93996,7 +93996,7 @@ "name": "ShapeType", "namespace": "ingest._types" }, - "specLocation": "ingest/_types/Processors.ts#L1225-L1228" + "specLocation": "ingest/_types/Processors.ts#L1232-L1235" }, { "kind": "enum", @@ -123250,9 +123250,28 @@ "namespace": "_builtins" } } + }, + { + "availability": { + "serverless": {}, + "stack": { + "since": "8.16.0" + } + }, + "description": "If `true` then ingest metadata `_ingest._redact._is_redacted` is set to `true` if the document has been redacted", + "name": "trace_redact", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ], - "specLocation": "ingest/_types/Processors.ts#L1056-L1090" + "specLocation": "ingest/_types/Processors.ts#L1056-L1097" }, { "inherits": { @@ -123305,7 +123324,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1092-L1106" + "specLocation": "ingest/_types/Processors.ts#L1099-L1113" }, { "inherits": { @@ -123358,7 +123377,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1108-L1124" + "specLocation": "ingest/_types/Processors.ts#L1115-L1131" }, { "inherits": { @@ -123440,7 +123459,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1126-L1154" + "specLocation": "ingest/_types/Processors.ts#L1133-L1161" }, { "inherits": { @@ -123512,7 +123531,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1156-L1176" + "specLocation": "ingest/_types/Processors.ts#L1163-L1183" }, { "inherits": { @@ -123598,7 +123617,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1178-L1212" + "specLocation": "ingest/_types/Processors.ts#L1185-L1219" }, { "inherits": { @@ -123641,7 +123660,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1214-L1223" + "specLocation": "ingest/_types/Processors.ts#L1221-L1230" }, { "inherits": { @@ -123694,7 +123713,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1230-L1246" + "specLocation": "ingest/_types/Processors.ts#L1237-L1253" }, { "inherits": { @@ -123773,7 +123792,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1248-L1273" + "specLocation": "ingest/_types/Processors.ts#L1255-L1280" }, { "inherits": { @@ -123827,7 +123846,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1275-L1291" + "specLocation": "ingest/_types/Processors.ts#L1282-L1298" }, { "inherits": { @@ -123881,7 +123900,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1293-L1309" + "specLocation": "ingest/_types/Processors.ts#L1300-L1316" }, { "inherits": { @@ -123935,7 +123954,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1311-L1327" + "specLocation": "ingest/_types/Processors.ts#L1318-L1334" }, { "inherits": { @@ -124015,7 +124034,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1329-L1355" + "specLocation": "ingest/_types/Processors.ts#L1336-L1362" }, { "inherits": { @@ -124170,7 +124189,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L50-L64" + "specLocation": "ingest/simulate/types.ts#L60-L74" }, { "kind": "interface", @@ -124216,7 +124235,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L34-L38" + "specLocation": "ingest/simulate/types.ts#L44-L48" }, { "attachedBehaviors": [ @@ -124356,7 +124375,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L66-L96" + "specLocation": "ingest/simulate/types.ts#L76-L106" }, { "kind": "interface", @@ -124365,6 +124384,17 @@ "namespace": "ingest.simulate" }, "properties": [ + { + "name": "_redact", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Redact", + "namespace": "ingest.simulate" + } + } + }, { "name": "timestamp", "required": true, @@ -124388,7 +124418,35 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L29-L32" + "specLocation": "ingest/simulate/types.ts#L29-L33" + }, + { + "kind": "interface", + "name": { + "name": "Redact", + "namespace": "ingest.simulate" + }, + "properties": [ + { + "availability": { + "serverless": {}, + "stack": { + "since": "8.16.0" + } + }, + "description": "indicates if document has been redacted", + "name": "_is_redacted", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "ingest/simulate/types.ts#L35-L42" }, { "kind": "interface", @@ -124475,7 +124533,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L40-L48" + "specLocation": "ingest/simulate/types.ts#L50-L58" }, { "kind": "interface", diff --git a/output/schema/schema.json b/output/schema/schema.json index 47fc6f06c5..51ddc7a703 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -143532,9 +143532,28 @@ "namespace": "_builtins" } } + }, + { + "availability": { + "serverless": {}, + "stack": { + "since": "8.16.0" + } + }, + "description": "If `true` then ingest metadata `_ingest._redact._is_redacted` is set to `true` if the document has been redacted", + "name": "trace_redact", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ], - "specLocation": "ingest/_types/Processors.ts#L1056-L1090" + "specLocation": "ingest/_types/Processors.ts#L1056-L1097" }, { "kind": "interface", @@ -143587,7 +143606,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1092-L1106" + "specLocation": "ingest/_types/Processors.ts#L1099-L1113" }, { "kind": "interface", @@ -143640,7 +143659,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1108-L1124" + "specLocation": "ingest/_types/Processors.ts#L1115-L1131" }, { "kind": "interface", @@ -143722,7 +143741,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1126-L1154" + "specLocation": "ingest/_types/Processors.ts#L1133-L1161" }, { "kind": "interface", @@ -143794,7 +143813,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1156-L1176" + "specLocation": "ingest/_types/Processors.ts#L1163-L1183" }, { "kind": "interface", @@ -143880,7 +143899,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1178-L1212" + "specLocation": "ingest/_types/Processors.ts#L1185-L1219" }, { "kind": "interface", @@ -143923,7 +143942,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1214-L1223" + "specLocation": "ingest/_types/Processors.ts#L1221-L1230" }, { "kind": "enum", @@ -143939,7 +143958,7 @@ "name": "ShapeType", "namespace": "ingest._types" }, - "specLocation": "ingest/_types/Processors.ts#L1225-L1228" + "specLocation": "ingest/_types/Processors.ts#L1232-L1235" }, { "kind": "interface", @@ -143992,7 +144011,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1230-L1246" + "specLocation": "ingest/_types/Processors.ts#L1237-L1253" }, { "kind": "interface", @@ -144071,7 +144090,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1248-L1273" + "specLocation": "ingest/_types/Processors.ts#L1255-L1280" }, { "kind": "interface", @@ -144125,7 +144144,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1275-L1291" + "specLocation": "ingest/_types/Processors.ts#L1282-L1298" }, { "kind": "interface", @@ -144179,7 +144198,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1293-L1309" + "specLocation": "ingest/_types/Processors.ts#L1300-L1316" }, { "kind": "interface", @@ -144259,7 +144278,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1329-L1355" + "specLocation": "ingest/_types/Processors.ts#L1336-L1362" }, { "kind": "interface", @@ -144313,7 +144332,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1311-L1327" + "specLocation": "ingest/_types/Processors.ts#L1318-L1334" }, { "kind": "interface", @@ -145451,7 +145470,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L50-L64" + "specLocation": "ingest/simulate/types.ts#L60-L74" }, { "kind": "interface", @@ -145591,7 +145610,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L66-L96" + "specLocation": "ingest/simulate/types.ts#L76-L106" }, { "kind": "interface", @@ -145600,6 +145619,17 @@ "namespace": "ingest.simulate" }, "properties": [ + { + "name": "_redact", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Redact", + "namespace": "ingest.simulate" + } + } + }, { "name": "timestamp", "required": true, @@ -145623,7 +145653,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L29-L32" + "specLocation": "ingest/simulate/types.ts#L29-L33" }, { "kind": "interface", @@ -145710,7 +145740,35 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L40-L48" + "specLocation": "ingest/simulate/types.ts#L50-L58" + }, + { + "kind": "interface", + "name": { + "name": "Redact", + "namespace": "ingest.simulate" + }, + "properties": [ + { + "availability": { + "serverless": {}, + "stack": { + "since": "8.16.0" + } + }, + "description": "indicates if document has been redacted", + "name": "_is_redacted", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "ingest/simulate/types.ts#L35-L42" }, { "kind": "request", @@ -145861,7 +145919,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L34-L38" + "specLocation": "ingest/simulate/types.ts#L44-L48" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index e9e3ef2ad2..56f3759ce7 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -13063,6 +13063,7 @@ export interface IngestRedactProcessor extends IngestProcessorBase { suffix?: string ignore_missing?: boolean skip_if_unlicensed?: boolean + trace_redact?: boolean } export interface IngestRemoveProcessor extends IngestProcessorBase { @@ -13278,6 +13279,7 @@ export type IngestSimulateDocumentSimulation = IngestSimulateDocumentSimulationK & { [property: string]: string | Id | IndexName | IngestSimulateIngest | Record | SpecUtilsStringified | VersionType } export interface IngestSimulateIngest { + _redact?: IngestSimulateRedact timestamp: DateTime pipeline?: Name } @@ -13292,6 +13294,10 @@ export interface IngestSimulatePipelineSimulation { error?: ErrorCause } +export interface IngestSimulateRedact { + _is_redacted: boolean +} + export interface IngestSimulateRequest extends RequestBase { id?: Id verbose?: boolean diff --git a/specification/ingest/_types/Processors.ts b/specification/ingest/_types/Processors.ts index 33212aeaf9..27b0729437 100644 --- a/specification/ingest/_types/Processors.ts +++ b/specification/ingest/_types/Processors.ts @@ -1087,6 +1087,13 @@ export class RedactProcessor extends ProcessorBase { * @server_default false */ skip_if_unlicensed?: boolean + /** + * If `true` then ingest metadata `_ingest._redact._is_redacted` is set to `true` if the document has been redacted + * @availability stack since=8.16.0 + * @availability serverless + * @server_default false + */ + trace_redact?: boolean } export class RemoveProcessor extends ProcessorBase { diff --git a/specification/ingest/simulate/types.ts b/specification/ingest/simulate/types.ts index 50b113ff08..d31050dd5a 100644 --- a/specification/ingest/simulate/types.ts +++ b/specification/ingest/simulate/types.ts @@ -27,10 +27,20 @@ import { ErrorCause } from '@_types/Errors' import { DateTime } from '@_types/Time' export class Ingest { + _redact?: Redact timestamp: DateTime pipeline?: Name } +export class Redact { + /** + * indicates if document has been redacted + * @availability stack since=8.16.0 + * @availability serverless + */ + _is_redacted: boolean +} + export class SimulateDocumentResult { doc?: DocumentSimulation error?: ErrorCause From 358da78eb06266f6194396d2b4441f7d57e0e39e Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 30 Sep 2024 13:56:47 +0400 Subject: [PATCH 2/2] Move availability annotation --- output/openapi/elasticsearch-openapi.json | 1 - .../elasticsearch-serverless-openapi.json | 1 - output/schema/schema-serverless.json | 24 +++++++++---------- output/schema/schema.json | 24 +++++++++---------- specification/ingest/simulate/types.ts | 6 +++-- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 34dfacef20..6f96e38b7e 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -71098,7 +71098,6 @@ "properties": { "_is_redacted": { "description": "indicates if document has been redacted", - "x-available-since": "8.16.0", "type": "boolean" } }, diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 94d3f1217e..1eb75e6ebf 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -47563,7 +47563,6 @@ "properties": { "_is_redacted": { "description": "indicates if document has been redacted", - "x-available-since": "8.16.0", "type": "boolean" } }, diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 0128149daa..aabc06715e 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -124189,7 +124189,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L60-L74" + "specLocation": "ingest/simulate/types.ts#L62-L76" }, { "kind": "interface", @@ -124235,7 +124235,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L44-L48" + "specLocation": "ingest/simulate/types.ts#L46-L50" }, { "attachedBehaviors": [ @@ -124375,7 +124375,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L76-L106" + "specLocation": "ingest/simulate/types.ts#L78-L108" }, { "kind": "interface", @@ -124385,6 +124385,12 @@ }, "properties": [ { + "availability": { + "serverless": {}, + "stack": { + "since": "8.16.0" + } + }, "name": "_redact", "required": false, "type": { @@ -124418,7 +124424,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L29-L33" + "specLocation": "ingest/simulate/types.ts#L29-L37" }, { "kind": "interface", @@ -124428,12 +124434,6 @@ }, "properties": [ { - "availability": { - "serverless": {}, - "stack": { - "since": "8.16.0" - } - }, "description": "indicates if document has been redacted", "name": "_is_redacted", "required": true, @@ -124446,7 +124446,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L35-L42" + "specLocation": "ingest/simulate/types.ts#L39-L44" }, { "kind": "interface", @@ -124533,7 +124533,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L50-L58" + "specLocation": "ingest/simulate/types.ts#L52-L60" }, { "kind": "interface", diff --git a/output/schema/schema.json b/output/schema/schema.json index 51ddc7a703..cd29d9a588 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -145470,7 +145470,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L60-L74" + "specLocation": "ingest/simulate/types.ts#L62-L76" }, { "kind": "interface", @@ -145610,7 +145610,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L76-L106" + "specLocation": "ingest/simulate/types.ts#L78-L108" }, { "kind": "interface", @@ -145620,6 +145620,12 @@ }, "properties": [ { + "availability": { + "serverless": {}, + "stack": { + "since": "8.16.0" + } + }, "name": "_redact", "required": false, "type": { @@ -145653,7 +145659,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L29-L33" + "specLocation": "ingest/simulate/types.ts#L29-L37" }, { "kind": "interface", @@ -145740,7 +145746,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L50-L58" + "specLocation": "ingest/simulate/types.ts#L52-L60" }, { "kind": "interface", @@ -145750,12 +145756,6 @@ }, "properties": [ { - "availability": { - "serverless": {}, - "stack": { - "since": "8.16.0" - } - }, "description": "indicates if document has been redacted", "name": "_is_redacted", "required": true, @@ -145768,7 +145768,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L35-L42" + "specLocation": "ingest/simulate/types.ts#L39-L44" }, { "kind": "request", @@ -145919,7 +145919,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L44-L48" + "specLocation": "ingest/simulate/types.ts#L46-L50" }, { "kind": "interface", diff --git a/specification/ingest/simulate/types.ts b/specification/ingest/simulate/types.ts index d31050dd5a..601377f7ac 100644 --- a/specification/ingest/simulate/types.ts +++ b/specification/ingest/simulate/types.ts @@ -27,6 +27,10 @@ import { ErrorCause } from '@_types/Errors' import { DateTime } from '@_types/Time' export class Ingest { + /** + * @availability stack since=8.16.0 + * @availability serverless + */ _redact?: Redact timestamp: DateTime pipeline?: Name @@ -35,8 +39,6 @@ export class Ingest { export class Redact { /** * indicates if document has been redacted - * @availability stack since=8.16.0 - * @availability serverless */ _is_redacted: boolean }