From 593ad71db4f18e4d9f11b4f8b829aacfb55007ef Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 30 Sep 2024 13:59:12 +0400 Subject: [PATCH] Add trace_redact to RedactProcessor (#2965) * Add trace_redact to RedactProcessor * Move availability annotation --- output/openapi/elasticsearch-openapi.json | 20 ++++ .../elasticsearch-serverless-openapi.json | 20 ++++ 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 | 12 +++ 7 files changed, 219 insertions(+), 38 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index b7c0d0434..2bfca7e4e 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,18 @@ "timestamp" ] }, + "ingest.simulate:Redact": { + "type": "object", + "properties": { + "_is_redacted": { + "description": "indicates if document has been redacted", + "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 89b49e7af..1eb75e6eb 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,18 @@ "timestamp" ] }, + "ingest.simulate:Redact": { + "type": "object", + "properties": { + "_is_redacted": { + "description": "indicates if document has been redacted", + "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 61b940d60..aabc06715 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#L62-L76" }, { "kind": "interface", @@ -124216,7 +124235,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L34-L38" + "specLocation": "ingest/simulate/types.ts#L46-L50" }, { "attachedBehaviors": [ @@ -124356,7 +124375,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L66-L96" + "specLocation": "ingest/simulate/types.ts#L78-L108" }, { "kind": "interface", @@ -124365,6 +124384,23 @@ "namespace": "ingest.simulate" }, "properties": [ + { + "availability": { + "serverless": {}, + "stack": { + "since": "8.16.0" + } + }, + "name": "_redact", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Redact", + "namespace": "ingest.simulate" + } + } + }, { "name": "timestamp", "required": true, @@ -124388,7 +124424,29 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L29-L32" + "specLocation": "ingest/simulate/types.ts#L29-L37" + }, + { + "kind": "interface", + "name": { + "name": "Redact", + "namespace": "ingest.simulate" + }, + "properties": [ + { + "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#L39-L44" }, { "kind": "interface", @@ -124475,7 +124533,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L40-L48" + "specLocation": "ingest/simulate/types.ts#L52-L60" }, { "kind": "interface", diff --git a/output/schema/schema.json b/output/schema/schema.json index 5deb0cd75..a9561dd03 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#L62-L76" }, { "kind": "interface", @@ -145591,7 +145610,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L66-L96" + "specLocation": "ingest/simulate/types.ts#L78-L108" }, { "kind": "interface", @@ -145600,6 +145619,23 @@ "namespace": "ingest.simulate" }, "properties": [ + { + "availability": { + "serverless": {}, + "stack": { + "since": "8.16.0" + } + }, + "name": "_redact", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Redact", + "namespace": "ingest.simulate" + } + } + }, { "name": "timestamp", "required": true, @@ -145623,7 +145659,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L29-L32" + "specLocation": "ingest/simulate/types.ts#L29-L37" }, { "kind": "interface", @@ -145710,7 +145746,29 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L40-L48" + "specLocation": "ingest/simulate/types.ts#L52-L60" + }, + { + "kind": "interface", + "name": { + "name": "Redact", + "namespace": "ingest.simulate" + }, + "properties": [ + { + "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#L39-L44" }, { "kind": "request", @@ -145861,7 +145919,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L34-L38" + "specLocation": "ingest/simulate/types.ts#L46-L50" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index e72b6df53..bb9645c9b 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 33212aeaf..27b072943 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 50b113ff0..601377f7a 100644 --- a/specification/ingest/simulate/types.ts +++ b/specification/ingest/simulate/types.ts @@ -27,10 +27,22 @@ 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 } +export class Redact { + /** + * indicates if document has been redacted + */ + _is_redacted: boolean +} + export class SimulateDocumentResult { doc?: DocumentSimulation error?: ErrorCause